📄 tcpipapi.h
字号:
typedef struct tag_ppp_client
{
/************************************************************************************/
//user PPP config data
/************************************************************************************/
int port; //serial port (0:EXT 1:COM)
int auth; // 0: no authentication
// 1:PAP Client must send username and password for PAP authentication to the peer
// 2:CHAP Client must send username and password for CHAP authentication to the peer
// 3:PAP Client expects PAP username and password from the peer
// 4:CHAP Client expects CHAP username and password from the peer
int modem; //modem usage (0:nullmodem 1:analogue modem)
int flow; //serial flow control (0: none, 1:XON/XOFF, 2:RTS/CTS)
long baud; //serial baudrate
unsigned long idletimeout; //closing ppp after idle time seconds (0: no closing after idle time)
char username[50]; //username, if auth <=4 and !=0
char password[50]; //password, if auth <=4 and !=0
void far * dptr; //dummy ptr
/************************************************************************************/
//filled in after successful API call: IP cfg data given from server
/************************************************************************************/
char PPPClieipAddrStr[16]; //If this IP is set to "0.0.0.0" client expect IP form the peer, IP is filled in after sucessful connection
//If this IP is set to a string != "0.0.0.0" client wants to use this IP during the ppp session
char PPPClieRemipAddrStr[16]; //If RemoteIP is set to "0.0.0.0" client allow the peer to use its own IP during the PPP session
//the RemoteIP is filled in after sucessful connection
//If RemoteIP is set to a string != "0.0.0.0" client wants to configure the remote peer with this IP
char PPPClienetMaskStr[16];
char PPPClieipGatewayStr[16];
/************************************************************************************/
//modem parameters
/************************************************************************************/
PPPDial pppdial[PPP_MAX_DIAL]; // modem/dial entries
PPP_ModemHangup modem_hangup; // modem hangup commands
unsigned int break_modem; /*
flag for breaking SC12 <-> modem control communication, dialing, waiting for connect,..
setting break_modem to 1, interrupts current modem communication between
SC12 and the modem at a pppclient open or close call,
The pppclient read this flag and breaks the modem dialing, or waiting.
This flag could be set from another task, to interrupt the dialing.
If a ppp link is established, it doesn't break the session.
Don't forget to set this flag to zero after breaking
*/
}PPPClient_Init;
typedef struct tag_ppp_client_ipv6
{
/************************************************************************************/
//user PPP config data
/************************************************************************************/
int port; // serial port (0:EXT 1:COM 2:SER2 3:SER3)
int auth; // 0: no authentication
// 1:PAP Client must send user name and password
// for PAP authentication to the peer
// 2:CHAP Client must send user name and password
// for CHAP authentication to the peer
// 3:PAP Client expects PAP user name and password
// from the peer
// 4:CHAP Client expects CHAP user name and password
// from the peer
int modem; // modem usage (0:nullmodem 1:modem)
int flow; // serial flow control (0: none, 1:XON/XOFF, 2:RTS/CTS)
long baud; // serial baudrate
unsigned long idletimeout; // Closing PPP after idle time seconds
// (0: no closing after idle time)
char username[50]; //username, if auth <=4 and !=0
char password[50]; //password, if auth <=4 and !=0
void * dptr; // dummy ptr
/************************************************************************************/
//filled in after successful API call: IP cfg data given from server
/************************************************************************************/
char PPPClieipAddrStr[46]; //If this IP is set to "::0" client expect IP form the peer, IP is filled in after sucessful connection
//If this IP is set to a string != "::0" client wants to use this IP during the ppp session
char PPPClieRemipAddrStr[46]; //If RemoteIP is set to "::0" client allow the peer to use its own IP during the PPP session
//the RemoteIP is filled in after sucessful connection
//If RemoteIP is set to a string != "::0" client wants to configure the remote peer with this IP
/************************************************************************************/
//modem parameters
/************************************************************************************/
PPPDial pppdial[PPP_MAX_DIAL];// modem/dial entries
PPP_ModemHangup modem_hangup; // modem hang-up commands
int * break_modem; //flag for interrupt SC12<->modem communication, break dialing, connect
// control communication (dialing, waiting for connect)
// Setting break_modem to 1 breaks current modem control communication
// between IPC@CHIP and the modem at a PPP client open or close call.
// The PPP client reads this flag and breaks the dialing, if flag is set.
// This flag can be set from another task. It will not break an established
// PPP link! Don't forget to clear this flag to zero after breaking.
}PPPClient_Init_IPv6;
/*****************************************************************************/
//PPP Option
/*****************************************************************************/
typedef struct tag_ppp_option
{
int protocolLevel;
int remoteLocalFlag;
int optionName;
const char far *optionValuePtr;
int optionLength;
} PPP_Option;
/*****************************************************************************/
//TCPIP statistics structure (needed by function TCPIP_STATISTISTICS 0x74)
/*****************************************************************************/
typedef struct tag_cnt_packet{
/*recv counter*/
unsigned int far * cnt_all_packets; //count all incoming ethernet packets
unsigned int far * cnt_ip_packets; //count incoming IP packets
unsigned int far * cnt_arp_packets; //count incoming ARP packets
unsigned int far * cnt_tcp_packets; //count incoming TCP packets
unsigned int far * cnt_udp_packets; //count incoming UDP packets
unsigned int far * cnt_icmp_packets; //count incoming ICMP packets
/*send counter*/
unsigned int far * cnt_all_sended_packets; //count all sended ethernet packets
unsigned int far * cnt_ip_sended_packets; //count all sended ip packets
unsigned int far * cnt_arp_sended_packets; //count all sended arp packets
unsigned int far * cnt_tcp_sended_packets; //count all sended tcp packets
unsigned int far * cnt_udp_sended_packets; //count all sended udp packets
unsigned int far * cnt_icmp_sended_packets;//count all sended icmp packets
/*chksum error counter on incoming packets*/
unsigned int far * cnt_ip_chksum_errs; //count all chksum errors on incoming ip packets
unsigned int far * cnt_udp_chksum_errs; //count all chksum errors on incoming udp packets
unsigned int far * cnt_tcp_chksum_errs; //count all chksum errors on incoming tcp packets
unsigned int far * cnt_eth_errs; //count all ethernet error, CRC, FAE and FIFO overrun
}Packet_Count;
/*****************************************************************************/
//Ping API
/*****************************************************************************/
typedef struct tag_ping_command
{
int sd; //socket descriptor, filled by PING_OPEN
char far * remoteHostNamePtr; //remote ip
int pingInterval; //seconds
int pingDataLength; //max. 1024 Bytes
unsigned long count; //number of pings to send
unsigned char pingstate; //pin socket state, 1: open 0: closed
//statistics, filled by ping command
unsigned long transmitted; //sended ping requests
unsigned long received; //received replies
unsigned int lastsenderr; //last send error
unsigned int lastrcverr; //last receive error
unsigned long maxRtt; //Max round trip time, rounded off to 100ms steps
unsigned long minRtt; //Minimum round trip time in milliseconds, (100 ms steps)
unsigned long lastRtt; //round trip time (100 ms steps) of the last ping request/reply
}Ping;
/*****************************************************************************/
//Routing
/*****************************************************************************/
typedef struct tag_route_entry
{
unsigned long destIPAddress; //The IP address to add the route for
unsigned long destNetmask; //The netmask for the route
unsigned long gateway; //IP address of the gateway of the route
int hops; //Number of routers between this host and route
}Route_Entry;
typedef struct tagArpRouteCacheEntry
{
unsigned int ifIndex; //interface index fpr this entry
unsigned long flags; //type of entry
unsigned long arpIpAddress; //IP address
unsigned long mask;
long arpTtl; //TimeToLive in milliseconds
long hops; //number of routers between this host and the route
union
{
struct
{
//device IP address for Local routing entry
unsigned long DevIpAddress;
}LocalNetRouteEntry;
struct
{
//device Ethernet address for ARP entry
unsigned char MacAddress[6];
unsigned char filler[2];
}ArpEntry;
struct
{
unsigned long GatewayIpAddress; //indirect route
}GatewayEntry;
}ArpRouteGwayUnion;
}ArpRouteCacheEntry;
/*****************************************************************************/
//Interface information
/*****************************************************************************/
typedef struct tag_iface_device
{
unsigned int devIndex; //Internal index number
char devName[14]; //Device name
unsigned long devIPAddr; //IP address for this interface
unsigned long devNetmask; //Netmask for the route
unsigned long devDestIpAddr; //Remote peer address for PPP
unsigned char PhysAddr[6]; //Physical device address, max. 6 Bytes
int devType; // type of the device driver:
// 0: unknown,
// 1: ethernet driver,
// 2: PPP protocol
// 4: SLIP protocol (not supported)
// 5: Internal loopback
int devDHCP; // Interface configured by DHCP? 1:0
int devFlag;
int devMTU; //Max. Transfer Unit
void far * reserved;
}Iface_Entry;
/*********************************************************************************/
/*
SNMP MIB structures: Only available at BIOS version which contains SNMP MIB variables.
Note: We don't have a SNMP agent inside of the BIOS but
if an user is able to implement an own snmp agent at the IPC@Chip based at the
TCPIP API, he needs access to TCPIP internal variables of these defined structures
*/
/********************************************************************************/
typedef struct tagIfMib /*interface, only ethernet is supported*/
{
long ifIndex; /* index of this interface 1 for ethernet, currently only ethernet*/
char ifDescr[32]; /* description of interface */
long ifType; /* network device type */
long ifMtu; /* maximum transfer unit */
unsigned long ifSpeed; /* bandwidth in bits/sec */
unsigned char ifPhysAddress[11]; /* interface's address */
unsigned char PhysAddrLen; /* length of physAddr: 6 */
long ifAdminStatus; /* desired state of interface, not supported */
long ifOperStatus; /* current operational status, not supported */
//counters
unsigned long devLastChange; /* value of sysUpTime when current state entered */
unsigned long devInOctets; /* number of octets received on interface */
unsigned long devInUcastPkts; /* number of unicast packets delivered */
unsigned long devInMulticastPkts; /* number of multicast packets delivered, not supported */
unsigned long devInBroadcastPkts; /* broadcasts delivered */
unsigned long devInDiscards; /* number of broadcasts */
unsigned long devInErrors; /* number of packets containing errors */
unsigned long devInUnknownProtos; /* number of packets with unknown protocol */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -