Print this page
2976 remove useless offsetof() macros


 655 #define fr_srcptr       fr_mip.fi_srcptr
 656 #define fr_dstfunc      fr_mip.fi_dstfunc
 657 #define fr_srcfunc      fr_mip.fi_srcfunc
 658 #define fr_optbits      fr_ip.fi_optmsk
 659 #define fr_optmask      fr_mip.fi_optmsk
 660 #define fr_secbits      fr_ip.fi_secmsk
 661 #define fr_secmask      fr_mip.fi_secmsk
 662 #define fr_authbits     fr_ip.fi_auth
 663 #define fr_authmask     fr_mip.fi_auth
 664 #define fr_flx          fr_ip.fi_flx
 665 #define fr_mflx         fr_mip.fi_flx
 666 #define fr_ifname       fr_ifnames[0]
 667 #define fr_oifname      fr_ifnames[2]
 668 #define fr_ifa          fr_ifas[0]
 669 #define fr_oifa         fr_ifas[2]
 670 #define fr_tif          fr_tifs[0]
 671 #define fr_rif          fr_tifs[1]
 672 
 673 #define FR_NOLOGTAG     0
 674 
 675 #ifndef offsetof
 676 #define offsetof(t,m)   (size_t)((&((t *)0)->m))
 677 #endif
 678 #define FR_CMPSIZ       (sizeof(struct frentry) - \
 679                          offsetof(struct frentry, fr_func))
 680 
 681 /*
 682  * fr_type
 683  */
 684 #define FR_T_NONE       0
 685 #define FR_T_IPF        1       /* IPF structures */
 686 #define FR_T_BPFOPC     2       /* BPF opcode */
 687 #define FR_T_CALLFUNC   3       /* callout to function in fr_func only */
 688 #define FR_T_COMPIPF    4       /* compiled C code */
 689 #define FR_T_BUILTIN    0x80000000      /* rule is in kernel space */
 690 
 691 /*
 692  * fr_flags
 693  */
 694 #define FR_CALL         0x00000 /* call rule */
 695 #define FR_BLOCK        0x00001 /* do not allow packet to pass */
 696 #define FR_PASS         0x00002 /* allow packet to pass */
 697 #define FR_AUTH         0x00003 /* use authentication */




 655 #define fr_srcptr       fr_mip.fi_srcptr
 656 #define fr_dstfunc      fr_mip.fi_dstfunc
 657 #define fr_srcfunc      fr_mip.fi_srcfunc
 658 #define fr_optbits      fr_ip.fi_optmsk
 659 #define fr_optmask      fr_mip.fi_optmsk
 660 #define fr_secbits      fr_ip.fi_secmsk
 661 #define fr_secmask      fr_mip.fi_secmsk
 662 #define fr_authbits     fr_ip.fi_auth
 663 #define fr_authmask     fr_mip.fi_auth
 664 #define fr_flx          fr_ip.fi_flx
 665 #define fr_mflx         fr_mip.fi_flx
 666 #define fr_ifname       fr_ifnames[0]
 667 #define fr_oifname      fr_ifnames[2]
 668 #define fr_ifa          fr_ifas[0]
 669 #define fr_oifa         fr_ifas[2]
 670 #define fr_tif          fr_tifs[0]
 671 #define fr_rif          fr_tifs[1]
 672 
 673 #define FR_NOLOGTAG     0
 674 



 675 #define FR_CMPSIZ       (sizeof(struct frentry) - \
 676                          offsetof(struct frentry, fr_func))
 677 
 678 /*
 679  * fr_type
 680  */
 681 #define FR_T_NONE       0
 682 #define FR_T_IPF        1       /* IPF structures */
 683 #define FR_T_BPFOPC     2       /* BPF opcode */
 684 #define FR_T_CALLFUNC   3       /* callout to function in fr_func only */
 685 #define FR_T_COMPIPF    4       /* compiled C code */
 686 #define FR_T_BUILTIN    0x80000000      /* rule is in kernel space */
 687 
 688 /*
 689  * fr_flags
 690  */
 691 #define FR_CALL         0x00000 /* call rule */
 692 #define FR_BLOCK        0x00001 /* do not allow packet to pass */
 693 #define FR_PASS         0x00002 /* allow packet to pass */
 694 #define FR_AUTH         0x00003 /* use authentication */