Skip to content

Commit

Permalink
add ct-zone filtering inat src host
Browse files Browse the repository at this point in the history
  • Loading branch information
mansish404 committed Sep 16, 2024
1 parent ba199c9 commit 4133437
Show file tree
Hide file tree
Showing 28 changed files with 5,734 additions and 113 deletions.
Empty file added Plugins
Empty file.
Empty file added VIM
Empty file.
Binary file added build/conntrack_migrator
Binary file not shown.
Binary file added build/gen/dbus_vmstate1.o
Binary file not shown.
Binary file added build/src/common.o
Binary file not shown.
Binary file added build/src/conntrack.o
Binary file not shown.
Binary file added build/src/conntrack_entry.o
Binary file not shown.
Binary file added build/src/conntrack_entry_print.o
Binary file not shown.
Binary file added build/src/conntrack_store.o
Binary file not shown.
Binary file added build/src/data_template.o
Binary file not shown.
Binary file added build/src/dbus_server.o
Binary file not shown.
Binary file added build/src/lmct_config.o
Binary file not shown.
Binary file added build/src/log.o
Binary file not shown.
Binary file added build/src/main.o
Binary file not shown.
Binary file added build/src/marshal.o
Binary file not shown.
Binary file added build/src/unmarshal.o
Binary file not shown.
3,415 changes: 3,415 additions & 0 deletions gen/dbus_vmstate1.c

Large diffs are not rendered by default.

544 changes: 544 additions & 0 deletions gen/dbus_vmstate1.h

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@
GHashTable *
create_hashtable_from_ip_list(const char *[], int);

GHashTable *
create_hashtable_from_ct_zones_list(const char *[], int);

#endif /* COMMON_H */
17 changes: 11 additions & 6 deletions include/conntrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,22 @@
* the conntrack events.
*/
struct ct_events_targs {
pthread_t tid; // thread ID
GHashTable *ips_to_migrate; // IPs for which CT events needs to be listened
bool *stop_flag; // Flag when True, stop listening for CT events
bool is_src; // Flag indicating whether the args are for src based events
pthread_t tid; // thread ID
GHashTable *ips_to_migrate; // IPs for which CT events needs to be
// listened
GHashTable *ct_zones_to_migrate; // CT Zones for which events needs to
// be listened
bool *stop_flag; // Flag when True, stop listening for
// CT events
bool is_src; // Flag indicating whether the args are
// for src based events
};

int
get_conntrack_dump(struct nfct_handle *, GHashTable *);
get_conntrack_dump(struct nfct_handle *, struct ct_events_targs *);

int
listen_for_conntrack_events(struct mnl_socket *, GHashTable *, bool, bool *);
listen_for_conntrack_events(struct mnl_socket *, struct ct_events_targs *);

void
append_ct_to_batch(char *, struct nf_conntrack *, uint32_t *, int);
Expand Down
9 changes: 9 additions & 0 deletions include/lmct_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@

#include "log.h"


enum filter_type {
FILTER_BY_CT_ZONE,
FILTER_BY_IP
};
/**
* Represents the config options which are used globally in the application.
*/
Expand All @@ -29,7 +34,11 @@ struct lmct_config {

extern struct lmct_config lmct_conf;

extern enum filter_type fltr_type;
void
init_lmct_config();

void
populate_filter_type(enum filter_type);

#endif /* LMCT_CONFIG_H */
Loading

0 comments on commit 4133437

Please sign in to comment.