Home | History | Annotate | Line # | Download | only in net
if_srt.h revision 1.1
      1  1.1  mouse #ifndef _IF_SRT_H_1b91f8f1_
      2  1.1  mouse #define _IF_SRT_H_1b91f8f1_
      3  1.1  mouse 
      4  1.1  mouse /* This file is in the public domain. */
      5  1.1  mouse 
      6  1.1  mouse #include <net/if.h> /* XXX for IFNAMSIZ */
      7  1.1  mouse #include <netinet/in.h> /* for in_addr/in6_addr */
      8  1.1  mouse 
      9  1.1  mouse struct srt_rt {
     10  1.1  mouse   unsigned int inx;
     11  1.1  mouse   int af;
     12  1.1  mouse   union {
     13  1.1  mouse     struct in_addr v4;
     14  1.1  mouse     struct in6_addr v6;
     15  1.1  mouse     } srcmatch;
     16  1.1  mouse   unsigned int srcmask;
     17  1.1  mouse   union {
     18  1.1  mouse     struct ifnet *dstifp;
     19  1.1  mouse     char dstifn[IFNAMSIZ];
     20  1.1  mouse     } u;
     21  1.1  mouse   union {
     22  1.1  mouse     struct sockaddr_in sin;
     23  1.1  mouse     struct sockaddr_in6 sin6;
     24  1.1  mouse     struct sockaddr sa;
     25  1.1  mouse     } dst;
     26  1.1  mouse   } ;
     27  1.1  mouse 
     28  1.1  mouse /* Gets the number of slots in the rts array */
     29  1.1  mouse #define SRT_GETNRT _IOR('e',0,unsigned int)
     30  1.1  mouse 
     31  1.1  mouse /* Gets an rt entry, given the slot number in the inx field */
     32  1.1  mouse #define SRT_GETRT  _IOWR('e',1,struct srt_rt)
     33  1.1  mouse 
     34  1.1  mouse /* Sets an rt entry; inx must be either in the array or one past it */
     35  1.1  mouse #define SRT_SETRT  _IOW('e',2,struct srt_rt)
     36  1.1  mouse 
     37  1.1  mouse /* Delete an rt entry by index; shifts the rest down */
     38  1.1  mouse #define SRT_DELRT  _IOW('e',3,unsigned int)
     39  1.1  mouse 
     40  1.1  mouse /* Set flag bits */
     41  1.1  mouse #define SRT_SFLAGS _IOW('e',4,unsigned int)
     42  1.1  mouse 
     43  1.1  mouse /* Get flag bits */
     44  1.1  mouse #define SRT_GFLAGS _IOR('e',5,unsigned int)
     45  1.1  mouse 
     46  1.1  mouse /* Atomically replace flag bits */
     47  1.1  mouse #define SRT_SGFLAGS _IOWR('e',6,unsigned int)
     48  1.1  mouse 
     49  1.1  mouse /* Do debugging tasks (not documented here - see the source) */
     50  1.1  mouse #define SRT_DEBUG _IOW('e',7,void *)
     51  1.1  mouse 
     52  1.1  mouse /* Flag bits for SRT_*FLAGS */
     53  1.1  mouse #define SSF_MTULOCK 0x00000001 /* don't auto-update MTU */
     54  1.1  mouse /* Some flags are global; some are per-unit. */
     55  1.1  mouse #define SSF_GLOBAL (0)
     56  1.1  mouse 
     57  1.1  mouse #endif
     58