⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pna.h

📁 PPPoE协议在Psos中的实现源代码
💻 H
📖 第 1 页 / 共 4 页
字号:
/***********************************************************************//*                                                                     *//*   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_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         1       /* set/get tcp nodelay option *//*---------------------------------------------------------------------*//* 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_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_LINGER       0x0080      /* linger on close if data present */#define SO_OOBINLINE    0x0100      /* leave received OOB data in line */#define SO_INTERFACE    0x0400      /* intf number sent/returned */#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 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 UDP Checksum Options                                 *//*----------------------------------------------------------------------*/#define SIOCSUDPCHKSUM  0x8024751E  /* set udp checksumming on/off */#define SIOCGUDPCHKSUM  0xC024751F  /* get udp checksumming mode *//*----------------------------------------------------------------------*//* Definitions for Interface Group MIB variables                        *//* GET command definitions                                              *//*----------------------------------------------------------------------*/#define SIOCGIFNUMBER       0x40016D01 /* get interface number */#define SIOCGIFTABLE        0x40016D02 /* get Interface table */#define SIOCGIFINDEX        0x40016D03 /*  get NI index */#define SIOCGIFDESCR        0x40016D04 /* Get ni descr */#define SIOCGIFTYPE         0x40016D05 /* Get NI type */#define SIOCGIFMTUNIT       0x40016D06 /* Get NI mtu */#define SIOCGIFSPEED        0x40016D07 /* Get NI speed */#define SIOCGIFPHYSADDRESS  0x40016D08 /* Get ni Phy. Address */#define SIOCGIFADMINSTATUS  0x40016D09 /* Get ni admin status */#define SIOCGIFOPERSTATUS   0x40016D0A /* Get NI operatioanl status */#define SIOCGIFLASTCHANGE   0x40016D0B /* Get last change in status */#define SIOCGIFINOCTETS     0x40016D0C /* Get no of octets rcvd. */#define SIOCGIFINUCASTPKTS  0x40016D0D /* Get no. of unicast pkts rcvd  */#define SIOCGIFINNUCASTPKTS 0x40016D0E /* Get no. of multi. pkts rcvd */#define SIOCGIFINDISCARDS   0x40016D0F /* Get no of pckts discarded */#define SIOCGIFINERRORS     0x40016D10 /* Get no of error pckts */#define SIOCGIFINUNKNOWNPROTOS 0x40016D11 /* No of pckts for unk. protocol */#define SIOCGIFOUTOCTETS    0x40016D12 /* No of octets rcvd */#define SIOCGIFOUTUCASTPKTS 0x40016D13 /* No of unicast pkts sent */#define SIOCGIFOUTNUCASTPKTS 0x40016D14 /* No of multi. pkts sent */#define SIOCGIFOUTDISCARDS  0x40016D15 /* No of out pkts discarded */#define SIOCGIFOUTERRORS    0x40016D16 /* No of outbounds pkts errors */#define SIOCGIFOUTQLEN      0x40016D17 /* Length of output Q length */#define SIOCGIFSPECIFIC     0x40016D18 /* NI specific parameter *//*----------------------------------------------------------------------*//* set command definitions                                              *//*----------------------------------------------------------------------*/#define SIOCSIFADMINSTATUS  0x80016D09 /* set Interface admin. status *//*----------------------------------------------------------------------*//* Definitions for IP Group MIB variables                               *//* GET command definitions                                              *//*----------------------------------------------------------------------*/#define SIOCGIPFORWARDING   0x40026D01 /* IP forwarding var.   */#define SIOCGIPDEFAULTTTL   0x40026D02 /* IP def. Time-to-Live var */#define SIOCGIPINRECEIVES   0x40026D03 /* IP dgrams rec. from below */#define SIOCGIPINHDRERRORS  0x40026D04 /* IP dgrams format errs drops */#define SIOCGIPINADDRERRORS 0x40026D05 /* IP dgrams misdelivery drops */#define SIOCGIPFORWDATAGRAMS 0x40026D06 /* IP dgrams forwarded */#define SIOCGIPINUNKNOWNPROTOS 0x40026D07 /* IP unknown proto. dgrams */#define SIOCGIPINDISCARDS   0x40026D08 /* IP disc. dgrms for resources */#define SIOCGIPINDELIVERS   0x40026D09 /* IP dgrams delivered above */#define SIOCGIPOUTREQUESTS  0x40026D0A /* IP dgrams sent out */#define SIOCGIPOUTDISCARDS  0x40026D0B /* IP out dgrams discarded */#define SIOCGIPOUTNOROUTES  0x40026D0C /* IP dgrams drops for no routes */#define SIOCGIPREASMTIMEOUT 0x40026D0D /* IP retrans. queue timeout */#define SIOCGIPREASMREQDS   0x40026D0E /* IP frags. needing reass. */#define SIOCGIPREASMOKS     0x40026D0F /* IP frags. reassembled */#define SIOCGIPREASMFAILS   0x40026D10 /* IP frag reassembly fails */#define SIOCGIPFRAGOKS      0x40026D11 /* IP dgrams fragmented */#define SIOCGIPFRAGFAILS    0x40026D12 /* IP dgrams fragmentation fails */#define SIOCGIPFRAGCREATES  0x40026D13 /* IP frags. created */#define SIOCGIPROUTINGDISCARDS 0x40026D14 /* IP Routing ent. discarded *//*----------------------------------------------------------------------*//* SET command definitions                                              *//*----------------------------------------------------------------------*/#define SIOCSIPFORWARDING   0x80026D01 /* IP forwarding variable */#define SIOCSIPDEFAULTTTL   0x80026D02 /* IP Defautl time-to-live *//*----------------------------------------------------------------------*//* Definitions for IP NI address table                                  *//* GET commands definitions                                             *//*----------------------------------------------------------------------*/#define SIOCGIPADDRTABLE    0x40036D01 /* IP Address table */#define SIOCGIPADDRENTADDR  0x40036D03 /* IP Address of the addr entry */#define SIOCGIPADDRENTIFINDEX 0x40036D04 /* NI number of the interface */#define SIOCGIPADDRENTNETMASK 0x40036D05 /* Netmask of the NI */#define SIOCGIPADDRENTBCASTADDR 0x40036D06 /* IP Broadcast Address of the NI*/#define SIOCGIPADDRENTREASMMAXSIZE 0x40036D07 /* IP max. reassm. size *//*----------------------------------------------------------------------*//* Definitions for IP route table                                       *//* GET command definitions                                              *//*----------------------------------------------------------------------*/#define SIOCGIPROUTETABLE   0x40046D01 /* IP routing table */#define SIOCGIPROUTEDEST    0x40046D03 /* Route destination */#define SIOCGIPROUTEIFINDEX 0x40046D04 /* Interface Index of the route */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -