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 contol, 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 tol, 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 guarantees that the data arrives in order and there is no
57 flow contol, 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 receive only when no IrLAP connection is established and
66 otherwise discarded. They are always transmitted at 9600 bauds.
67 Datagrams may be lost, reordered, and there is no flow control.
68 Ultra sockets preserve record boundaries. No fragmentation is
69 provided, datagrams larger than the Ultra MTU (382 bytes) are
70 truncated or discarded.
71
73 An IrDA socket address is defined as a combination of an IrDA interface
74 address and a service name. Service names are automatically resolved
75 to lsap through the IrIAP protocol.
76
77 struct sockaddr_irda {
78 sa_family_t sir_family; /* AF_IRDA */
79 __u8 sir_lsap_sel; /* LSAP selector */
80 __u32 sir_addr; /* Device address */
81 char sir_name[25]; /* Usually <service>:IrDA:TinyTP */
82 };
83
84 sin_family is always set to AF_IRDA. sir_lsap_sel is usually not used.
85 sir_addr is the address of the peer and optional (and that case the
86 first peer discoverd will be used). sir_name is the service name of
87 the socket.
88
90 IrDA sockets supports some protocol specific socket options that can be
91 set with setsockopt(2) and read with getsockopt(2). The socket option
92 level for IrDA is SOL_IRLMP.
93
94 Options that can be set:
95
96 IRLMP_IAS_SET
97 Set an entry in the local IAS database.
98
99 IRLMP_IAS_DEL
100 Delete an entry from the local IAS database.
101
102 IRLMP_MAX_SDU_SIZE
103 Set maximum receive MTU for SeqPacket sockets.
104
105 IRLMP_HINTS_SET
106 Set IrDA hint bits to be advertised to peers.
107
108 IRLMP_HINT_MASK_SET
109 Set IrDA hint bits filter to be used when performing discovery.
110
111 Options that can be get:
112
113 IRLMP_ENUMDEVICES
114 Perform link level discovery and return the content of the dis‐
115 covery log.
116
117 IRLMP_MAX_SDU_SIZE
118 Get maximum receive MTU.
119
120 IRLMP_IAS_GET
121 Get an entry from the local IAS database.
122
123 IRLMP_IAS_QUERY
124 Query an entry in IAS database of a peer using IrIAP.
125
126 IRLMP_WAITDEVICE
127 Block until a new device is discovered. Experimental feature,
128 use with caution.
129
131 Jean Tourrilhes - jt@hpl.hp.com
132
134 irattach(8), irdadump(8), irnet(4), irnetd(8).
135
136
137
138irda-utils 2 May 2003 IRDA(7)