Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


dn.h
001: #ifndef _LINUX_DN_H
002: #define _LINUX_DN_H
003: 
004: #include <linux/types.h>
005: 
006: /*
007: 
008:         DECnet Data Structures and Constants
009: 
010: */
011: 
012: /* 
013:  * DNPROTO_NSP can't be the same as SOL_SOCKET, 
014:  * so increment each by one (compared to ULTRIX)
015:  */
016: #define DNPROTO_NSP     2                       /* NSP protocol number       */
017: #define DNPROTO_ROU     3                       /* Routing protocol number   */
018: #define DNPROTO_NML     4                       /* Net mgt protocol number   */
019: #define DNPROTO_EVL     5                       /* Evl protocol number (usr) */
020: #define DNPROTO_EVR     6                       /* Evl protocol number (evl) */
021: #define DNPROTO_NSPT    7                       /* NSP trace protocol number */
022: 
023: 
024: #define DN_ADDL         2
025: #define DN_MAXADDL      2 /* ULTRIX headers have 20 here, but pathworks has 2 */
026: #define DN_MAXOPTL      16
027: #define DN_MAXOBJL      16
028: #define DN_MAXACCL      40
029: #define DN_MAXALIASL    128
030: #define DN_MAXNODEL     256
031: #define DNBUFSIZE       65023
032: 
033: /* 
034:  * SET/GET Socket options  - must match the DSO_ numbers below
035:  */
036: #define SO_CONDATA      1
037: #define SO_CONACCESS    2
038: #define SO_PROXYUSR     3
039: #define SO_LINKINFO     7
040: 
041: #define DSO_CONDATA     1        /* Set/Get connect data                */
042: #define DSO_DISDATA     10       /* Set/Get disconnect data             */
043: #define DSO_CONACCESS   2        /* Set/Get connect access data         */
044: #define DSO_ACCEPTMODE  4        /* Set/Get accept mode                 */
045: #define DSO_CONACCEPT   5        /* Accept deferred connection          */
046: #define DSO_CONREJECT   6        /* Reject deferred connection          */
047: #define DSO_LINKINFO    7        /* Set/Get link information            */
048: #define DSO_STREAM      8        /* Set socket type to stream           */
049: #define DSO_SEQPACKET   9        /* Set socket type to sequenced packet */
050: #define DSO_MAXWINDOW   11       /* Maximum window size allowed         */
051: #define DSO_NODELAY     12       /* Turn off nagle                      */
052: #define DSO_CORK        13       /* Wait for more data!                 */
053: #define DSO_SERVICES    14       /* NSP Services field                  */
054: #define DSO_INFO        15       /* NSP Info field                      */
055: #define DSO_MAX         15       /* Maximum option number               */
056: 
057: 
058: /* LINK States */
059: #define LL_INACTIVE     0
060: #define LL_CONNECTING   1
061: #define LL_RUNNING      2
062: #define LL_DISCONNECTING 3
063: 
064: #define ACC_IMMED 0
065: #define ACC_DEFER 1
066: 
067: #define SDF_WILD        1                  /* Wild card object          */
068: #define SDF_PROXY       2                  /* Addr eligible for proxy   */
069: #define SDF_UICPROXY    4                  /* Use uic-based proxy       */
070: 
071: /* Structures */
072: 
073: 
074: struct dn_naddr {
075:         __le16          a_len;
076:         __u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */
077: };
078: 
079: struct sockaddr_dn {
080:         __u16           sdn_family;
081:         __u8            sdn_flags;
082:         __u8            sdn_objnum;
083:         __le16          sdn_objnamel;
084:         __u8            sdn_objname[DN_MAXOBJL];
085:         struct   dn_naddr       sdn_add;
086: };
087: #define sdn_nodeaddrl   sdn_add.a_len   /* Node address length  */
088: #define sdn_nodeaddr    sdn_add.a_addr  /* Node address         */
089: 
090: 
091: 
092: /*
093:  * DECnet set/get DSO_CONDATA, DSO_DISDATA (optional data) structure
094:  */
095: struct optdata_dn {
096:         __le16  opt_status;     /* Extended status return */
097: #define opt_sts opt_status
098:         __le16  opt_optl;       /* Length of user data    */
099:         __u8   opt_data[16];   /* User data              */
100: };
101: 
102: struct accessdata_dn {
103:         __u8            acc_accl;
104:         __u8            acc_acc[DN_MAXACCL];
105:         __u8            acc_passl;
106:         __u8            acc_pass[DN_MAXACCL];
107:         __u8            acc_userl;
108:         __u8            acc_user[DN_MAXACCL];
109: };
110: 
111: /*
112:  * DECnet logical link information structure
113:  */
114: struct linkinfo_dn {
115:         __u16  idn_segsize;    /* Segment size for link */
116:         __u8   idn_linkstate;  /* Logical link state    */
117: };
118: 
119: /*
120:  * Ethernet address format (for DECnet)
121:  */
122: union etheraddress {
123:         __u8 dne_addr[6];             /* Full ethernet address */
124:   struct {
125:                 __u8 dne_hiord[4];    /* DECnet HIORD prefix   */
126:                 __u8 dne_nodeaddr[2]; /* DECnet node address   */
127:   } dne_remote;
128: };
129: 
130: 
131: /*
132:  * DECnet physical socket address format
133:  */
134: struct dn_addr {
135:         __le16 dna_family;      /* AF_DECnet               */
136:         union etheraddress dna_netaddr; /* DECnet ethernet address */
137: };
138: 
139: #define DECNET_IOCTL_BASE 0x89 /* PROTOPRIVATE range */
140: 
141: #define SIOCSNETADDR  _IOW(DECNET_IOCTL_BASE, 0xe0, struct dn_naddr)
142: #define SIOCGNETADDR  _IOR(DECNET_IOCTL_BASE, 0xe1, struct dn_naddr)
143: #define OSIOCSNETADDR _IOW(DECNET_IOCTL_BASE, 0xe0, int)
144: #define OSIOCGNETADDR _IOR(DECNET_IOCTL_BASE, 0xe1, int)
145: 
146: #endif /* _LINUX_DN_H */
147: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/