aboutsummaryrefslogtreecommitdiffstats
path: root/libglouglou/libggnet.h
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2013-06-05 18:14:30 +0200
committerLaurent Ghigonis <laurent@p1sec.com>2013-06-05 18:14:30 +0200
commit29193b6c4c13d885681c42a87632cf65fbf5b70d (patch)
tree82ec9be903a239eda1f73a1d5b6fef31b6702c07 /libglouglou/libggnet.h
parentgg_map: fix dependencies description (diff)
downloadglouglou-29193b6c4c13d885681c42a87632cf65fbf5b70d.tar.xz
glouglou-29193b6c4c13d885681c42a87632cf65fbf5b70d.zip
convert to tabs, and fix some indent manualy
no functionnal change
Diffstat (limited to 'libglouglou/libggnet.h')
-rw-r--r--libglouglou/libggnet.h132
1 files changed, 68 insertions, 64 deletions
diff --git a/libglouglou/libggnet.h b/libglouglou/libggnet.h
index 1b17a32..3caea7c 100644
--- a/libglouglou/libggnet.h
+++ b/libglouglou/libggnet.h
@@ -23,10 +23,10 @@
#define GGNET_GROUPING_FALSE 1
enum ggnet_grouptype {
- GROUP_ADDRESS,
- GROUP_WHOIS,
- GROUP_DNS,
- GROUP_ROUTE
+ GROUP_ADDRESS,
+ GROUP_WHOIS,
+ GROUP_DNS,
+ GROUP_ROUTE
};
struct ggnet_nodegroup {
@@ -34,11 +34,11 @@ struct ggnet_nodegroup {
struct ggnet_nodegroup *parent;
enum ggnet_grouptype type;
struct in_addr addr;
- char name[GGNET_DNSNAME_MAX];
- int node_count;
- int conn_count;
- int child_groups_count;
- void *usrdata;
+ char name[GGNET_DNSNAME_MAX];
+ int node_count;
+ int conn_count;
+ int child_groups_count;
+ void *usrdata;
};
struct ggnet_node {
@@ -61,72 +61,76 @@ enum ggnet_connstate {
struct ggnet_conn {
LIST_ENTRY(ggnet_conn) entry;
- u_int id;
+ u_int id;
enum ggnet_connstate state;
- struct ggnet_node *src;
- u_int src_port;
- struct ggnet_node *dst;
- u_int dst_port;
- u_int proto;
- u_int size;
- u_int size_response;
- time_t lastseen;
- void *usrdata;
+ struct ggnet_node *src;
+ u_int src_port;
+ struct ggnet_node *dst;
+ u_int dst_port;
+ u_int proto;
+ u_int size;
+ u_int size_response;
+ time_t lastseen;
+ void *usrdata;
};
struct ggnet {
LIST_HEAD(, ggnet_conn) conn_list;
LIST_HEAD(, ggnet_node) node_list;
LIST_HEAD(, ggnet_nodegroup) group_list;
- int conn_count;
- int node_count;
- u_int16_t conn_freeids[GGNET_CONN_FREEIDS_COUNT];
- int conn_freeids_ptr;
- int manage_connid;
- time_t time;
- int debug;
+ int conn_count;
+ int node_count;
+ u_int16_t conn_freeids[GGNET_CONN_FREEIDS_COUNT];
+ int conn_freeids_ptr;
+ int manage_connid;
+ time_t time;
+ int debug;
/* grouping */
- int use_grouping;
- void (*cb_addgroup)(struct ggnet *, struct ggnet_nodegroup *, struct ggnet_nodegroup *);
- void (*cb_delgroup)(struct ggnet *, struct ggnet_nodegroup *);
- /* dns */
- int use_dns;
+ int use_grouping;
+ void (*cb_addgroup)(struct ggnet *, struct ggnet_nodegroup *, struct ggnet_nodegroup *);
+ void (*cb_delgroup)(struct ggnet *, struct ggnet_nodegroup *);
+ /* dns */
+ int use_dns;
struct ggnet_dns *ggdns;
- void (*cb_nodename)(struct ggnet *, struct ggnet_node *);
+ void (*cb_nodename)(struct ggnet *, struct ggnet_node *);
};
-struct ggnet *ggnet_new(int);
-void ggnet_set_grouping(struct ggnet *, int,
- void (*cb_addgroup)(struct ggnet *, struct ggnet_nodegroup *, struct ggnet_nodegroup *),
- void (*cb_delgroup)(struct ggnet *, struct ggnet_nodegroup *));
-void ggnet_set_dns(struct ggnet *net, int set,
- struct event_base *ev_base,
- void (*cb_nodename)(struct ggnet *, struct ggnet_node *));
-void ggnet_debug_set(struct ggnet *, int);
-void ggnet_free(struct ggnet *);
-struct ggnet_node *ggnet_node_add(struct ggnet *, struct in_addr *);
-void ggnet_node_del(struct ggnet *, struct ggnet_node *);
-struct ggnet_node *ggnet_node_find(struct ggnet *, struct in_addr *);
-void *ggnet_node_usrdata_get(struct ggnet_node *);
-void ggnet_node_usrdata_set(struct ggnet_node *, void *);
+struct ggnet *ggnet_new(int);
+void ggnet_set_grouping(struct ggnet *, int,
+ void (*cb_addgroup)(struct ggnet *,
+ struct ggnet_nodegroup *,
+ struct ggnet_nodegroup *),
+ void (*cb_delgroup)(struct ggnet *,
+ struct ggnet_nodegroup *));
+void ggnet_set_dns(struct ggnet *net, int set,
+ struct event_base *ev_base,
+ void (*cb_nodename)(struct ggnet *,
+ struct ggnet_node *));
+void ggnet_debug_set(struct ggnet *, int);
+void ggnet_free(struct ggnet *);
+struct ggnet_node *ggnet_node_add(struct ggnet *, struct in_addr *);
+void ggnet_node_del(struct ggnet *, struct ggnet_node *);
+struct ggnet_node *ggnet_node_find(struct ggnet *, struct in_addr *);
+void *ggnet_node_usrdata_get(struct ggnet_node *);
+void ggnet_node_usrdata_set(struct ggnet_node *, void *);
struct ggnet_nodegroup *ggnet_node_group_get(struct ggnet_node *);
-struct ggnet_conn *ggnet_conn_add(struct ggnet *, struct in_addr *, int,
- struct in_addr *, int, int, int, int);
-void ggnet_conn_data(struct ggnet *, struct ggnet_conn *,
- int, int);
-void ggnet_conn_del(struct ggnet *, struct ggnet_conn *);
-struct ggnet_conn *ggnet_conn_find(struct ggnet *, struct in_addr *, int,
- struct in_addr *, int, int, int *);
-struct ggnet_conn *ggnet_conn_find_by_id(struct ggnet *, int);
-struct ggnet_conn *ggnet_conn_find_by_node(struct ggnet *, struct ggnet_node *,
- struct ggnet_node *);
-void *ggnet_conn_usrdata_get(struct ggnet_conn *);
-void ggnet_conn_usrdata_set(struct ggnet_conn *, void *);
-void *ggnet_conn_src_get(struct ggnet_conn *);
-void *ggnet_conn_dst_get(struct ggnet_conn *);
-void *ggnet_nodegroup_usrdata_get(struct ggnet_nodegroup *);
-void ggnet_nodegroup_usrdata_set(struct ggnet_nodegroup *,
- void *);
-void ggnet_time_update(struct ggnet *, time_t);
+struct ggnet_conn *ggnet_conn_add(struct ggnet *, struct in_addr *, int,
+ struct in_addr *, int, int, int, int);
+void ggnet_conn_data(struct ggnet *, struct ggnet_conn *,
+ int, int);
+void ggnet_conn_del(struct ggnet *, struct ggnet_conn *);
+struct ggnet_conn *ggnet_conn_find(struct ggnet *, struct in_addr *, int,
+ struct in_addr *, int, int, int *);
+struct ggnet_conn *ggnet_conn_find_by_id(struct ggnet *, int);
+struct ggnet_conn *ggnet_conn_find_by_node(struct ggnet *,
+ struct ggnet_node *, struct ggnet_node *);
+void *ggnet_conn_usrdata_get(struct ggnet_conn *);
+void ggnet_conn_usrdata_set(struct ggnet_conn *, void *);
+void *ggnet_conn_src_get(struct ggnet_conn *);
+void *ggnet_conn_dst_get(struct ggnet_conn *);
+void *ggnet_nodegroup_usrdata_get(struct ggnet_nodegroup *);
+void ggnet_nodegroup_usrdata_set(struct ggnet_nodegroup *,
+ void *);
+void ggnet_time_update(struct ggnet *, time_t);
#endif /* _LIBGGNET_H_ */