Azinix

rlpL4.c File Reference

Routines for building a L4 check structure from a formula. More...

#include "rlp.h"

Go to the source code of this file.

Functions

Rlp_L4Check_tRlp_AllocL4CheckStruct ()
 Allocate an L4 check struct.
Rlp_L4Check_tRlp_CreateL4CheckFromRawFormula (char *rawFormula)
 Create an l4 check struct from a raw formula.
Rlp_Formula_tRlp_ComputeIpFormulaFromString (char *ipString)
 Parse a raw string representing a set of IP addresses into an Rlp_Formula_t.
u_int32_t Rlp_DotToInt (char *dotString)
 Convert a string in dotted decimal notation to an unsigned 32 bit int.
Rlp_Formula_tRlp_ComputePortFormulaFromString (char *portString)
 Parse a raw string representing a set of ports into an Rlp_Formula_t.


Detailed Description

Routines for building a L4 check structure from a formula.

Definition in file rlpL4.c.


Function Documentation

Rlp_L4Check_t* Rlp_AllocL4CheckStruct (  ) 

Allocate an L4 check struct.

Initialize entries to NIL, which indicates an any in that field

Definition at line 33 of file rlpL4.c.

Rlp_Formula_t* Rlp_ComputeIpFormulaFromString ( char *  ipString  ) 

Parse a raw string representing a set of IP addresses into an Rlp_Formula_t.

Parse a raw string representing a set of IP addresses into an Rlp_Formula_t. String is suppoed to be from the following grammar:

  !(foo) | !foo | foo,bar | IP/mask | IP |  DEFINE
  

Note: we should not have whitespace anywhere.

There is exactly one string in the ruleset that looks like [232.0.0.0/8,233.0.0.0/8,239.0.0.0/8]. For now, we're going to treat it by simply removing the leading and trailing brackets using the clearBrackets function call.

Definition at line 216 of file rlpL4.c.

Rlp_Formula_t* Rlp_ComputePortFormulaFromString ( char *  portString  ) 

Parse a raw string representing a set of ports into an Rlp_Formula_t.

Parse a raw string representing a set of ports into an Rlp_Formula_t. String is supposed to be from the following grammar:

  !foo | 10:100  | 10: | :100 | DEFINE
  

Note: we should not have whitespace anywhere.

Definition at line 458 of file rlpL4.c.

Rlp_L4Check_t* Rlp_CreateL4CheckFromRawFormula ( char *  rawFormula  ) 

Create an l4 check struct from a raw formula.

Definition at line 52 of file rlpL4.c.

u_int32_t Rlp_DotToInt ( char *  dotString  ) 

Convert a string in dotted decimal notation to an unsigned 32 bit int.

Definition at line 414 of file rlpL4.c.