Print this page
3168 pfmod commands could be more useful


   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 #ifndef _SYS_PFMOD_H
  27 #define _SYS_PFMOD_H
  28 
  29 #pragma ident   "%Z%%M% %I%     %E% SMI"
  30 
  31 #ifdef  __cplusplus
  32 extern "C" {
  33 #endif
  34 
  35 /*
  36  * Ioctls.
  37  */
  38 #define PFIOC           ('P' << 8)
  39 #define PFIOCSETF       (PFIOC|1)       /* replace current packet filter */
  40 
  41 #define ENMAXFILTERS    255             /* maximum filter short words */
  42 #define PF_MAXFILTERS   2047            /* max short words for newpacketfilt */
  43 
  44 /*
  45  * filter structure for SETF
  46  */
  47 struct packetfilt {
  48         uchar_t Pf_Priority;                    /* priority of filter */
  49         uchar_t Pf_FilterLen;                   /* length of filter cmd list */
  50         ushort_t Pf_Filter[ENMAXFILTERS];       /* filter command list */


  98 #define ENF_OR          (7 << ENF_NBPA)
  99 #define ENF_XOR         (8 << ENF_NBPA)
 100 #define ENF_COR         (9 << ENF_NBPA)
 101 #define ENF_CAND        (10 << ENF_NBPA)
 102 #define ENF_CNOR        (11 << ENF_NBPA)
 103 #define ENF_CNAND       (12 << ENF_NBPA)
 104 #define ENF_NEQ         (13 << ENF_NBPA)
 105 
 106 /* stack actions */
 107 #define ENF_NOPUSH      0
 108 #define ENF_PUSHLIT     1  /* Push the next word on the stack */
 109 #define ENF_PUSHZERO    2  /* Push 0 on the stack */
 110 #define ENF_PUSHONE     3  /* Push 1 on the stack */
 111 #define ENF_PUSHFFFF    4  /* Push 0xffff on the stack */
 112 #define ENF_PUSHFF00    5  /* Push 0xff00 on the stack */
 113 #define ENF_PUSH00FF    6  /* Push 0x00ff on the stack */
 114 #define ENF_LOAD_OFFSET 7  /* Load the next word into the offset register */
 115 #define ENF_BRTR        8  /* Branch if the stack's top element is true */
 116 #define ENF_BRFL        9  /* Branch if the stack's top element is false */
 117 #define ENF_POP         10 /* Pop the top element from the stack */


 118 #define ENF_PUSHWORD    16
 119 
 120 #ifdef  __cplusplus
 121 }
 122 #endif
 123 
 124 #endif  /* _SYS_PFMOD_H */


   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 #ifndef _SYS_PFMOD_H
  27 #define _SYS_PFMOD_H
  28 


  29 #ifdef  __cplusplus
  30 extern "C" {
  31 #endif
  32 
  33 /*
  34  * Ioctls.
  35  */
  36 #define PFIOC           ('P' << 8)
  37 #define PFIOCSETF       (PFIOC|1)       /* replace current packet filter */
  38 
  39 #define ENMAXFILTERS    255             /* maximum filter short words */
  40 #define PF_MAXFILTERS   2047            /* max short words for newpacketfilt */
  41 
  42 /*
  43  * filter structure for SETF
  44  */
  45 struct packetfilt {
  46         uchar_t Pf_Priority;                    /* priority of filter */
  47         uchar_t Pf_FilterLen;                   /* length of filter cmd list */
  48         ushort_t Pf_Filter[ENMAXFILTERS];       /* filter command list */


  96 #define ENF_OR          (7 << ENF_NBPA)
  97 #define ENF_XOR         (8 << ENF_NBPA)
  98 #define ENF_COR         (9 << ENF_NBPA)
  99 #define ENF_CAND        (10 << ENF_NBPA)
 100 #define ENF_CNOR        (11 << ENF_NBPA)
 101 #define ENF_CNAND       (12 << ENF_NBPA)
 102 #define ENF_NEQ         (13 << ENF_NBPA)
 103 
 104 /* stack actions */
 105 #define ENF_NOPUSH      0
 106 #define ENF_PUSHLIT     1  /* Push the next word on the stack */
 107 #define ENF_PUSHZERO    2  /* Push 0 on the stack */
 108 #define ENF_PUSHONE     3  /* Push 1 on the stack */
 109 #define ENF_PUSHFFFF    4  /* Push 0xffff on the stack */
 110 #define ENF_PUSHFF00    5  /* Push 0xff00 on the stack */
 111 #define ENF_PUSH00FF    6  /* Push 0x00ff on the stack */
 112 #define ENF_LOAD_OFFSET 7  /* Load the next word into the offset register */
 113 #define ENF_BRTR        8  /* Branch if the stack's top element is true */
 114 #define ENF_BRFL        9  /* Branch if the stack's top element is false */
 115 #define ENF_POP         10 /* Pop the top element from the stack */
 116 #define ENF_PUSHFF00_N  11 /* Push 0xff00 in network byte order on the stack */
 117 #define ENF_PUSH00FF_N  12 /* Push 0x00ff in network byte order on the stack */
 118 #define ENF_PUSHWORD    16
 119 
 120 #ifdef  __cplusplus
 121 }
 122 #endif
 123 
 124 #endif  /* _SYS_PFMOD_H */