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