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, a 0 first byte indicates that the Q-bits of the corresponding incoming data packets were not set. a first byte with value 1 indicates that the Q-bit of the corresponding incoming data packets was set. if the first byte of the data written to the socket is 1, the Q-bit of the corresponding outgoing data packets will be set. if the first byte is 0, the Q-bit will not be set. ๐Ÿ’–

โญ 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
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms