Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-btrfs-devel.git] / include / net / irda / irias_object.h
blob83f78081799c2365b3e2039a9a82f46038afe322
1 /*********************************************************************
2 *
3 * Filename: irias_object.h
4 * Version:
5 * Description:
6 * Status: Experimental.
7 * Author: Dag Brattli <dagb@cs.uit.no>
8 * Created at: Thu Oct 1 22:49:50 1998
9 * Modified at: Wed Dec 15 11:20:57 1999
10 * Modified by: Dag Brattli <dagb@cs.uit.no>
12 * Copyright (c) 1998-1999 Dag Brattli, All Rights Reserved.
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
19 * Neither Dag Brattli nor University of Tromsø admit liability nor
20 * provide warranty for any of this software. This material is
21 * provided "AS-IS" and at no charge.
23 ********************************************************************/
25 #ifndef LM_IAS_OBJECT_H
26 #define LM_IAS_OBJECT_H
28 #include <net/irda/irda.h>
29 #include <net/irda/irqueue.h>
31 /* LM-IAS Attribute types */
32 #define IAS_MISSING 0
33 #define IAS_INTEGER 1
34 #define IAS_OCT_SEQ 2
35 #define IAS_STRING 3
37 /* Object ownership of attributes (user or kernel) */
38 #define IAS_KERNEL_ATTR 0
39 #define IAS_USER_ATTR 1
42 * LM-IAS Object
44 struct ias_object {
45 irda_queue_t q; /* Must be first! */
46 magic_t magic;
48 char *name;
49 int id;
50 hashbin_t *attribs;
54 * Values used by LM-IAS attributes
56 struct ias_value {
57 __u8 type; /* Value description */
58 __u8 owner; /* Managed from user/kernel space */
59 int charset; /* Only used by string type */
60 int len;
62 /* Value */
63 union {
64 int integer;
65 char *string;
66 __u8 *oct_seq;
67 } t;
71 * Attributes used by LM-IAS objects
73 struct ias_attrib {
74 irda_queue_t q; /* Must be first! */
75 int magic;
77 char *name; /* Attribute name */
78 struct ias_value *value; /* Attribute value */
81 struct ias_object *irias_new_object(char *name, int id);
82 void irias_insert_object(struct ias_object *obj);
83 int irias_delete_object(struct ias_object *obj);
84 int irias_delete_attrib(struct ias_object *obj, struct ias_attrib *attrib,
85 int cleanobject);
86 void __irias_delete_object(struct ias_object *obj);
88 void irias_add_integer_attrib(struct ias_object *obj, char *name, int value,
89 int user);
90 void irias_add_string_attrib(struct ias_object *obj, char *name, char *value,
91 int user);
92 void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets,
93 int len, int user);
94 int irias_object_change_attribute(char *obj_name, char *attrib_name,
95 struct ias_value *new_value);
96 struct ias_object *irias_find_object(char *name);
97 struct ias_attrib *irias_find_attrib(struct ias_object *obj, char *name);
99 struct ias_value *irias_new_string_value(char *string);
100 struct ias_value *irias_new_integer_value(int integer);
101 struct ias_value *irias_new_octseq_value(__u8 *octseq , int len);
102 struct ias_value *irias_new_missing_value(void);
103 void irias_delete_value(struct ias_value *value);
105 extern struct ias_value irias_missing;
106 extern hashbin_t *irias_objects;
108 #endif