1IRDA(7) Linux-IrDA man pages IRDA(7)
2
3
4
6 irda - The Linux-IrDA protocol stack
7
9 #include <linux/irda.h>
10
11 stream_s = socket(PF_INET, SOCK_STREAM, 0);
12 seqpkt_s = socket(PF_INET, SOCK_SEQPACKET, 0);
13 dgram_s = socket(PF_INET, SOCK_DGRAM, IRDAPROTO_UNITDATA);
14 ultra_s = socket(PF_INET, SOCK_DGRAM, IRDAPROTO_ULTRA);
15
17 Linux-IrDA is a complete implementation of the various IrDA protocols
18 and IrDA drivers for Linux.
19
20 The configuration of the low level of the IrDA stack (IrDA ports) and
21 the various IrDA drivers are described in irattach(8).
22
23 The usage of the higher layers of the IrDA stack (IrCOMM, IrLPT, IrNET,
24 IrLAN, OBEX...) are described in their respective man pages.
25
26 The core of the Linux-IrDA protocol stack is composed of the IrLAP,
27 IrLMP, IrTTP and IrIAS protocols and is implemented as a kernel module.
28 The programmer's interface for the IrDA stack is socket based. For more
29 information on sockets, see socket(7).
30
31 Note that higher level IrDA protocols may offer a different program‐
32 mer's interface. For example IrCOMM offers a TTY based interface and
33 OBEX is available through a user space library.
34
36 The Linux-IrDA socket interface offers 4 types of sockets:
37
38 Stream socket - SOCK_STREAM, 0
39 Stream sockets provides a reliable, stream oriented, full duplex
40 connection between two sockets on top of IrTTP, similar to TCP
41 sockets. IrTTP guarantees that the data arrives in order and
42 manages flow control, IrLAP retransmits lost packets.
43 Stream sockets does not preserve record boundaries.
44
45 SeqPacket socket - SOCK_SEQPACKET, 0
46 SeqPacket sockets provides a reliable, datagram oriented, full
47 duplex connection between two sockets on top of IrTTP. IrTTP
48 guarantees that the data arrives in order and manages flow con‐
49 trol, IrLAP retransmits lost packets.
50 SeqPacket sockets preserve record boundaries. Large datagrams
51 will be fragmented as needed.
52
53 Datagram socket - SOCK_DGRAM, IRDAPROTO_UNITDATA
54 SeqPacket sockets provides a reliable, datagram oriented, full
55 duplex connection between two sockets on top of IrLMP. There is
56 no guarantee that the data arrives in order and there is no flow
57 control, however IrLAP retransmits lost packets.
58 Datagram sockets preserve record boundaries. No fragmentation is
59 provided, datagrams larger than the IrDA link MTU are truncated
60 or discarded.
61
62 Ultra socket - SOCK_DGRAM, IRDAPROTO_ULTRA
63 Ultra sockets provides a connectionless, unreliable datagram
64 packet service on top of IrLAP-Ultra. Ultra datagrams are sent
65 and received only when no IrLAP connection is established and
66 otherwise discarded. They are always transmitted at 9600 bauds.
67 Datagrams may be lost or reordered, and there is no flow con‐
68 trol.
69 Ultra sockets preserve record boundaries. No fragmentation is
70 provided, datagrams larger than the Ultra MTU (382 bytes) are
71 truncated or discarded.
72
74 An IrDA socket address is defined as a combination of an IrDA interface
75 address and a service name. Service names are automatically resolved
76 to lsap through the IrIAP protocol.
77
78 struct sockaddr_irda {
79 sa_family_t sir_family; /* AF_IRDA */
80 __u8 sir_lsap_sel; /* LSAP selector */
81 __u32 sir_addr; /* Device address */
82 char sir_name[25]; /* Usually <service>:IrDA:TinyTP */
83 };
84
85 sin_family is always set to AF_IRDA. sir_lsap_sel is usually not used.
86 sir_addr is the optional address of the peer (if no given the first
87 peer discovered will be used). sir_name is the service name of the
88 socket.
89
91 IrDA sockets supports some protocol specific socket options that can be
92 set with setsockopt(2) and read with getsockopt(2). The socket option
93 level for IrDA is SOL_IRLMP.
94
95 Options that can be set:
96
97 IRLMP_IAS_SET
98 Set an entry in the local IAS database.
99
100 IRLMP_IAS_DEL
101 Delete an entry from the local IAS database.
102
103 IRLMP_MAX_SDU_SIZE
104 Set maximum receive MTU for SeqPacket sockets.
105
106 IRLMP_HINTS_SET
107 Set IrDA hint bits to be advertised to peers.
108
109 IRLMP_HINT_MASK_SET
110 Set IrDA hint bits filter to be used when performing discovery.
111
112 Options that can be get:
113
114 IRLMP_ENUMDEVICES
115 Perform link level discovery and return the content of the dis‐
116 covery log.
117
118 IRLMP_MAX_SDU_SIZE
119 Get maximum receive MTU.
120
121 IRLMP_IAS_GET
122 Get an entry from the local IAS database.
123
124 IRLMP_IAS_QUERY
125 Query an entry in IAS database of a peer using IrIAP.
126
127 IRLMP_WAITDEVICE
128 Block until a new device is discovered. Experimental feature,
129 use with caution.
130
132 Jean Tourrilhes - jt@hpl.hp.com
133
135 irattach(8), irdadump(8), irnet(4), irnetd(8).
136
137
138
139irda-utils 2 May 2003 IRDA(7)