1 /*********************************************************************
3 * Filename: irias_object.h
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 */
37 /* Object ownership of attributes (user or kernel) */
38 #define IAS_KERNEL_ATTR 0
39 #define IAS_USER_ATTR 1
45 irda_queue_t q
; /* Must be first! */
54 * Values used by LM-IAS attributes
57 __u8 type
; /* Value description */
58 __u8 owner
; /* Managed from user/kernel space */
59 int charset
; /* Only used by string type */
71 * Attributes used by LM-IAS objects
74 irda_queue_t q
; /* Must be first! */
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
,
86 void __irias_delete_object(struct ias_object
*obj
);
88 void irias_add_integer_attrib(struct ias_object
*obj
, char *name
, int value
,
90 void irias_add_string_attrib(struct ias_object
*obj
, char *name
, char *value
,
92 void irias_add_octseq_attrib(struct ias_object
*obj
, char *name
, __u8
*octets
,
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
;