📄 tcpipapi.h
字号:
unsigned long devOutOctets; /* number of octets transmitted */
unsigned long devOutUcastPkts; /* number of unicast packets sent */
unsigned long devOutMulticastPkts; /* number of multicast packets sent */
unsigned long devOutBroadcastPkts; /* broadcasts sent */
unsigned long devOutDiscards; /* number of packets discarded with no error */
unsigned long devOutErrors; /* number of pkts discarded with an error */
unsigned long devOutQLen; /* number of packets in output queue */
}IfMib;
typedef struct tagIpMib
{
long ipForwarding; /* 1: enabled */
long ipDefaultTTL; /* default TTL for pkts originating here */
unsigned long ipInReceives; /* IP packets received from interfaces */
unsigned long ipInHdrErrors; /* Pkts discarded due to header errors */
unsigned long ipInAddrErrors; /* Pkts discarded due to bad address */
unsigned long ipForwDatagrams; /* Pkts forwarded through this entity */
unsigned long ipInUnknownProtos; /* Local-addressed pkts w/unknown proto */
unsigned long ipInDiscards; /* Error-free packets discarded */
unsigned long ipInDelivers; /* Datagrams delivered to upper level */
unsigned long ipOutRequests; /* IP datagrams originating locally */
unsigned long ipOutDiscards; /* Error-free output IP pkts discarded */
unsigned long ipOutNoRoutes; /* IP pkts discarded due to no route */
long ipReasmTimeout; /* Seconds fragment is held awaiting reassembly */
unsigned long ipReasmReqds; /* Fragments needing reassembly (here) */
unsigned long ipReasmOKs; /* Number of fragments reassembled */
unsigned long ipReasmFails; /* Number of failures in IP reassembly */
unsigned long ipFragOKs; /* Number of datagrams fragmented here */
unsigned long ipFragFails; /* Pkts unable to be fragmented here */
unsigned long ipFragCreates; /* Number of IP fragments created here */
unsigned long ipRoutingDiscards;
} IpMib;
typedef struct tagIcmpMib
{
unsigned long icmpInMsgs; /* Total of ICMP msgs received */
unsigned long icmpInErrors; /* Total of ICMP msgs received with errors */
unsigned long icmpInDestUnreachs;
unsigned long icmpInTimeExcds;
unsigned long icmpInParmProbs;
unsigned long icmpInSrcQuenchs;
unsigned long icmpInRedirects;
unsigned long icmpInEchos;
unsigned long icmpInEchoReps;
unsigned long icmpInTimestamps;
unsigned long icmpInTimestampReps;
unsigned long icmpInAddrMasks;
unsigned long icmpInAddrMaskReps;
unsigned long icmpOutMsgs;
unsigned long icmpOutErrors;
unsigned long icmpOutDestUnreachs;
unsigned long icmpOutTimeExcds;
unsigned long icmpOutParmProbs;
unsigned long icmpOutSrcQuenchs;
unsigned long icmpOutRedirects;
unsigned long icmpOutEchos;
unsigned long icmpOutEchoReps;
unsigned long icmpOutTimestamps;
unsigned long icmpOutTimestampReps;
unsigned long icmpOutAddrMasks;
unsigned long icmpOutAddrMaskReps;
} IcmpMib;
typedef struct tagTcpMib
{
long tcpRtoAlgorithm; /* retransmission timeout algorithm */
long tcpRtoMin; /* minimum retransmission timeout (mS) */
long tcpRtoMax; /* maximum retransmission timeout (mS) */
long tcpMaxConn; /* maximum tcp connections possible */
unsigned long tcpActiveOpens; /* number of SYN-SENT -> CLOSED transitions */
unsigned long tcpPassiveOpens; /* number of SYN-RCVD -> LISTEN transitions */
unsigned long tcpAttemptFails; /* (SYN-SENT,SYN-RCVD)->CLOSED or SYN-RCVD->LISTEN*/
unsigned long tcpEstabResets; /* (ESTABLISHED,CLOSE-WAIT) -> CLOSED */
unsigned long tcpCurrEstab; /* number in ESTABLISHED or CLOSE-WAIT state */
unsigned long tcpInSegs; /* number of segments received */
unsigned long tcpOutSegs; /* number of segments sent */
unsigned long tcpRetransSegs; /* number of retransmitted segments */
unsigned long tcpInErrs; /* number of received errors */
unsigned long tcpOutRsts; /* number of transmitted resets */
} TcpMib;
typedef struct tagUdpMib
{
unsigned long udpInDatagrams; /* UDP datagrams delivered to users */
unsigned long udpNoPorts; /* UDP datagrams to port with no listener */
unsigned long udpInErrors; /* UDP datagrams unable to be delivered */
unsigned long udpOutDatagrams; /* UDP datagrams sent from this entity */
}UdpMib;
typedef struct tag_atEntry
{
long IfIndex; /* interface on which this entry maps */
unsigned char PhysAddress[6]; /* physical address of destination */
unsigned char PhysAddressLen; /* length of atPhysAddress */
unsigned long NetAddress; /* IP address of physical address */
}atEntry;
typedef struct tag_UserDhcpEthEntry
{
unsigned long BootSIpAddress; // BOOT Server (TFTP server), not supported
unsigned long Dns1ServerIpAddress; // Domain name server
unsigned long Dns2ServerIpAddress; // Second domain name server
unsigned long Yiaddr; // Our (leased) IP address
unsigned long NetMask; // Our subnet mask
unsigned long DefRouter; // Default router
unsigned long DhcpServerId; // DHCP selected server IP address
unsigned long internal1; // Internal use only
unsigned long internal2; // Internal use only
unsigned long DhcpLeaseTime; // DHCP Address lease time in milliseconds
unsigned long internal3; // internal use only
unsigned long internal4; // internal use only
unsigned char DomainName[64]; // Domain name
unsigned char BootSname[64]; // TFTP server name, not used
unsigned char BootFileName[128]; // Boot file name (for TFTP download), not supported
unsigned short BootFileSize; // Boot file size in 512 Bytes blocks (for TFTP download), not supported
unsigned short internal5; // internal use only
}UserEthDhcp_Entry;
typedef void far * DevUserIfaceHandle; /* handle type , to identify the interface internal*/
typedef void far * DevUserBuffer; /* Device buffer handle type*/
typedef void far * DevUserLinkLayer; /* handle type , to identiy link layer internal*/
typedef DevUserBuffer far * DevUserBufferHandle;
/***********************************************************************************/
//Device driver function pointers
/***********************************************************************************/
//main structure for installing device driver and TCPIP interface
typedef struct tag_DevUserDriver
{
int DevIndex; // internal device index
char far * DevName; // unique name max. 13 chars + 0
unsigned long IpAddr; // IP address
unsigned long Netmask; // Netmask
DevUserIfaceHandle IfaceHandle; // handle to identify the interface internal
DevUserLinkLayer LinkLayerHandle; // handle to identify the link layer internal
unsigned char iface_type; // type of the device driver:
// 0: unknown user specific device,
// 1: device is an ethernet controller,
// 2: use PPP protocol as a server
// 3: use PPP protocol as a client
unsigned char use_dhcp; // set to 1, if you want to use IP configuration by a DHCP server
UserEthDhcp_Entry far * Dhcp_Data; // Pointer to storage dhcp data, only, if use_dhcp==1 and iface_type==1(ethernet)
void far * PPPLinkNotify; // Used only, if the iface_type == 2 or 3 (PPPserver or client)
// Pointer to a user provided "link notify" callback function,
// which is called by the PPP layer to inform the user
// about the current PPP device status.
// The function should look like this:
// void huge PPPnotify(DevUserIfaceHandle ifaceHandle, int flags);
// The function is called with the interface handle and a flag.
// The flag is set to one or more of the following bits:
// 0x0002: PPP device is ready to accept data from the user.
// 0x0008: Close procedure started.
// 0x0010: PPP device has closed.
// 0x0020: LCP layer is up.
// Set pointer to NULL, if the PPP layer shall
// not execute a link notify function
PPP_Option far * PPPoptions; //Pointer to the first PPPoption of an user provide PPP option array,
//These options will be set inside the Dev_Open_Interface call
//The Dev_Open_Interface call returns 222, if trhe setting of the option failed
//As an end marker, the element protocol_level of the last option must be 0.
void far * Reserved3;
//set of driver functions, user has to write
void far * DevOpen; // Driver Open/initialize function, optional (pass a Null pointer, if not used)
void far * DevClose; // Driver Close function, optional (pass a Null pointer, if not used)
void far * DevSend; // Driver send function
void far * DevRecv; // Driver recv function
void far * DevGetPhysAddr; // Ethernet driver only, returns MAC address, else pass a Null pointer
void far * DevFreeRecv; // Free own allocated buffer, optional (pass a Null pointer, if not used)
void far * DevIoctl; // currently not supported, pass a Null pointer
int far * ErrorCode; // contains errorcode, if install (API call 0xAC 0xA0) failed
void far * Reserved4; // reserved for future extensions
void far * Reserved5;
void far * Reserved6;
}DevUserDriver;
/*****************************************************************************/
//IPv6 device configuration
/*****************************************************************************/
typedef struct tag_user_iface_ipv6_entry{
void far * devIfaceHandle; // Device handle pointer (internal used)
int devIndex; // Internal used index number
int devType; // Type of the device driver:
// 0: unknown,
// 1: Ethernet driver,
// 2: PPP protocol
// 4: SLIP protocol (not supported)
// 5: Internal loopback
char devName[14]; // Device name, terminated by zero
unsigned int devFlags; // Device status flag
// Bit1 == 1 Device opened
// Bit2 == 1 Device IPv6 config in progress
// Bit3 == 1 Device open completed
unsigned int devIPv6Flags; // IPv6 status flags
// Bit1 == 1 Link-layer address configured
// Bit2 == 1 Link-local address configured (or is pending)
// Bit3 == 1 Site-local address configured (or is pending)
// Bit4 == 1 Global scope IPv6 native address
// Bit5 == 1 Global scope IPv4-compatible IPv6 address configured
// Bit6 == 1 Global scope 6-to-4 IPv6 address
// Bit7 == 1 IPv6 connectivity establish on PPP interface
unsigned int devIPv6Mtu; // The MTU of the IPv6 link
struct in6_addr devIPv6PPPPeerIpAddr; // Remote peer address for PPP
struct in6_addr devIPv6AddrArray[10]; // Array of all configured IPv6 addresses on this interface
unsigned char devIPv6PrefixLen[10]; // Array of all configured Prefixlength of all IPv6 addresses
unsigned char devIPv6AddrFlagsArray[10]; // Array of configuration flags
unsigned char devPhysAddr[6]; // Physical address of the interface
void far * devIPv6ExtensionPtr; //for future use
}IfaceIPv6_Entry;
/*****************************************************************************/
//PKI, SSL structures
/*****************************************************************************/
typedef struct tag_pki_cert_add_entry
{
void far * fileNamePtr;
int fileFormat;
int certType;
void far * idPtr;
int idLength;
void far * caIdPtr;
} PKI_CERT_ADD_Entry;
typedef PKI_CERT_ADD_Entry far * PKI_CERT_ADD_EntryPtr;
typedef struct tag_pki_ownkeypair_add_entry
{
void far * fileNamePtr;
int fileFormat;
int keyType;
} PKI_OWNKEYPAIR_ADD_Entry;
typedef PKI_OWNKEYPAIR_ADD_Entry far * PKI_OWNKEYPAIR_ADD_EntryPtr;
typedef struct tag_ssl_session_new_entry
{
char far * certIdentity;
unsigned int maxCaches;
int version;
} SSL_SESSION_NEW_Entry;
typedef SSL_SESSION_NEW_Entry far * SSL_SESSION_NEW_EntryPtr;
/*****************************************************************************/
//BSD Socket defines
/*****************************************************************************/
#define AF_INET 2
#define PF_INET AF_INET
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -