update for HEAD-2003021201
[reactos.git] / include / ddk / af_irda.h
1 /*
2  * af_irda.h
3  *
4  * IrDa ports interface
5  *
6  * This file is part of the MinGW package.
7  *
8  * Contributors:
9  *   Created by Robert Dickenson <robd@users.sourceforge.net>
10  *
11  * THIS SOFTWARE IS NOT COPYRIGHTED
12  *
13  * This source code is offered for use in the public domain. You may
14  * use, modify or distribute it freely.
15  *
16  * This code is distributed in the hope that it will be useful but
17  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18  * DISCLAMED. This includes but is not limited to warranties of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20  *
21  */
22
23 #ifndef __AF_IRDA_H
24 #define __AF_IRDA_H
25
26 #if __GNUC__ >=3
27 #pragma GCC system_header
28 #endif
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 #pragma pack(push,4)
35
36
37 /* GUIDs */
38
39 #ifdef DEFINE_GUID
40 DEFINE_GUID(GUID_DEVINTERFACE_IRDAPORT,
41   0x86e0d1e0L, 0x8089, 0x11d0, 0x9c, 0xe4, 0x08, 0x00, 0x3e, 0x30, 0x1f, 0x74);
42 DEFINE_GUID(GUID_DEVINTERFACE_IRDAENUM_BUS_ENUMERATOR,
43   0x4D36E978L, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x19);
44 #endif // DEFINE_GUID
45
46 #define WINDOWS_AF_IRDA 26
47 #define WINDOWS_PF_IRDA WINDOWS_AF_IRDA
48
49 #ifndef AF_IRDA
50 #define AF_IRDA WINDOWS_AF_IRDA
51 #endif
52
53 #define IRDA_PROTO_SOCK_STREAM 1
54 #define PF_IRDA AF_IRDA
55 #define SOL_IRLMP 0x00FF
56 #define SIO_LAZY_DISCOVERY _IOR('t', 127, ULONG)   
57
58
59 #define IAS_MAX_USER_STRING  256
60 #define IAS_MAX_OCTET_STRING 1024
61 #define IAS_MAX_CLASSNAME    64
62 #define IAS_MAX_ATTRIBNAME   256
63
64 #define IAS_ATTRIB_NO_CLASS  ((ULONG)0x10)
65 #define IAS_ATTRIB_NO_ATTRIB ((ULONG)0x00)
66 #define IAS_ATTRIB_INT       ((ULONG)0x01)
67 #define IAS_ATTRIB_OCTETSEQ  ((ULONG)0x02)
68 #define IAS_ATTRIB_STR       ((ULONG)0x03)
69
70 #define IRLMP_ENUMDEVICES    ((ULONG)0x10)
71 #define IRLMP_IAS_SET        ((ULONG)0x11)
72 #define IRLMP_IAS_QUERY      ((ULONG)0x12)
73 #define IRLMP_SEND_PDU_LEN   ((ULONG)0x13)
74 #define IRLMP_EXCLUSIVE_MODE ((ULONG)0x14)
75 #define IRLMP_IRLPT_MODE     ((ULONG)0x15)
76 #define IRLMP_9WIRE_MODE     ((ULONG)0x16)
77
78 #if 0
79 // Available/Used on Windows 98 only ???
80 #define IRLMP_TINYTP_MODE    ((ULONG)0x17)
81 #define IRLMP_PARAMETERS     ((ULONG)0x18)
82 #define IRLMP_DISCOVERY_MODE ((ULONG)0x19)
83 // Available/Used on Windows CE only ???
84 #define IRLMP_SHARP_MODE     ((ULONG)0x20)
85 #endif
86
87 enum {
88 // First hint byte
89   LM_HB1_PnP =         0x01,
90   LM_HB1_PDA_Palmtop = 0x02,
91   LM_HB1_Computer =    0x04,
92   LM_HB1_Printer =     0x08,
93   LM_HB1_Modem =       0x10,
94   LM_HB1_Fax =         0x20,
95   LM_HB1_LANAccess =   0x40,
96 // Second hint byte
97   LM_HB2_Telephony =   0x01,
98   LM_HB2_FileServer =  0x02,
99 // Any hint byte
100   LM_HB_Extension =    0x80,
101 };
102
103 #define LmCharSetASCII       0x00
104 #define LmCharSetISO_8859_1  0x01
105 #define LmCharSetISO_8859_2  0x02
106 #define LmCharSetISO_8859_3  0x03
107 #define LmCharSetISO_8859_4  0x04
108 #define LmCharSetISO_8859_5  0x05
109 #define LmCharSetISO_8859_6  0x06
110 #define LmCharSetISO_8859_7  0x07
111 #define LmCharSetISO_8859_8  0x08
112 #define LmCharSetISO_8859_9  0x09
113 #define LmCharSetUNICODE     0xFF
114
115 #define  LM_BAUD_1200   1200
116 #define  LM_BAUD_2400   2400
117 #define  LM_BAUD_9600   9600
118 #define  LM_BAUD_19200  19200
119 #define  LM_BAUD_38400  38400
120 #define  LM_BAUD_57600  57600
121 #define  LM_BAUD_115200 115200
122 #define  LM_BAUD_576K   576000
123 #define  LM_BAUD_1152K  1152000
124 #define  LM_BAUD_4M     4000000
125
126 #if 0 // Available/Used on Windows 98 only ???
127 typedef ULONG LM_BAUD_RATE;
128 typedef struct {
129     ULONG        nTXDataBytes;  // packet transmit receive bytes
130     ULONG        nRXDataBytes;  // packet maximum receive bytes
131     LM_BAUD_RATE nBaudRate;     // link negotiated baud
132     ULONG        thresholdTime; // milliseconds for threshold time
133     ULONG        discTime;      // milliseconds for disconnect time
134     USHORT       nMSLinkTurn;   // milliseconds for link turn around time
135     UCHAR        nTXPackets;    // transmit window packets
136     UCHAR        nRXPackets;    // receive window packets
137 } LM_IRPARMS;
138 typedef LM_IRPARMS *PLM_IRPARMS;
139 #endif
140
141 typedef struct _SOCKADDR_IRDA {
142     USHORT irdaAddressFamily;
143     UCHAR  irdaDeviceID[4];
144     char   irdaServiceName[25];
145 } SOCKADDR_IRDA;
146
147 typedef struct _WINDOWS_IRDA_DEVICE_INFO {
148     UCHAR irdaDeviceID[4];
149     char  irdaDeviceName[22];
150     UCHAR irdaDeviceHints1;
151     UCHAR irdaDeviceHints2;
152     UCHAR irdaCharSet;
153 } WINDOWS_IRDA_DEVICE_INFO;
154
155 typedef struct _WINDOWS_IAS_SET {
156     char  irdaClassName[IAS_MAX_CLASSNAME];
157     char  irdaAttribName[IAS_MAX_ATTRIBNAME];
158     ULONG irdaAttribType;
159     union {
160         LONG irdaAttribInt;
161         struct {
162             USHORT Len;
163             UCHAR OctetSeq[IAS_MAX_OCTET_STRING];
164         } irdaAttribOctetSeq;
165         struct {
166             UCHAR Len;
167             UCHAR CharSet;
168             UCHAR UsrStr[IAS_MAX_USER_STRING];
169         } irdaAttribUsrStr;
170     } irdaAttribute;
171 } WINDOWS_IAS_SET;
172
173 typedef struct _WINDOWS_IAS_QUERY {
174     UCHAR irdaDeviceID[4];
175     char  irdaClassName[IAS_MAX_CLASSNAME];
176     char  irdaAttribName[IAS_MAX_ATTRIBNAME];
177     ULONG irdaAttribType;
178     union {
179         LONG irdaAttribInt;
180         struct {
181             ULONG Len;
182             UCHAR OctetSeq[IAS_MAX_OCTET_STRING];
183         } irdaAttribOctetSeq;
184         struct {
185             ULONG Len;
186             ULONG CharSet;
187             UCHAR UsrStr[IAS_MAX_USER_STRING];
188         } irdaAttribUsrStr;
189     } irdaAttribute;
190 } WINDOWS_IAS_QUERY;
191
192 typedef struct _WINDOWS_DEVICELIST {
193     ULONG numDevice;
194     WINDOWS_IRDA_DEVICE_INFO Device[1];
195 } WINDOWS_DEVICELIST;
196
197 typedef WINDOWS_DEVICELIST DEVICELIST;
198 typedef WINDOWS_DEVICELIST *PDEVICELIST;
199 typedef WINDOWS_DEVICELIST *PWINDOWS_DEVICELIST;
200
201 typedef WINDOWS_IRDA_DEVICE_INFO IRDA_DEVICE_INFO;
202 typedef WINDOWS_IRDA_DEVICE_INFO *PIRDA_DEVICE_INFO;
203 typedef WINDOWS_IRDA_DEVICE_INFO *PWINDOWS_IRDA_DEVICE_INFO;
204
205 typedef WINDOWS_IAS_SET IAS_SET;
206 typedef WINDOWS_IAS_SET *PIAS_SET;
207 typedef WINDOWS_IAS_SET *PWINDOWS_IAS_SET;
208
209 typedef WINDOWS_IAS_QUERY IAS_QUERY;
210 typedef WINDOWS_IAS_QUERY *PIAS_QUERY;
211 typedef WINDOWS_IAS_QUERY *PWINDOWS_IAS_QUERY;
212
213 typedef SOCKADDR_IRDA *PSOCKADDR_IRDA;
214
215 #pragma pack(pop)
216
217 #ifdef __cplusplus
218 }
219 #endif
220
221 #endif /* __AF_IRDA_H */