1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25#ifndef LM_IAS_OBJECT_H
26#define LM_IAS_OBJECT_H
27
28#include <net/irda/irda.h>
29#include <net/irda/irqueue.h>
30
31
32#define IAS_MISSING 0
33#define IAS_INTEGER 1
34#define IAS_OCT_SEQ 2
35#define IAS_STRING 3
36
37
38#define IAS_KERNEL_ATTR 0
39#define IAS_USER_ATTR 1
40
41
42
43
44struct ias_object {
45 irda_queue_t q;
46 magic_t magic;
47
48 char *name;
49 int id;
50 hashbin_t *attribs;
51};
52
53
54
55
56struct ias_value {
57 __u8 type;
58 __u8 owner;
59 int charset;
60 int len;
61
62
63 union {
64 int integer;
65 char *string;
66 __u8 *oct_seq;
67 } t;
68};
69
70
71
72
73struct ias_attrib {
74 irda_queue_t q;
75 int magic;
76
77 char *name;
78 struct ias_value *value;
79};
80
81struct ias_object *irias_new_object(char *name, int id);
82void irias_insert_object(struct ias_object *obj);
83int irias_delete_object(struct ias_object *obj);
84int irias_delete_attrib(struct ias_object *obj, struct ias_attrib *attrib,
85 int cleanobject);
86void __irias_delete_object(struct ias_object *obj);
87
88void irias_add_integer_attrib(struct ias_object *obj, char *name, int value,
89 int user);
90void irias_add_string_attrib(struct ias_object *obj, char *name, char *value,
91 int user);
92void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets,
93 int len, int user);
94int irias_object_change_attribute(char *obj_name, char *attrib_name,
95 struct ias_value *new_value);
96struct ias_object *irias_find_object(char *name);
97struct ias_attrib *irias_find_attrib(struct ias_object *obj, char *name);
98
99struct ias_value *irias_new_string_value(char *string);
100struct ias_value *irias_new_integer_value(int integer);
101struct ias_value *irias_new_octseq_value(__u8 *octseq , int len);
102struct ias_value *irias_new_missing_value(void);
103void irias_delete_value(struct ias_value *value);
104
105extern struct ias_value irias_missing;
106extern hashbin_t *irias_objects;
107
108#endif
109