Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

policy-xml.c File Reference

Code for building policy from xml. More...

#include "policy-xml.h"
#include "policy-build.h"
#include "policy-dump.h"
#include "policy-snort.h"
#include "memory.h"
#include "plugin.h"
#include "naming.h"
#include <unistd.h>
#include <errno.h>

Go to the source code of this file.

Defines

#define DEBUG_POLICY_XML   0

Functions

BYTE* convertStringToBArray (char *arr)
int buildXmlSnort (xmlDocPtr doc, xmlNodePtr node, POLICY_HEAD* pol_hd, POLICY_OUTPUT* pol_o)
int buildXmlDefault (xmlDocPtr doc, xmlNodePtr node, POLICY_HEAD* pol_hd)
int buildXmlOutput (xmlDocPtr doc, xmlNodePtr node, POLICY_OUTPUT* pol_o)
int buildXmlDefine (xmlDocPtr doc, xmlNodePtr node)
int buildXmlProtocol (xmlDocPtr doc, xmlNodePtr node, POLICY_HEAD* pol_hd, POLICY_OUTPUT* pol_o)
int buildXmlAnalysis (xmlDocPtr doc, xmlNodePtr node, POLICY_OUTPUT* pol_o)
int buildXmlInstance (xmlDocPtr doc, xmlNodePtr node, POLICY_HEAD *pol_h, POLICY_OUTPUT* pol_o)
int buildXmlAnalysisResult (xmlDocPtr doc, xmlNodePtr node, POLICY_TEST* pol_t)
POLICY_HEAD* buildXmlPolicy (char *mem, unsigned long sz)
POLICY_HEAD* buildXmlPolicyFromFile (char *filename)
 Load a policy XML file into memory then call buildXmlPolicy. More...

int buildXmlInit (xmlDocPtr doc, xmlNodePtr node, POLICY_HEAD* pol_hd)
int buildXmlInput (xmlDocPtr doc, xmlNodePtr node, POLICY_HEAD* pol_hd)

Variables

DEFINE_LL* defs


Detailed Description

Code for building policy from xml.

The code is to handle an entire XML document either from file or in memory, parse it and create a rubicon policy from it.

Definition in file policy-xml.c.


Define Documentation

#define DEBUG_POLICY_XML   0
 

Definition at line 25 of file policy-xml.c.


Function Documentation

int buildXmlAnalysis ( xmlDocPtr doc,
xmlNodePtr node,
POLICY_OUTPUT * pol_o )
 

Parameters:
doc   (xmlDocPtr) Pointer to XML document
node   (xmlNodePtr) Pointer to current xml node
pol_o   (POLICY_OUTPUT*) The output to append to

Definition at line 507 of file policy-xml.c.

int buildXmlAnalysisResult ( xmlDocPtr doc,
xmlNodePtr node,
POLICY_TEST * pol_t )
 

Parameters:
doc   (xmlDocPtr) Pointer to XML document
node   (xmlNodePtr) Pointer to current xml node
pol_t   (POLICY_TEST*) The analysis type test to respond to

Definition at line 619 of file policy-xml.c.

int buildXmlDefault ( xmlDocPtr doc,
xmlNodePtr node,
POLICY_HEAD * pol_hd )
 

Parameters:
doc   (xmlDocPtr) Pointer to XML document
node   (xmlNodePtr) Pointer to current xml node
pol_hd   (POLICY_HEAD*) The policy to add to

Definition at line 194 of file policy-xml.c.

int buildXmlDefine ( xmlDocPtr doc,
xmlNodePtr node )
 

Parameters:
doc   (xmlDocPtr) Pointer to XML document
node   (xmlNodePtr) Pointer to current xml node

Definition at line 276 of file policy-xml.c.

int buildXmlInit ( xmlDocPtr doc,
xmlNodePtr node,
POLICY_HEAD * pol_hd )
 

Parameters:
doc   (xmlDocPtr) Pointer to XML document
node   (xmlNodePtr) Pointer to current xml node
pol_hd   (POLICY_HEAD*) Policy to set inits for

Definition at line 861 of file policy-xml.c.

int buildXmlInput ( xmlDocPtr doc,
xmlNodePtr node,
POLICY_HEAD * pol_hd )
 

Parameters:
doc   (xmlDocPtr) Pointer to XML document
node   (xmlNodePtr) Pointer to current xml node
pol_hd   (POLICY_HEAD*) Policy to set input for

Definition at line 889 of file policy-xml.c.

int buildXmlInstance ( xmlDocPtr doc,
xmlNodePtr node,
POLICY_HEAD * pol_h,
POLICY_OUTPUT * pol_o )
 

Parameters:
doc   (xmlDocPtr) Pointer to XML document
node   (xmlNodePtr) Pointer to current xml node
pol_h   (POLICY_HEAD*) Pointer to head of policy
pol_o   (POLICY_OUTPUT*) The output to append to

Definition at line 557 of file policy-xml.c.

int buildXmlOutput ( xmlDocPtr doc,
xmlNodePtr node,
POLICY_OUTPUT * pol_o )
 

Parameters:
doc   (xmlDocPtr) Pointer to XML document
node   (xmlNodePtr) Pointer to current xml node
pol_o   (POLICY_OUTPUT*) The output to append to

Definition at line 235 of file policy-xml.c.

POLICY_HEAD * buildXmlPolicy ( char * mem,
unsigned long )
 

Parameters:
mem   (char*) Pointer to the memory holding the policy
sz   (unsigned long) Size of mem

Definition at line 678 of file policy-xml.c.

POLICY_HEAD * buildXmlPolicyFromFile ( char * filename )
 

Load a policy XML file into memory then call buildXmlPolicy.

Parameters:
filename   (char*) Name of file to load and parse

Definition at line 780 of file policy-xml.c.

int buildXmlProtocol ( xmlDocPtr doc,
xmlNodePtr node,
POLICY_HEAD * pol_hd,
POLICY_OUTPUT * pol_o )
 

Parameters:
doc   (xmlDocPtr) Pointer to XML document
node   (xmlNodePtr) Pointer to current xml node
pol_hd   (POLICY_HEAD*) The policy head
pol_o   (POLICY_OUTPUT*) The output to append to

Definition at line 322 of file policy-xml.c.

int buildXmlSnort ( xmlDocPtr doc,
xmlNodePtr node,
POLICY_HEAD * pol_hd,
POLICY_OUTPUT * pol_o )
 

Parameters:
doc   (xmlDocPtr) Pointer to XML document
node   (xmlNodePtr) Pointer to current xml node
pol_hd   (POLICY_HEAD*) The policy to add to
pol_o   (POLICY_OUTPUT*) The output to append to

Definition at line 106 of file policy-xml.c.

BYTE * convertStringToBArray ( char * arr )
 

Parameters:
arr   (char*) String of hex to convert into array
Returns:
Pointer to malloc'ed byte array

Definition at line 37 of file policy-xml.c.

Referenced by buildXmlProtocol().


Variable Documentation

DEFINE_LL * defs
 

Definition at line 29 of file policy-xml.c.


Generated at Mon Jul 8 15:16:50 2002 for RUBICON by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000