The Netsukuku Project  0.0.9
An Alternative routing method
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
mark.h File Reference
#include <linux/version.h>
#include "libiptc/libiptc.h"
#include <linux/netfilter/nf_conntrack_common.h>
#include "libiptc/ipt_conntrack.h"
#include "libiptc/ipt_connmark.h"
#include "libiptc/ipt_CONNMARK.h"
Include dependency graph for mark.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rule_store
 

Macros

#define MANGLE_TABLE   "mangle"
 
#define FILTER_TABLE   "filter"
 
#define NTK_MARK_CHAIN   "ntk_mark_chain"
 
#define CHAIN_OUTPUT   "OUTPUT"
 
#define CHAIN_POSTROUTING   "POSTROUTING"
 
#define CHAIN_PREROUTING   "PREROUTING"
 
#define CHAIN_POSTROUTING   "POSTROUTING"
 
#define CHAIN_FORWARD   "FORWARD"
 
#define MOD_CONNTRACK   "conntrack"
 
#define MOD_CONNMARK   "CONNMARK"
 
#define MARK_TARGET   "MARK"
 
#define NTK_NET_STR   "10.0.0.0"
 
#define NTK_NET_MASK_STR   "255.0.0.0"
 
#define IPT_ENTRY_SZ   sizeof(struct ipt_entry)
 
#define IPT_ENTRY_MATCH_SZ   sizeof(struct ipt_entry_match)
 
#define IPT_ENTRY_TARGET_SZ   sizeof(struct ipt_entry_target)
 
#define IPT_CT_INFO_SZ   sizeof(struct ipt_conntrack_info)
 
#define IPT_CM_TARGET_INFO_SZ   sizeof(struct ipt_connmark_target_info)
 
#define MATCH_SZ   IPT_ENTRY_MATCH_SZ+IPT_CT_INFO_SZ
 
#define TARGET_SZ   IPT_ENTRY_TARGET_SZ+IPT_CM_TARGET_INFO_SZ
 
#define RESTORE_OUTPUT_RULE_SZ   IPT_ENTRY_SZ+MATCH_SZ+TARGET_SZ
 
#define OFFSET_MATCH   IPT_ENTRY_SZ
 
#define OFFSET_MATCH_INFO   OFFSET_MATCH+IPT_ENTRY_MATCH_SZ
 
#define OFFSET_TARGET   OFFSET_MATCH_INFO+IPT_CT_INFO_SZ
 
#define OFFSET_TARGET_INFO   OFFSET_TARGET+IPT_ENTRY_TARGET_SZ
 
#define MARK_RULE_SZ   IPT_ENTRY_SZ+TARGET_SZ
 
#define MAX_MARK_RULES   100
 
#define NTK_FORWARD_RULE_SZ   OFFSET_TARGET_INFO+4
 
#define IGW_FILTER_RULE_SZ   IPT_ENTRY_SZ+IPT_ENTRY_SZ+4
 
#define INET_MARK   25
 
#define MAX_RULE_SZ   RESTORE_OUTPUT_RULE_SZ
 

Typedefs

typedef struct rule_store rule_store
 

Functions

int table_init (const char *table, iptc_handle_t *t)
 
int insert_rule (const char *rule, iptc_handle_t *t, const char *chain, int pos)
 
int append_rule (const char *rule, iptc_handle_t *t, const char *chain)
 
int commit_rules (iptc_handle_t *t)
 
void restore_output_rule_init (char *rule)
 
void ntk_forward_rule_init (char *rule)
 
void mark_rule_init (char *rule, char *outiface, int outiface_num)
 
void igw_mark_rule_init (char *rule)
 
int ntk_mark_chain_init (iptc_handle_t *t)
 
int store_rules ()
 
int mark_init (int igw)
 
int count_ntk_mark_chain (iptc_handle_t *t)
 
int create_mark_rules (int n)
 
int delete_ntk_forward_chain (iptc_handle_t *t)
 
int delete_first_rule (iptc_handle_t *t, const char *chain)
 
int rule_position (rule_store *rule, iptc_handle_t *t)
 
int delete_rule (rule_store *rule, iptc_handle_t *t)
 
int mark_close ()
 

Macro Definition Documentation

#define CHAIN_FORWARD   "FORWARD"
#define CHAIN_OUTPUT   "OUTPUT"
#define CHAIN_POSTROUTING   "POSTROUTING"
#define CHAIN_POSTROUTING   "POSTROUTING"
#define CHAIN_PREROUTING   "PREROUTING"
#define FILTER_TABLE   "filter"
#define IGW_FILTER_RULE_SZ   IPT_ENTRY_SZ+IPT_ENTRY_SZ+4
#define INET_MARK   25
#define IPT_CM_TARGET_INFO_SZ   sizeof(struct ipt_connmark_target_info)
#define IPT_CT_INFO_SZ   sizeof(struct ipt_conntrack_info)
#define IPT_ENTRY_MATCH_SZ   sizeof(struct ipt_entry_match)
#define IPT_ENTRY_SZ   sizeof(struct ipt_entry)
#define IPT_ENTRY_TARGET_SZ   sizeof(struct ipt_entry_target)
#define MANGLE_TABLE   "mangle"
#define MARK_RULE_SZ   IPT_ENTRY_SZ+TARGET_SZ
#define MARK_TARGET   "MARK"
#define MATCH_SZ   IPT_ENTRY_MATCH_SZ+IPT_CT_INFO_SZ
#define MAX_MARK_RULES   100
#define MAX_RULE_SZ   RESTORE_OUTPUT_RULE_SZ
#define MOD_CONNMARK   "CONNMARK"
#define MOD_CONNTRACK   "conntrack"
#define NTK_FORWARD_RULE_SZ   OFFSET_TARGET_INFO+4
#define NTK_MARK_CHAIN   "ntk_mark_chain"
#define NTK_NET_MASK_STR   "255.0.0.0"
#define NTK_NET_STR   "10.0.0.0"
#define OFFSET_MATCH   IPT_ENTRY_SZ
#define OFFSET_MATCH_INFO   OFFSET_MATCH+IPT_ENTRY_MATCH_SZ
#define OFFSET_TARGET   OFFSET_MATCH_INFO+IPT_CT_INFO_SZ
#define OFFSET_TARGET_INFO   OFFSET_TARGET+IPT_ENTRY_TARGET_SZ
#define RESTORE_OUTPUT_RULE_SZ   IPT_ENTRY_SZ+MATCH_SZ+TARGET_SZ

Typedef Documentation

typedef struct rule_store rule_store

Function Documentation

int append_rule ( const char *  rule,
iptc_handle_t t,
const char *  chain 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int commit_rules ( iptc_handle_t t)

Here is the call graph for this function:

Here is the caller graph for this function:

int count_ntk_mark_chain ( iptc_handle_t t)

Here is the call graph for this function:

Here is the caller graph for this function:

int create_mark_rules ( int  n)

Here is the call graph for this function:

Here is the caller graph for this function:

int delete_first_rule ( iptc_handle_t t,
const char *  chain 
)

Here is the call graph for this function:

int delete_ntk_forward_chain ( iptc_handle_t t)

Here is the call graph for this function:

Here is the caller graph for this function:

int delete_rule ( rule_store rule,
iptc_handle_t t 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void igw_mark_rule_init ( char *  rule)

Here is the caller graph for this function:

int insert_rule ( const char *  rule,
iptc_handle_t t,
const char *  chain,
int  pos 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int mark_close ( )

Here is the call graph for this function:

Here is the caller graph for this function:

int mark_init ( int  igw)

Here is the call graph for this function:

Here is the caller graph for this function:

void mark_rule_init ( char *  rule,
char *  outiface,
int  outiface_num 
)

Here is the caller graph for this function:

void ntk_forward_rule_init ( char *  rule)

Here is the caller graph for this function:

int ntk_mark_chain_init ( iptc_handle_t t)

Here is the call graph for this function:

Here is the caller graph for this function:

void restore_output_rule_init ( char *  rule)

Here is the caller graph for this function:

int rule_position ( rule_store rule,
iptc_handle_t t 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int store_rules ( )

Here is the call graph for this function:

Here is the caller graph for this function:

int table_init ( const char *  table,
iptc_handle_t t 
)

Here is the call graph for this function:

Here is the caller graph for this function: