strlen.3, wcslen.3: Recommend alternatives where input buffer might not be null-termi...
[man-pages.git] / man7 / x25.7
blob561ed051924804bfa6bc953ec2512090ed9a7a19
1 .\" This man page is Copyright (C) 1998 Heiner Eisen.
2 .\"
3 .\" %%%LICENSE_START(VERBATIM_ONE_PARA)
4 .\" Permission is granted to distribute possibly modified copies
5 .\" of this page provided the header is included verbatim,
6 .\" and in case of nontrivial modification author and date
7 .\" of the modification is added to the header.
8 .\" %%%LICENSE_END
9 .\"
10 .\" $Id: x25.7,v 1.4 1999/05/18 10:35:12 freitag Exp $
11 .\"
12 .TH X25 7 2021-03-22 "Linux" "Linux Programmer's Manual"
13 .SH NAME
14 x25 \- ITU-T X.25 / ISO-8208 protocol interface
15 .SH SYNOPSIS
16 .nf
17 .B #include <sys/socket.h>
18 .B #include <linux/x25.h>
19 .PP
20 .B x25_socket = socket(AF_X25, SOCK_SEQPACKET, 0);
21 .fi
22 .SH DESCRIPTION
23 X25 sockets provide an interface to the X.25 packet layer protocol.
24 This allows applications to
25 communicate over a public X.25 data network as standardized by
26 International Telecommunication Union's recommendation X.25
27 (X.25 DTE-DCE mode).
28 X25 sockets can also be used for communication
29 without an intermediate X.25 network (X.25 DTE-DTE mode) as described
30 in ISO-8208.
31 .PP
32 Message boundaries are preserved \(em a
33 .BR read (2)
34 from a socket will
35 retrieve the same chunk of data as output with the corresponding
36 .BR write (2)
37 to the peer socket.
38 When necessary, the kernel takes care
39 of segmenting and reassembling long messages by means of
40 the X.25 M-bit.
41 There is no hard-coded upper limit for the
42 message size.
43 However, reassembling of a long message might fail if
44 there is a temporary lack of system resources or when other constraints
45 (such as socket memory or buffer size limits) become effective.
46 If that
47 occurs, the X.25 connection will be reset.
48 .SS Socket addresses
49 The
50 .B AF_X25
51 socket address family uses the
52 .I struct sockaddr_x25
53 for representing network addresses as defined in ITU-T
54 recommendation X.121.
55 .PP
56 .in +4n
57 .EX
58 struct sockaddr_x25 {
59     sa_family_t sx25_family;    /* must be AF_X25 */
60     x25_address sx25_addr;      /* X.121 Address */
62 .EE
63 .in
64 .PP
65 .I sx25_addr
66 contains a char array
67 .I x25_addr[]
68 to be interpreted as a null-terminated string.
69 .I sx25_addr.x25_addr[]
70 consists of up to 15 (not counting the terminating null byte) ASCII
71 characters forming the X.121 address.
72 Only the decimal digit characters from \(aq0\(aq to \(aq9\(aq are allowed.
73 .SS Socket options
74 The following X.25-specific socket options can be set by using
75 .BR setsockopt (2)
76 and read with
77 .BR getsockopt (2)
78 with the
79 .I level
80 argument set to
81 .BR SOL_X25 .
82 .TP
83 .B X25_QBITINCL
84 Controls whether the X.25 Q-bit (Qualified Data Bit) is accessible by the
85 user.
86 It expects an integer argument.
87 If set to 0 (default),
88 the Q-bit is never set for outgoing packets and the Q-bit of incoming
89 packets is ignored.
90 If set to 1, an additional first byte is prepended
91 to each message read from or written to the socket.
92 For data read from
93 the socket, a 0 first byte indicates that the Q-bits of the corresponding
94 incoming data packets were not set.
95 A first byte with value 1 indicates
96 that the Q-bit of the corresponding incoming data packets was set.
97 If the first byte of the data written to the socket is 1, the Q-bit of the
98 corresponding outgoing data packets will be set.
99 If the first byte is 0,
100 the Q-bit will not be set.
101 .SH VERSIONS
102 The AF_X25 protocol family is a new feature of Linux 2.2.
103 .SH BUGS
104 Plenty, as the X.25 PLP implementation is
105 .BR CONFIG_EXPERIMENTAL .
107 This man page is incomplete.
109 There is no dedicated application programmer's header file yet;
110 you need to include the kernel header file
111 .IR <linux/x25.h> .
112 .B CONFIG_EXPERIMENTAL
113 might also imply that future versions of the
114 interface are not binary compatible.
116 X.25 N-Reset events are not propagated to the user process yet.
117 Thus,
118 if a reset occurred, data might be lost without notice.
119 .SH SEE ALSO
120 .BR socket (2),
121 .BR socket (7)
123 Jonathan Simon Naylor:
124 \(lqThe Re-Analysis and Re-Implementation of X.25.\(rq
125 The URL is
126 .UR ftp://ftp.pspt.fi\:/pub\:/ham\:/linux\:/ax25\:/x25doc.tgz
127 .UE .