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