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