Commit | Line | Data |
---|---|---|
51386eb2 KS |
1 | /* |
2 | * Copyright (c) University of British Columbia, 1984 | |
3 | * Copyright (c) 1990 The Regents of the University of California. | |
4 | * All rights reserved. | |
5 | * | |
6 | * This code is derived from software contributed to Berkeley by | |
7 | * the Laboratory for Computation Vision and the Computer Science Department | |
8 | * of the University of British Columbia. | |
9 | * | |
10 | * %sccs.include.redist.c% | |
11 | * | |
ffababe5 | 12 | * @(#)x25.h 7.4 (Berkeley) %G% |
51386eb2 KS |
13 | */ |
14 | ||
9093c13c KS |
15 | #ifdef KERNEL |
16 | #define PRC_IFUP 3 | |
17 | #define PRC_LINKUP 4 | |
18 | #define PRC_LINKDOWN 5 | |
19 | #define PRC_LINKRESET 6 | |
20 | #define PRC_LINKDONTCOPY 7 | |
21 | #endif | |
22 | ||
23 | #define CCITTPROTO_HDLC 1 | |
24 | #define CCITTPROTO_X25 2 /* packet level protocol */ | |
25 | #define IEEEPROTO_802LLC 3 /* doesn't belong here */ | |
26 | ||
27 | #define HDLCPROTO_LAP 1 | |
28 | #define HDLCPROTO_LAPB 2 | |
29 | #define HDLCPROTO_UNSET 3 | |
30 | #define HDLCPROTO_LAPD 4 | |
31 | ||
32 | /* | |
33 | * X.25 Socket address structure. It contains the X.121 or variation of | |
34 | * X.121, facilities information, higher level protocol value (first four | |
35 | * bytes of the User Data field), and the last 12 characters of the User | |
36 | * Data field. | |
37 | */ | |
38 | ||
39 | struct x25_sockaddr { /* obsolete - use sockaddr_x25 */ | |
40 | short xaddr_len; /* Length of xaddr_addr. */ | |
41 | u_char xaddr_addr[15]; /* Network dependent or X.121 address. */ | |
42 | u_char xaddr_facilities; /* Facilities information. */ | |
43 | #define XS_REVERSE_CHARGE 0x01 | |
44 | #define XS_HIPRIO 0x02 | |
45 | u_char xaddr_proto[4]; /* Protocol ID (4 bytes of user data). */ | |
46 | u_char xaddr_userdata[12]; /* Remaining User data field. */ | |
47 | }; | |
48 | ||
9093c13c KS |
49 | /* |
50 | * X.25 Socket address structure. It contains the network id, X.121 | |
51 | * address, facilities information, higher level protocol value (first four | |
52 | * bytes of the User Data field), and up to 12 characters of User Data. | |
53 | */ | |
54 | ||
55 | struct sockaddr_x25 { | |
51386eb2 KS |
56 | u_char x25_len; |
57 | u_char x25_family; /* must be AF_CCITT */ | |
9093c13c | 58 | short x25_net; /* network id code (usually a dnic) */ |
039be508 | 59 | char x25_addr[16]; /* X.121 address (null terminated) */ |
9093c13c KS |
60 | struct x25opts { |
61 | char op_flags; /* miscellaneous options */ | |
039be508 | 62 | /* pk_var.h defines other lcd_flags */ |
9093c13c KS |
63 | #define X25_REVERSE_CHARGE 0x01 /* remote DTE pays for call */ |
64 | #define X25_DBIT 0x02 /* not yet supported */ | |
65 | #define X25_MQBIT 0x04 /* prepend M&Q bit status byte to packet data */ | |
66 | #define X25_OLDSOCKADDR 0x08 /* uses old sockaddr structure */ | |
67 | char op_psize; /* requested packet size */ | |
68 | #define X25_PS128 7 | |
69 | #define X25_PS256 8 | |
70 | #define X25_PS512 9 | |
71 | char op_wsize; /* window size (1 .. 7) */ | |
72 | char op_speed; /* throughput class */ | |
73 | } x25_opts; | |
9093c13c KS |
74 | short x25_udlen; /* user data field length */ |
75 | char x25_udata[16]; /* user data field */ | |
76 | }; | |
039be508 KS |
77 | |
78 | /* | |
79 | * network configuration info | |
80 | * this structure must be 16 bytes long | |
81 | */ | |
82 | ||
83 | struct x25config { | |
84 | struct sockaddr_x25 xc_addr; | |
85 | /* link level parameters */ | |
86 | u_short xc_lproto:4, /* link level protocol eg. CCITTPROTO_HDLC */ | |
87 | xc_lptype:4, /* protocol type eg. HDLCPROTO_LAPB */ | |
88 | xc_lwsize:5, /* link level window size */ | |
89 | xc_ltrace:1, /* link level tracing flag */ | |
90 | xc_rsvd1:2; /* for use by other link-level protocols */ | |
91 | /* packet level parameters */ | |
92 | u_short xc_pwsize:3, /* default window size */ | |
93 | xc_psize:4, /* default packet size 7=128, 8=256, ... */ | |
94 | xc_type:3, /* network type */ | |
95 | #define X25_1976 0 | |
96 | #define X25_1980 1 | |
97 | #define X25_1984 2 | |
98 | #define X25_DDN 3 | |
99 | #define X25_BASIC 4 | |
100 | xc_ptrace:1, /* packet level tracing flag */ | |
101 | xc_rsvd2:5; | |
102 | u_short xc_maxlcn; /* max logical channels */ | |
103 | u_short xc_dg_idletimo; /* timeout for idle datagram circuits. | |
104 | }; | |
105 | ||
106 | #ifdef IFNAMSIZ | |
107 | struct ifreq_x25 { | |
108 | char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */ | |
109 | struct x25config ifr_xc; | |
110 | }; | |
111 | #define SIOCSIFCONF_X25 _IOW('i', 12, struct ifreq_x25) /* set ifnet config */ | |
112 | #define SIOCGIFCONF_X25 _IOWR('i',13, struct ifreq_x25) /* get ifnet config */ | |
113 | #endif |