Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef _LINUX_DN_H
0003 #define _LINUX_DN_H
0004 
0005 #include <linux/ioctl.h>
0006 #include <linux/types.h>
0007 #include <linux/if_ether.h>
0008 
0009 /*
0010 
0011     DECnet Data Structures and Constants
0012 
0013 */
0014 
0015 /* 
0016  * DNPROTO_NSP can't be the same as SOL_SOCKET, 
0017  * so increment each by one (compared to ULTRIX)
0018  */
0019 #define DNPROTO_NSP     2                       /* NSP protocol number       */
0020 #define DNPROTO_ROU     3                       /* Routing protocol number   */
0021 #define DNPROTO_NML     4                       /* Net mgt protocol number   */
0022 #define DNPROTO_EVL     5                       /* Evl protocol number (usr) */
0023 #define DNPROTO_EVR     6                       /* Evl protocol number (evl) */
0024 #define DNPROTO_NSPT    7                       /* NSP trace protocol number */
0025 
0026 
0027 #define DN_ADDL     2
0028 #define DN_MAXADDL  2 /* ULTRIX headers have 20 here, but pathworks has 2 */
0029 #define DN_MAXOPTL  16
0030 #define DN_MAXOBJL  16
0031 #define DN_MAXACCL  40
0032 #define DN_MAXALIASL    128
0033 #define DN_MAXNODEL 256
0034 #define DNBUFSIZE   65023
0035 
0036 /* 
0037  * SET/GET Socket options  - must match the DSO_ numbers below
0038  */
0039 #define SO_CONDATA      1
0040 #define SO_CONACCESS    2
0041 #define SO_PROXYUSR     3
0042 #define SO_LINKINFO     7
0043 
0044 #define DSO_CONDATA     1        /* Set/Get connect data                */
0045 #define DSO_DISDATA     10       /* Set/Get disconnect data             */
0046 #define DSO_CONACCESS   2        /* Set/Get connect access data         */
0047 #define DSO_ACCEPTMODE  4        /* Set/Get accept mode                 */
0048 #define DSO_CONACCEPT   5        /* Accept deferred connection          */
0049 #define DSO_CONREJECT   6        /* Reject deferred connection          */
0050 #define DSO_LINKINFO    7        /* Set/Get link information            */
0051 #define DSO_STREAM      8        /* Set socket type to stream           */
0052 #define DSO_SEQPACKET   9        /* Set socket type to sequenced packet */
0053 #define DSO_MAXWINDOW   11       /* Maximum window size allowed         */
0054 #define DSO_NODELAY 12       /* Turn off nagle                      */
0055 #define DSO_CORK        13       /* Wait for more data!                 */
0056 #define DSO_SERVICES    14       /* NSP Services field                  */
0057 #define DSO_INFO    15       /* NSP Info field                      */
0058 #define DSO_MAX         15       /* Maximum option number               */
0059 
0060 
0061 /* LINK States */
0062 #define LL_INACTIVE 0
0063 #define LL_CONNECTING   1
0064 #define LL_RUNNING  2
0065 #define LL_DISCONNECTING 3
0066 
0067 #define ACC_IMMED 0
0068 #define ACC_DEFER 1
0069 
0070 #define SDF_WILD        1                  /* Wild card object          */
0071 #define SDF_PROXY       2                  /* Addr eligible for proxy   */
0072 #define SDF_UICPROXY    4                  /* Use uic-based proxy       */
0073 
0074 /* Structures */
0075 
0076 
0077 struct dn_naddr {
0078     __le16      a_len;
0079     __u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */
0080 };
0081 
0082 struct sockaddr_dn {
0083     __u16       sdn_family;
0084     __u8        sdn_flags;
0085     __u8        sdn_objnum;
0086     __le16      sdn_objnamel;
0087     __u8        sdn_objname[DN_MAXOBJL];
0088     struct   dn_naddr   sdn_add;
0089 };
0090 #define sdn_nodeaddrl   sdn_add.a_len   /* Node address length  */
0091 #define sdn_nodeaddr    sdn_add.a_addr  /* Node address         */
0092 
0093 
0094 
0095 /*
0096  * DECnet set/get DSO_CONDATA, DSO_DISDATA (optional data) structure
0097  */
0098 struct optdata_dn {
0099         __le16  opt_status;     /* Extended status return */
0100 #define opt_sts opt_status
0101         __le16  opt_optl;       /* Length of user data    */
0102         __u8   opt_data[16];   /* User data              */
0103 };
0104 
0105 struct accessdata_dn {
0106     __u8        acc_accl;
0107     __u8        acc_acc[DN_MAXACCL];
0108     __u8        acc_passl;
0109     __u8        acc_pass[DN_MAXACCL];
0110     __u8        acc_userl;
0111     __u8        acc_user[DN_MAXACCL];
0112 };
0113 
0114 /*
0115  * DECnet logical link information structure
0116  */
0117 struct linkinfo_dn {
0118         __u16  idn_segsize;    /* Segment size for link */
0119         __u8   idn_linkstate;  /* Logical link state    */
0120 };
0121 
0122 /*
0123  * Ethernet address format (for DECnet)
0124  */
0125 union etheraddress {
0126         __u8 dne_addr[ETH_ALEN];      /* Full ethernet address */
0127   struct {
0128                 __u8 dne_hiord[4];    /* DECnet HIORD prefix   */
0129                 __u8 dne_nodeaddr[2]; /* DECnet node address   */
0130   } dne_remote;
0131 };
0132 
0133 
0134 /*
0135  * DECnet physical socket address format
0136  */
0137 struct dn_addr {
0138         __le16 dna_family;      /* AF_DECnet               */
0139         union etheraddress dna_netaddr; /* DECnet ethernet address */
0140 };
0141 
0142 #define DECNET_IOCTL_BASE 0x89 /* PROTOPRIVATE range */
0143 
0144 #define SIOCSNETADDR  _IOW(DECNET_IOCTL_BASE, 0xe0, struct dn_naddr)
0145 #define SIOCGNETADDR  _IOR(DECNET_IOCTL_BASE, 0xe1, struct dn_naddr)
0146 #define OSIOCSNETADDR _IOW(DECNET_IOCTL_BASE, 0xe0, int)
0147 #define OSIOCGNETADDR _IOR(DECNET_IOCTL_BASE, 0xe1, int)
0148 
0149 #endif /* _LINUX_DN_H */