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