x25(7)
๐ x25 โ the ITU-T X.25 / ISO/IEC 8208 protocol interface, bestie โจ
okay so we're in section 7 of the manual (that's the miscellaneous info manual, for the uninitiated) and this page is literally all about x25, the ITU-T X.25 / ISO/IEC 8208 protocol interface. no cap. let's get into it ๐ฆ
โจ SYNOPSIS โจ
first things first, you gotta pull in the headers:
#include <sys/socket.h>
#include <linux/x25.h>
and then you make your socket like this:
x25_socket = socket(AF_X25, SOCK_SEQPACKET, 0);
periodt. that's the whole entry point ๐
๐ธ DESCRIPTION ๐ธ
so X25 sockets give you an interface to the X.25 packet layer protocol. that means your app can talk over a public X.25 data network, exactly as standardized by the International Telecommunication Union's recommendation X.25 โ that's X.25 DTE-DCE mode, iykyk. ๐ซถ
and here's the fun part: X25 sockets also work for communication without an intermediate X.25 network, which is X.25 DTE-DTE mode, as described in ISO/IEC 8208. no middleman required, iconic behavior honestly.
message boundaries are preserved, and the way that works is โ a read(2) from a socket will retrieve the same chunk of data as was output with the corresponding write(2) to the peer socket. when it needs to, the kernel handles segmenting and reassembling long messages for you by means of the X.25 M-bit. ๐ซ
there is no hard-coded upper limit for the message size. however โ and this is the part where we pay attention โ reassembling a long message might fail if there's a temporary lack of system resources, or when other constraints (like socket memory or buffer size limits) become effective. if that happens? the X.25 connection will be reset. ๐ญ so like, big messages are valid but the vibes can go sideways.
๐ Socket addresses
the AF_X25 socket address family uses the struct sockaddr_x25 for representing network addresses, as defined in ITU-T recommendation X.121. here's the whole thing, verbatim, no edits:
struct sockaddr_x25 {
sa_family_t sx25_family; /* must be AF_X25 */
x25_address sx25_addr; /* X.121 Address */
};
sx25_addr contains a char array x25_addr[] that you interpret as a null-terminated string. sx25_addr.x25_addr[] consists of up to 15 ASCII characters (and that's not counting the terminating null byte) forming the X.121 address. only the decimal digit characters from '0' to '9' are allowed โ so no letters, no sneaky punctuation, just digits bestie ๐
๐ Socket options
the following X.25-specific socket options can be set by using setsockopt(2) and read with getsockopt(2), with the level argument set to SOL_X25.
X25_QBITINCLโ controls whether the X.25 Q-bit (that's the Qualified Data Bit) is accessible by the user. it expects an integer argument.- if set to
0(which is the default), the Q-bit is never set for outgoing packets and the Q-bit of incoming packets is ignored. ๐ - if set to
1, an additional first byte is prepended to each message read from or written to the socket. for data read from the socket, a0first byte indicates that the Q-bits of the corresponding incoming data packets were not set. a first byte with value1indicates that the Q-bit of the corresponding incoming data packets was set. if the first byte of the data written to the socket is1, the Q-bit of the corresponding outgoing data packets will be set. if the first byte is0, the Q-bit will not be set. ๐
- if set to
โญ VERSIONS โญ
the AF_X25 protocol family is a new feature of Linux 2.2. yeah, it's been around a minute, but still โ fresh feature status.
๐ BUGS ๐
plenty, bestie. the X.25 PLP implementation is CONFIG_EXPERIMENTAL.
also: this man page is incomplete. ๐ญ iconic of it to just admit that.
there is no dedicated application programmer's header file yet โ you need to include the kernel header file <linux/x25.h>. and CONFIG_EXPERIMENTAL might also imply that future versions of the interface are not binary compatible, which is a real heads-up, fr fr.
and one more that matters: X.25 N-Reset events are not propagated to the user process yet. thus, if a reset occurred, data might be lost without notice. no warning, just gone. be careful out there ๐ซถ
๐ SEE ALSO ๐
and a reading rec for when you're feeling academic: Jonathan Simon Naylor: "The Re-Analysis and Re-Implementation of X.25." โ the URL is ftp://ftp.pspt.fi/pub/ham/linux/ax25/x25doc.tgz ๐
aaaand that's the page!! this one's from Linux man-pages 6.20, dated 2026-02-08, living in section 7 of the manual as x25(7). go make some sockets, bestie, you got this ๐๐งโจ
๐ฆ where this page comes from
- arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- ๐ the page's license: Linux-man-pages-1-para
- Copyright 1998, Heiner Eisen
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms