00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef LM_IAS_OBJECT_H
00026 #define LM_IAS_OBJECT_H
00027
00028 #include <net/irda/irda.h>
00029 #include <net/irda/irqueue.h>
00030
00031
00032 #define IAS_MISSING 0
00033 #define IAS_INTEGER 1
00034 #define IAS_OCT_SEQ 2
00035 #define IAS_STRING 3
00036
00037
00038
00039
00040 struct ias_object {
00041 queue_t q;
00042 magic_t magic;
00043
00044 char *name;
00045 int id;
00046 hashbin_t *attribs;
00047 };
00048
00049
00050
00051
00052 struct ias_value {
00053 __u8 type;
00054 int charset;
00055 int len;
00056
00057
00058 union {
00059 int integer;
00060 char *string;
00061 __u8 *oct_seq;
00062 } t;
00063 };
00064
00065
00066
00067
00068 struct ias_attrib {
00069 queue_t q;
00070 int magic;
00071
00072 char *name;
00073 struct ias_value *value;
00074 };
00075
00076 char *strdup(char *str);
00077
00078 struct ias_object *irias_new_object(char *name, int id);
00079 void irias_insert_object(struct ias_object *obj);
00080 int irias_delete_object(struct ias_object *obj);
00081 void __irias_delete_object(struct ias_object *obj);
00082
00083 void irias_add_integer_attrib(struct ias_object *obj, char *name, int value);
00084 void irias_add_string_attrib(struct ias_object *obj, char *name, char *value);
00085 void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets,
00086 int len);
00087 int irias_object_change_attribute(char *obj_name, char *attrib_name,
00088 struct ias_value *new_value);
00089 struct ias_object *irias_find_object(char *name);
00090 struct ias_attrib *irias_find_attrib(struct ias_object *obj, char *name);
00091
00092 struct ias_value *irias_new_string_value(char *string);
00093 struct ias_value *irias_new_integer_value(int integer);
00094 struct ias_value *irias_new_octseq_value(__u8 *octseq , int len);
00095 struct ias_value *irias_new_missing_value(void);
00096 void irias_delete_value(struct ias_value *value);
00097
00098 extern struct ias_value missing;
00099 extern hashbin_t *objects;
00100
00101 #endif