Home | History | Annotate | Download | only in linux
      1 #ifndef __LINUX_FIB_RULES_H
      2 #define __LINUX_FIB_RULES_H
      3 
      4 /* rule is permanent, and cannot be deleted */
      5 #define FIB_RULE_PERMANENT	0x00000001
      6 #define FIB_RULE_INVERT		0x00000002
      7 #define FIB_RULE_UNRESOLVED	0x00000004
      8 #define FIB_RULE_IIF_DETACHED	0x00000008
      9 #define FIB_RULE_DEV_DETACHED	FIB_RULE_IIF_DETACHED
     10 #define FIB_RULE_OIF_DETACHED	0x00000010
     11 
     12 /* try to find source address in routing lookups */
     13 #define FIB_RULE_FIND_SADDR	0x00010000
     14 
     15 struct fib_rule_hdr {
     16 	__u8		family;
     17 	__u8		dst_len;
     18 	__u8		src_len;
     19 	__u8		tos;
     20 
     21 	__u8		table;
     22 	__u8		res1;	/* reserved */
     23 	__u8		res2;	/* reserved */
     24 	__u8		action;
     25 
     26 	__u32		flags;
     27 };
     28 
     29 enum {
     30 	FRA_UNSPEC,
     31 	FRA_DST,	/* destination address */
     32 	FRA_SRC,	/* source address */
     33 	FRA_IIFNAME,	/* interface name */
     34 #define FRA_IFNAME	FRA_IIFNAME
     35 	FRA_GOTO,	/* target to jump to (FR_ACT_GOTO) */
     36 	FRA_UNUSED2,
     37 	FRA_PRIORITY,	/* priority/preference */
     38 	FRA_UNUSED3,
     39 	FRA_UNUSED4,
     40 	FRA_UNUSED5,
     41 	FRA_FWMARK,	/* mark */
     42 	FRA_FLOW,	/* flow/class id */
     43 	FRA_UNUSED6,
     44 	FRA_UNUSED7,
     45 	FRA_UNUSED8,
     46 	FRA_TABLE,	/* Extended table id */
     47 	FRA_FWMASK,	/* mask for netfilter mark */
     48 	FRA_OIFNAME,
     49 	__FRA_MAX
     50 };
     51 
     52 #define FRA_MAX (__FRA_MAX - 1)
     53 
     54 enum {
     55 	FR_ACT_UNSPEC,
     56 	FR_ACT_TO_TBL,		/* Pass to fixed table */
     57 	FR_ACT_GOTO,		/* Jump to another rule */
     58 	FR_ACT_NOP,		/* No operation */
     59 	FR_ACT_RES3,
     60 	FR_ACT_RES4,
     61 	FR_ACT_BLACKHOLE,	/* Drop without notification */
     62 	FR_ACT_UNREACHABLE,	/* Drop with ENETUNREACH */
     63 	FR_ACT_PROHIBIT,	/* Drop with EACCES */
     64 	__FR_ACT_MAX,
     65 };
     66 
     67 #define FR_ACT_MAX (__FR_ACT_MAX - 1)
     68 
     69 #endif
     70