EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
iptables.h
Go to the documentation of this file.
1 
11 #ifndef IPTABLES_H_
12 #define IPTABLES_H_
13 
14 #include <stdbool.h>
15 #include <inttypes.h>
16 #include <utarray.h>
17 
18 #include "allocs.h"
19 #include "os.h"
20 
27  UT_array *rule_list;
29 };
30 
40 struct iptables_context *iptables_init(const char *path, UT_array *ifinfo_array,
41  bool exec_iptables);
42 
48 void iptables_free(struct iptables_context *ctx);
49 
60 int iptables_add_bridge(struct iptables_context *ctx, char *sip, char *sif,
61  char *dip, char *dif);
62 
73 int iptables_delete_bridge(struct iptables_context *ctx, const char *sip,
74  const char *sif, const char *dip, const char *dif);
75 
85 int iptables_add_nat(struct iptables_context *ctx, char *sip, char *sif,
86  char *nif);
87 
97 int iptables_delete_nat(struct iptables_context *ctx, char *sip, char *sif,
98  char *nif);
99 
100 #endif
File containing the definition of the allocs functionalities.
struct iptables_context * iptables_init(const char *path, UT_array *ifinfo_array, bool exec_iptables)
Initialises the iptables rules list.
Definition: iptables.c:246
int iptables_add_bridge(struct iptables_context *ctx, char *sip, char *sif, char *dip, char *dif)
Add a bridge rule to the list of rules.
Definition: iptables.c:424
int iptables_delete_bridge(struct iptables_context *ctx, const char *sip, const char *sif, const char *dip, const char *dif)
Delete a bridge rule.
Definition: iptables.c:348
int iptables_delete_nat(struct iptables_context *ctx, char *sip, char *sif, char *nif)
Delete a NAT rule.
Definition: iptables.c:448
int iptables_add_nat(struct iptables_context *ctx, char *sip, char *sif, char *nif)
Add a NAT rule.
Definition: iptables.c:488
void iptables_free(struct iptables_context *ctx)
Free the iptables context.
Definition: iptables.c:239
File containing the definition of the os functionalities.
#define MAX_OS_PATH_LEN
Definition: os.h:29
iptables context structure definition
Definition: iptables.h:25
char iptables_path[MAX_OS_PATH_LEN]
Definition: iptables.h:26
UT_array * rule_list
Definition: iptables.h:27
bool exec_iptables
Definition: iptables.h:28