1 /** 2 * This file has no copyright assigned and is placed in the Public Domain. 3 * This file is part of the mingw-w64 runtime package. 4 * No warranty is given; refer to the file DISCLAIMER.PD within this package. 5 */ 6 #ifndef WS2DNET_H 7 #define WS2DNET_H 8 9 #include <winsock2.h> 10 11 #pragma pack(push,ws2dnet,1) 12 13 #define DNPROTO_NSP 1 14 #define DNPROTO_RAW 255 15 16 #define DN_MAXADDL 20 17 #define DN_ADDL 2 18 #define DN_MAXOPTL 16 19 #define DN_MAXOBJL 16 20 #define DN_MAXACCL 39 21 #define DN_MAXALIASL 128 22 #define DN_MAXNODEL 7 23 24 #define WS2API_DECNET_dnet_addr 1 25 #define WS2API_DECNET_dnet_eof 2 26 #define WS2API_DECNET_dnet_getacc 3 27 #define WS2API_DECNET_dnet_getalias 4 28 #define WS2API_DECNET_dnet_htoa 5 29 #define WS2API_DECNET_dnet_ntoa 6 30 #define WS2API_DECNET_getnodeadd 7 31 #define WS2API_DECNET_getnodebyaddr 8 32 #define WS2API_DECNET_getnodebyname 9 33 #define WS2API_DECNET_getnodename 10 34 #define WS2API_DECNET_MAX 10 35 36 typedef struct dn_naddr { 37 unsigned short a_len; 38 unsigned char a_addr[DN_MAXADDL]; 39 } DNNADDR,*LPDNNADDR; 40 41 typedef struct sockaddr_dn { 42 unsigned short sdn_family; 43 unsigned char sdn_flags; 44 unsigned char sdn_objnum; 45 unsigned short sdn_objnamel; 46 char sdn_objname[DN_MAXOBJL]; 47 struct dn_naddr sdn_add; 48 } SOCKADDRDN,*LPSOCKADDRDN; 49 50 #define sdn_nodeaddrl sdn_add.a_len 51 #define sdn_nodeaddr sdn_add.a_addr 52 53 #define DNOBJECT_FAL 17 54 #define DNOBJECT_NICE 19 55 #define DNOBJECT_DTERM 23 56 #define DNOBJECT_MIRROR 25 57 #define DNOBJECT_EVR 26 58 #define DNOBJECT_MAIL11 27 59 #define DNOBJECT_PHONE 29 60 #define DNOBJECT_CTERM 42 61 #define DNOBJECT_DTR 63 62 63 typedef struct nodeent_f { 64 char *n_name; 65 unsigned short n_addrtype; 66 unsigned short n_length; 67 unsigned char *n_addr; 68 unsigned char *n_params; 69 unsigned char n_reserved[16]; 70 } NODEENTF,*LPNODEENTF; 71 72 typedef struct optdata_dn { 73 unsigned short opt_status; 74 unsigned short opt_optl; 75 unsigned char opt_data[DN_MAXOPTL]; 76 } OPTDATADN,*LPOPTDATADN; 77 78 typedef struct accessdata_dn { 79 unsigned short acc_accl; 80 unsigned char acc_acc[DN_MAXACCL+1]; 81 unsigned short acc_passl; 82 unsigned char acc_pass[DN_MAXACCL+1]; 83 unsigned short acc_userl; 84 unsigned char acc_user[DN_MAXACCL+1]; 85 } ACCESSDATADN,*LPACCESSDATADN; 86 87 typedef struct calldata_dn { 88 struct optdata_dn optdata_dn; 89 struct accessdata_dn accessdata_dn; 90 } CALLDATADN,*LPCALLDATADN; 91 92 typedef struct dnet_accent { 93 unsigned char dac_status; 94 unsigned char dac_type; 95 char dac_username[DN_MAXACCL+1]; 96 char dac_password[DN_MAXACCL+1]; 97 } DNETACCENT,*LPDNETACCENT; 98 99 #define DN_NONE 0x00 100 #define DN_RO 0x01 101 #define DN_WO 0x02 102 #define DN_RW 0x03 103 104 typedef struct linkinfo_dn { 105 unsigned short idn_segsize; 106 unsigned char idn_linkstate; 107 } LINKINFODN,*LPLINKINFODN; 108 109 #define SO_LINKINFO 7 110 #define LL_INACTIVE 0 111 #define LL_CONNECTING 1 112 #define LL_RUNNING 2 113 #define LL_DISCONNECTING 3 114 115 #pragma pack(pop,ws2dnet) 116 117 struct dn_naddr *WSAAPI dnet_addr(const char *); 118 int WSAAPI dnet_eof(SOCKET); 119 struct dnet_accent *WSAAPI dnet_getacc(const struct dnet_accent *); 120 char *WSAAPI dnet_getalias(const char *); 121 char *WSAAPI dnet_htoa(const struct dn_naddr *); 122 char *WSAAPI dnet_ntoa(const struct dn_naddr *); 123 struct dn_naddr *WSAAPI getnodeadd(void); 124 struct nodeent_f *WSAAPI getnodebyaddr(const unsigned char *addr,int,int); 125 struct nodeent_f *WSAAPI getnodebyname(const char *); 126 char *WSAAPI getnodename(void); 127 128 typedef struct dn_naddr *(WSAAPI *LPDNETADDR)(const char *); 129 typedef int (WSAAPI *LPDNETEOF)(SOCKET); 130 typedef struct dnet_accent *(WSAAPI *LPDNETGETACC)(const struct dnet_accent *); 131 typedef char *(WSAAPI *LPDNETGETALIAS)(const char *); 132 typedef char *(WSAAPI *LPDNETHTOA)(const struct dn_naddr *); 133 typedef char *(WSAAPI *LPDNETNTOA)(const struct dn_naddr *); 134 typedef struct dn_naddr *(WSAAPI *LPGETNODEADD)(void); 135 typedef struct nodeent_f *(WSAAPI *LPGETNODEBYADDR)(const unsigned char *addr,int,int); 136 typedef struct nodeent_f *(WSAAPI *LPGETNODEBYNAME)(const char *); 137 typedef char *(WSAAPI *LPGETNODENAME)(void); 138 #endif 139