Import 2.3.18pre1
[davej-history.git] / include / net / irda / irias_object.h
blobb057b2a4fb1702cbbb5693444c23a6cc0785f21f
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: Thu Jul 1 11:37:15 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
38 * LM-IAS Object
40 struct ias_object {
41 QUEUE queue;/* Must be first! */
42 magic_t magic;
44 char*name;
45 int id;
46 hashbin_t *attribs;
50 * Values used by LM-IAS attributes
52 struct ias_value {
53 __u8 type;/* Value description */
54 int charset;/* Only used by string type */
55 int len;
57 /* Value */
58 union{
59 int integer;
60 char*string;
61 __u8 *oct_seq;
62 } t;
66 * Attributes used by LM-IAS objects
68 struct ias_attrib {
69 QUEUE queue;/* Must be first! */
70 int magic;
72 char*name;/* Attribute name */
73 struct ias_value *value;/* Attribute value */
76 char*strdup(char*str);
78 struct ias_object *irias_new_object(char*name,int id);
79 voidirias_insert_object(struct ias_object *obj);
80 intirias_delete_object(struct ias_object *obj);
81 void__irias_delete_object(struct ias_object *obj);
83 voidirias_add_integer_attrib(struct ias_object *obj,char*name,int value);
84 voidirias_add_string_attrib(struct ias_object *obj,char*name,char*value);
85 voidirias_add_octseq_attrib(struct ias_object *obj,char*name, __u8 *octets,
86 int len);
87 intirias_object_change_attribute(char*obj_name,char*attrib_name,
88 struct ias_value *new_value);
89 struct ias_object *irias_find_object(char*name);
90 struct ias_attrib *irias_find_attrib(struct ias_object *obj,char*name);
92 struct ias_value *irias_new_string_value(char*string);
93 struct ias_value *irias_new_integer_value(int integer);
94 struct ias_value *irias_new_octseq_value(__u8 *octseq ,int len);
95 voidirias_delete_value(struct ias_value *value);
97 externstruct ias_value missing;
98 extern hashbin_t *objects;
100 #endif
close