📄 pna.h
字号:
/***********************************************************************//* *//* MODULE: pna.h 1.17 *//* DATE: 12:57:16 - 98/11/10 *//* PURPOSE: Structure definitions, function prototypes, and symbol *//* definitions for pNA+ *//* *//*---------------------------------------------------------------------*//* *//* Copyright 1991 - 1995 Integrated Systems, Inc. *//* ALL RIGHTS RESERVED *//* *//* Permission is hereby granted to licensees of Integrated Systems, *//* Inc. products to use or abstract this computer program for the *//* sole purpose of implementing a product based on Integrated *//* Systems, Inc. products. No other rights to reproduce, use, *//* or disseminate this computer program, whether in part or in *//* whole, are granted. *//* *//* Integrated Systems, Inc. makes no representation or warranties *//* with respect to the performance of this computer program, and *//* specifically disclaims any responsibility for any damages, *//* special or consequential, connected with the use of this program. *//* *//***********************************************************************//*---------------------------------------------------------------------*//* Don't allow this file to be included more than once. *//*---------------------------------------------------------------------*/#ifndef _PNA_H#define _PNA_H#if defined(__cplusplus)extern "C" {#endif/*Include <errno.h> now, so that if the client includes it, it will have no further effect.*/#include <errno.h>#include "bsp.h" /* This is required by htonl() and htons() swap macros *//***********************************************************************//* General Definitions *//***********************************************************************/#include "types.h"/*---------------------------------------------------------------------*//* Socket types *//*---------------------------------------------------------------------*/#define SOCK_STREAM 0x1 /* stream socket */#define SOCK_DGRAM 0x2 /* datagram socket */#define SOCK_RAW 0x3 /* raw socket *//*---------------------------------------------------------------------*//* Address family supported by pNA+ *//*---------------------------------------------------------------------*/#define AF_INET 0x2 /* internetwork: UDP, TCP, etc. */#define AF_UNSPEC 0x0 /* unspec ified *//*---------------------------------------------------------------------*//* Protocols Supported by pNA+ *//*---------------------------------------------------------------------*/#define IGMP 0x2 /* IGMP protocol */#define TCP 0x6 /* TCP protocol */#define UDP 0x11 /* UDP protocol */#define IPPROTO_IP 0x0 /* IP protocol */#define IPPROTO_IGMP 0x2 /* IGMP protocol */#define IPPROTO_TCP 0x6 /* TCP protocol */#define IPPROTO_UDP 0x11 /* UDP protocol *//*---------------------------------------------------------------------*//* Options for use with [gs]etsockopt at the IP level. *//*---------------------------------------------------------------------*/#define IP_OPTIONS 1 /* set/get IP per-packet options */#define IP_HDRINCL 2 /* int; header is included with data */#define IP_RECVIF 3 /* Get interface info in receive data */#define IP_MULTICAST_IF 9 /* u_char; set/get IP multicast i/f */#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */#define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback*/#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */#define IP_MULTICAST_INTF 14 /* set/get IP multicast i/f */#define IP_ADD_MEMBERSHIP_INTF 15 /* ip_mreq_intf; add an IP group membership given interface */#define IP_DROP_MEMBERSHIP_INTF 16 /* ip_mreq_intf; drop an IP group membership given interface *//*---------------------------------------------------------------------*//* Defaults and limits for options *//*---------------------------------------------------------------------*/#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */#define IP_MAX_MEMBERSHIPS 20 /* per socket; must fit in one mbuf *//*---------------------------------------------------------------------*//* Options for use with [gs]etsockopt at the TCP level. *//*---------------------------------------------------------------------*/#define TCP_NODELAY 0x01 /* set/get tcp nodelay option */#define TCP_MAXSEG 0x02 /* only get maximum segment size */#define TCP_KEEPALIVE_IDLE 0x03 /* TCP Keepalive timer value */#define TCP_KEEPALIVE_CNT 0x04 /* TCP Keepalive probe count */#define TCP_KEEPALIVE_INTVL 0x05 /* TCP Keepalive probing interval */#define TCP_MSL 0x06 /* TCP Maximum Segment Lifetime */#define TCP_HIWATMBLKS 0x07 /* TCP threshold # of mblks in write */ /* before it blocks the write *//*---------------------------------------------------------------------*//* Level number for (get/set)sockopt() to apply to socket itself. *//*---------------------------------------------------------------------*/#define SOL_SOCKET 0xFFFF /* options for socket level *//*---------------------------------------------------------------------*//* Maximum queue length specifiable by listen() *//*---------------------------------------------------------------------*/#define SOMAXCONN 0x5 /* maximum queue length *//*---------------------------------------------------------------------*//* Socket Options used by setsockopt() and getsockopt() *//*---------------------------------------------------------------------*/#define SO_DEBUG 0x0001#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */#define SO_REUSEADDR 0x0004 /* allow reuse of local addresses */#define SO_KEEPALIVE 0x0008 /* keep socket connections alive */#define SO_DONTROUTE 0x0010 /* bypass routing for outgoing */ /* messages */#define SO_BROADCAST 0x0020 /* permission to transmit broadcast */ /* messages */#define SO_PROTOTYPE 0x0040#define SO_LINGER 0x0080 /* linger on close if data present */#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */#define SO_ORDREL 0x0200#define SO_INTERFACE 0x0400 /* intf number sent/returned */#define SO_REUSEPORT 0x0800#define SO_SNDBUF 0x1001 /* set buffer size for output */#define SO_RCVBUF 0x1002 /* set buffer size for input */#define SO_SNDLOWAT 0x1003 /* send low-water mark */#define SO_RCVLOWAT 0x1004 /* receive low-water mark */#define SO_SNDTIMEO 0x1005 /* send timeout */#define SO_RCVTIMEO 0x1006 /* receive timeout */#define SO_ERROR 0x1007 /* get error status and clear */#define SO_TYPE 0x1008 /* get socket type *//*---------------------------------------------------------------------*//* Flags Used by Send/Recieve Calls *//*---------------------------------------------------------------------*/#define MSG_OOB 0x1 /* process out-of-band data */#define MSG_PEEK 0x2 /* peek at incoming message */#define MSG_DONTROUTE 0x4 /* send without using routing tables */#define MSG_RAWMEM 0x8 /* send/recv using pNA memory */#define MSG_INTERFACE 0x10 /* send/recv interface information *//*---------------------------------------------------------------------*//* Maximum Length of the Vectors used in sendmsg() and recvmsg() *//*---------------------------------------------------------------------*/#define MSG_MAXIOVLEN 0x10/***********************************************************************//* Control Commands for ioctl() to control socket action *//***********************************************************************/#define FIOGETOWN 0x4004667C /* Get owner of the socket */#define FIOREAD 0x4004667F /* Get bytes in socket read buffer */#define FIOSETOWN 0x8004667C /* Set owner of the socket */#define FIOASYNC 0x8004667D /* Set/Unset socket to receive */ /* Asyncronous signal */#define FIONBIO 0x8004667E /* Set/Unset socket non-blocking */#define SIOCATMARK 0x40047307 /* Get out of band data mark *//*----------------------------------------------------------------------*//* Definitions for Routing entries *//*----------------------------------------------------------------------*/#define SIOCADDRT 0x8034720A /* add route */#define SIOCDELRT 0x8034720B /* delete route */#define SIOCRSTRT 0x8034720C /* reset route */#define SIOCMODRT 0x8034720D /* modify route *//*----------------------------------------------------------------------*//* Definitions for Network Node ID options *//*----------------------------------------------------------------------*/#define SIOCSNNODEID 0x80346E0A /* set the Network Node ID */#define SIOCGNNODEID 0xC0346E0B /* get the Network Node ID *//*----------------------------------------------------------------------*//* Definitions for NI parameters *//*----------------------------------------------------------------------*/#define SIOCSIFADDR 0x8014690C /* set interface ip address */#define SIOCGIFADDR 0xC014690D /* get interface ip address */#define SIOCSIFDSTADDR 0x8014690E /* set point-to-point dest. address */#define SIOCGIFDSTADDR 0xC014690F /* get point-to-point dest. address */#define SIOCSIFFLAGS 0x80146910 /* set interface flags */#define SIOCGIFFLAGS 0xC0146911 /* get interface flags */#define SIOCGIFBRDADDR 0xC0146912 /* get interface broadcast addr */#define SIOCSIFBRDADDR 0x80146913 /* set interface broadcast addr */#define SIOCGIFCONF 0xC0086914 /* get interface configuration list */#define SIOCGIFNETMASK 0xC0146915 /* get interface net addr mask */#define SIOCSIFNETMASK 0x80146916 /* set interface net addr mask */#define SIOCGIFMTU 0xC0146917 /* get interface MTU */#define SIOCSIFMTU 0X80146918 /* set interface MTU */#define SIOCSIFNO 0x80146919 /* set interface number- IP and ARP */#define SIOCSNIINIT 0x8014691A /* initialize interface */#define SIOCPSOSINIT 0x8004730A /* re/initialized interface *//*----------------------------------------------------------------------*//* Definitions for IP Multicast Options *//*----------------------------------------------------------------------*/#define SIOCADDMCAST 0x80346D0A /* add m'cast addr */#define SIOCDELMCAST 0x80346D0B /* del m'cast addr */#define SIOCMAPMCAST 0x80346D0C /* map m`cast addr *//*----------------------------------------------------------------------*//* Definitions for ARP entries *//*----------------------------------------------------------------------*/#define SIOCSARP 0x8024691E /* set arp entry */#define SIOCGARP 0xC024691F /* get arp entry */#define SIOCDARP 0x80246920 /* delete arp entry *//*----------------------------------------------------------------------*//* Definitions for new ARP entries *//*----------------------------------------------------------------------*/#define SIOCSNARP 0x80246921 /* set new arp entry */#define SIOCGNARP 0xC0246922 /* get new arp entry *//*----------------------------------------------------------------------*//* Definitions for UDP Checksum Options *//*----------------------------------------------------------------------*/#define SIOCSUDPCHKSUM 0x8024751E /* set udp checksumming on/off */#define SIOCGUDPCHKSUM 0xC024751F /* get udp checksumming mode */#define SIOCGMBSTAT 0x40FF7301 /* Mblks statistics */#define SIOCGDBSTAT 0x40ff7302 /* Data Block statistics *//*---------------------------------------------------------------------*//* Control Commands for shutdown() to control socket action *//*---------------------------------------------------------------------*/#define SHUTDOWN_FREAD 0x00 /* Shutdown read buffer */#define SHUTDOWN_FWRITE 0x01 /* Shutdown write buffer */#define SHUTDOWN_FRDWR 0x02 /* Shutdown read/write */#define FREAD SHUTDOWN_FREAD#define FWRITE SHUTDOWN_FWRITE#define FRDWR SHUTDOWN_FRDWR/*---------------------------------------------------------------------*//* Asynchronous signals generated by pNA *//*---------------------------------------------------------------------*/#define SIGIO 0x40000000 /* Signal I/O on socket */#define SIGPIPE 0x20000000 /* Signal PIPE on socket */#define SIGURG 0x10000000 /* Signal Urgent data on socket */#define SIGINTF 0x08000000 /* Signal change in Interface Status *//*---------------------------------------------------------------------*//* Definitions for type of route *//*---------------------------------------------------------------------*/#define RT_NETWORK 0x0 /* Network Route */#define RT_HOST 0x1 /* Host Route */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -