home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / languages / netlib / !NetLib / sys / h / if < prev    next >
Encoding:
Text File  |  1995-05-24  |  2.7 KB  |  65 lines

  1. /*
  2.  * Copyright (c) 1982, 1986 Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms are permitted
  6.  * provided that the above copyright notice and this paragraph are
  7.  * duplicated in all such forms and that any documentation,
  8.  * advertising materials, and other materials related to such
  9.  * distribution and use acknowledge that the software was developed
  10.  * by the University of California, Berkeley.  The name of the
  11.  * University may not be used to endorse or promote products derived
  12.  * from this software without specific prior written permission.
  13.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  14.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  15.  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  16.  */
  17.  
  18. /*
  19.  * Interface request structure used for socketioctl's
  20.  * All interface socketioctl's must have parameter
  21.  * definitions which begin with ifr_name.  The
  22.  * remainder may be interface specific.
  23.  */
  24. struct  ifreq {
  25. #define IFNAMSIZ        16
  26.         char    ifr_name[IFNAMSIZ];             /* if name, e.g. "et0" */
  27.         union {
  28.                 struct  sockaddr ifru_addr;
  29.                 struct  sockaddr ifru_broadaddr;
  30.                 short   ifru_flags;
  31. #define IFF_LOOPBACK    0x8             /* is a loopback net */
  32. #define IFF_POINTOPOINT 0x10            /* interface is point-to-point link */
  33. #define IFF_NOTRAILERS  0x20            /* avoid use of trailers */
  34. #define IFF_RUNNING     0x40            /* resources allocated */
  35. #define IFF_NOARP       0x80            /* no address resolution protocol */
  36. #define IFF_UP          0x1             /* interface is up */
  37. #define IFF_BROADCAST   0x2             /* broadcast address valid */
  38. #define IFF_DEBUG       0x4             /* turn on debugging */
  39.                 int     ifru_metric;
  40.                 char    *ifru_data;
  41.         } ifr_ifru;
  42. #define ifr_addr        ifr_ifru.ifru_addr      /* address */
  43. #define ifr_broadaddr   ifr_ifru.ifru_broadaddr /* broadcast address */
  44. #define ifr_flags       ifr_ifru.ifru_flags     /* flags */
  45. #define ifr_metric      ifr_ifru.ifru_metric    /* metric */
  46. #define ifr_data        ifr_ifru.ifru_data      /* for use by interface */
  47. };
  48.  
  49. /*
  50.  * Structure used in SIOCGIFCONF request.
  51.  * Used to retrieve interface configuration
  52.  * for machine (useful for programs which
  53.  * must know all networks accessible).
  54.  */
  55. struct  ifconf {
  56.         int     ifc_len;                /* size of associated buffer */
  57.         union {
  58.                 char    *ifcu_buf;
  59.                 struct  ifreq *ifcu_req;
  60.         } ifc_ifcu;
  61. #define ifc_buf ifc_ifcu.ifcu_buf       /* buffer address */
  62. #define ifc_req ifc_ifcu.ifcu_req       /* array of structures returned */
  63. };
  64.  
  65.