home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / internet / tcpipsrc / h / if / IFACE next >
Text File  |  1994-01-25  |  2KB  |  32 lines

  1. /* Interface control structure */
  2. struct interface {
  3.         struct interface *next; /* Linked list pointer */
  4.         char *name;             /* Ascii string with interface name */
  5.         int mtu;                /* Maximum transmission unit size */
  6.         int (*ioctl)();         /* Function to handle device control */
  7.         int (*send)();          /* Routine to send an IP datagram */
  8.         int (*output)();        /* Routine to send link packet */
  9.         int (*raw)();           /* Routine to call to send raw packet */
  10.         void (*recv)();         /* Routine to kick to process input */
  11.         int (*stop)();          /* Routine to call before detaching */
  12.         int dev;                /* Subdevice number to pass to send */
  13.         int flags;              /* Configuration flags */
  14. #define DATAGRAM_MODE   0       /* Send datagrams in raw link frames */
  15. #define CONNECT_MODE    1       /* Send datagrams in connected mode */
  16.         int trace;              /* Trace flags */
  17. #define IF_TRACE_OUT    0x01    /* Output packets */
  18. #define IF_TRACE_IN     0x10    /* Packets to me except broadcast */
  19. #define IF_TRACE_ASCII  0x100   /* Dump packets in ascii */
  20. #define IF_TRACE_HEX    0x200   /* Dump packets in hex/ascii */
  21.         char *hwaddr;           /* Hardware address */
  22.         int (*driver)(int,...); /* Device hardware driver pointer */
  23.         int subdevice;          /* Subdevice number */
  24.         struct interface *forw; /* Forwarding interface for output, if rx only */
  25. };
  26. #define NULLIF  (struct interface *)0
  27. extern struct interface *ifaces;        /* Head of interface list */
  28.  
  29. struct interface *if_lookup(char *);
  30. int doforward(int, char **);
  31.  
  32.