1 /*********************************************************************
5 * Description: IrDA header file to be used by IrDA applications
6 * Status: Experimental.
7 * Author: Dag Brattli <dagb@cs.uit.no>
8 * Created at: Mon Mar 8 14:06:12 1999
9 * Modified at: Sat Dec 25 16:07:54 1999
10 * Modified by: Dag Brattli <dagb@cs.uit.no>
12 * Copyright (c) 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 ********************************************************************/
28 * GNOKII modifications:
31 * Revision 1.1.1.1 2001/11/25 21:59:20 short
32 * :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001
34 * Revision 1.3 2001/07/05 10:54:53 pkot
35 * Solaris 2.7 fixes - should be harmless for other OSes (Michael Wiedmann)
37 * Revision 1.2 2001/07/03 00:03:37 pkot
38 * Small fixes to let gnokii compile and work under solaris (thanks to Artur Kubiak)
45 #include <sys/types.h>
48 /* Hint bit positions for first hint byte */
51 #define HINT_COMPUTER 0x04
52 #define HINT_PRINTER 0x08
53 #define HINT_MODEM 0x10
56 #define HINT_EXTENSION 0x80
58 /* Hint bit positions for second hint byte (first extension byte) */
59 #define HINT_TELEPHONY 0x01
60 #define HINT_FILE_SERVER 0x02
61 #define HINT_COMM 0x04
62 #define HINT_MESSAGE 0x08
63 #define HINT_HTTP 0x10
64 #define HINT_OBEX 0x20
66 /* IrLMP character code values */
68 #define CS_ISO_8859_1 0x01
69 #define CS_ISO_8859_2 0x02
70 #define CS_ISO_8859_3 0x03
71 #define CS_ISO_8859_4 0x04
72 #define CS_ISO_8859_5 0x05
73 #define CS_ISO_8859_6 0x06
74 #define CS_ISO_8859_7 0x07
75 #define CS_ISO_8859_8 0x08
76 #define CS_ISO_8859_9 0x09
77 #define CS_UNICODE 0xff
79 /* These are the currently known dongles */
81 IRDA_TEKRAM_DONGLE = 0,
83 IRDA_ACTISYS_DONGLE = 2,
84 IRDA_ACTISYS_PLUS_DONGLE = 3,
85 IRDA_GIRBIL_DONGLE = 4,
86 IRDA_LITELINK_DONGLE = 5,
87 IRDA_AIRPORT_DONGLE = 6,
88 IRDA_OLD_BELKIN_DONGLE = 7,
91 /* Protocol types to be used for SOCK_DGRAM */
93 IRDAPROTO_UNITDATA = 0,
98 #define SOL_IRLMP 266 /* Same as SOL_IRDA for now */
99 #define SOL_IRTTP 266 /* Same as SOL_IRDA for now */
101 #define IRLMP_ENUMDEVICES 1
102 #define IRLMP_IAS_SET 2
103 #define IRLMP_IAS_QUERY 3
104 #define IRLMP_HINTS_SET 4
105 #define IRLMP_QOS_SET 5
106 #define IRLMP_QOS_GET 6
107 #define IRLMP_MAX_SDU_SIZE 7
108 #define IRLMP_IAS_GET 8
110 #define IRTTP_MAX_SDU_SIZE IRLMP_MAX_SDU_SIZE /* Compatibility */
113 #define IAS_MAX_STRING 256
114 #define IAS_MAX_OCTET_STRING 1024
115 #define IAS_MAX_CLASSNAME 64
116 #define IAS_MAX_ATTRIBNAME 256
118 /* LM-IAS Attribute types */
119 #define IAS_MISSING 0
120 #define IAS_INTEGER 1
121 #define IAS_OCT_SEQ 2
124 #define LSAP_ANY 0xff
125 #define DEV_ADDR_ANY 0xffffffff
127 struct sockaddr_irda {
128 sa_family_t sir_family; /* AF_IRDA */
129 uint8_t sir_lsap_sel; /* LSAP selector */
130 uint32_t sir_addr; /* Device address */
131 char sir_name[25]; /* Usually <service>:IrDA:TinyTP */
134 struct irda_device_info {
135 uint32_t saddr; /* Address of local interface */
136 uint32_t daddr; /* Address of remote device */
137 char info[22]; /* Description */
138 uint8_t charset; /* Charset used for description */
139 uint8_t hints[2]; /* Hint bits */
142 struct irda_device_list {
144 struct irda_device_info dev[1];
147 struct irda_ias_set {
148 char irda_class_name[IAS_MAX_CLASSNAME];
149 char irda_attrib_name[IAS_MAX_ATTRIBNAME];
150 unsigned int irda_attrib_type;
152 unsigned int irda_attrib_int;
155 u_char octet_seq[IAS_MAX_OCTET_STRING];
156 } irda_attrib_octet_seq;
159 unsigned char charset;
160 unsigned char string[IAS_MAX_STRING];
161 } irda_attrib_string;
167 /* Some private IOCTL's (max 16) */
168 #define SIOCSDONGLE (SIOCDEVPRIVATE + 0)
169 #define SIOCGDONGLE (SIOCDEVPRIVATE + 1)
170 #define SIOCSBANDWIDTH (SIOCDEVPRIVATE + 2)
171 #define SIOCSMEDIABUSY (SIOCDEVPRIVATE + 3)
172 #define SIOCGMEDIABUSY (SIOCDEVPRIVATE + 4)
173 #define SIOCGRECEIVING (SIOCDEVPRIVATE + 5)
174 #define SIOCSMODE (SIOCDEVPRIVATE + 6)
175 #define SIOCGMODE (SIOCDEVPRIVATE + 7)
176 #define SIOCSDTRRTS (SIOCDEVPRIVATE + 8)
177 #define SIOCGQOS (SIOCDEVPRIVATE + 9)
179 /* No reason to include <linux/if.h> just because of this one ;-) */
182 /* IrDA quality of service information (must not exceed 16 bytes) */
186 uint16_t window_size;
187 uint16_t min_turn_time;
188 uint16_t max_turn_time;
193 /* For setting RTS and DTR lines of a dongle */
194 struct if_irda_line {
199 /* IrDA interface configuration (data part must not exceed 16 bytes) */
202 char ifrn_name[IRNAMSIZ]; /* if name, e.g. "irda0" */
207 struct if_irda_line ifru_line;
208 struct if_irda_qos ifru_qos;
209 unsigned short ifru_flags;
210 unsigned int ifru_receiving;
211 unsigned int ifru_mode;
212 unsigned int ifru_dongle;
216 #define ifr_baudrate ifr_ifru.ifru_qos.baudrate
217 #define ifr_receiving ifr_ifru.ifru_receiving
218 #define ifr_dongle ifr_ifru.ifru_dongle
219 #define ifr_mode ifr_ifru.ifru_mode
220 #define ifr_dtr ifr_ifru.ifru_line.dtr
221 #define ifr_rts ifr_ifru.ifru_line.rts