aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/osmo-pcap/osmo_pcap_client.h47
-rw-r--r--include/osmo-pcap/osmo_tls.h4
2 files changed, 29 insertions, 22 deletions
diff --git a/include/osmo-pcap/osmo_pcap_client.h b/include/osmo-pcap/osmo_pcap_client.h
index b8ceb38..af94086 100644
--- a/include/osmo-pcap/osmo_pcap_client.h
+++ b/include/osmo-pcap/osmo_pcap_client.h
@@ -45,22 +45,7 @@ enum {
CLIENT_CTR_P_IFDROP,
};
-struct osmo_pcap_client {
- char *device;
- pcap_t *handle;
- char errbuf[PCAP_ERRBUF_SIZE];
-
- u_int last_ps_recv;
- u_int last_ps_drop;
- u_int last_ps_ifdrop;
- struct osmo_timer_list pcap_stat_timer;
-
- struct bpf_program bpf;
- char *filter_string;
- int filter_itself;
- int gprs_filtering;
- struct osmo_fd fd;
-
+struct osmo_pcap_client_conn {
char *srv_ip;
int srv_port;
struct osmo_wqueue wqueue;
@@ -80,6 +65,28 @@ struct osmo_pcap_client {
struct osmo_tls_session tls_session;
+ /* back pointer */
+ struct osmo_pcap_client *client;
+};
+
+struct osmo_pcap_client {
+ char *device;
+ pcap_t *handle;
+ char errbuf[PCAP_ERRBUF_SIZE];
+
+ u_int last_ps_recv;
+ u_int last_ps_drop;
+ u_int last_ps_ifdrop;
+ struct osmo_timer_list pcap_stat_timer;
+
+ struct bpf_program bpf;
+ char *filter_string;
+ int filter_itself;
+ int gprs_filtering;
+ struct osmo_fd fd;
+
+ struct osmo_pcap_client_conn conn;
+
/* statistics */
struct rate_ctr_group *ctrg;
};
@@ -91,9 +98,9 @@ int vty_client_init(struct osmo_pcap_client *);
int osmo_client_capture(struct osmo_pcap_client *client, const char *device);
int osmo_client_filter(struct osmo_pcap_client *client, const char *filter);
-void osmo_client_send_data(struct osmo_pcap_client *client,
+void osmo_client_send_data(struct osmo_pcap_client_conn *client,
struct pcap_pkthdr *hdr, const uint8_t *data);
-void osmo_client_send_link(struct osmo_pcap_client *client);
-void osmo_client_connect(struct osmo_pcap_client *);
+void osmo_client_send_link(struct osmo_pcap_client_conn *client);
+void osmo_client_connect(struct osmo_pcap_client_conn *);
-void osmo_client_reconnect(struct osmo_pcap_client *);
+void osmo_client_reconnect(struct osmo_pcap_client_conn *);
diff --git a/include/osmo-pcap/osmo_tls.h b/include/osmo-pcap/osmo_tls.h
index 0637739..1b15168 100644
--- a/include/osmo-pcap/osmo_tls.h
+++ b/include/osmo-pcap/osmo_tls.h
@@ -28,7 +28,7 @@
struct osmo_fd;
struct osmo_wqueue;
-struct osmo_pcap_client;
+struct osmo_pcap_client_conn;
struct osmo_pcap_conn;
struct osmo_pcap_server;
@@ -65,7 +65,7 @@ struct osmo_tls_session {
void osmo_tls_init(void);
-bool osmo_tls_init_client_session(struct osmo_pcap_client *client);
+bool osmo_tls_init_client_session(struct osmo_pcap_client_conn *conn);
bool osmo_tls_init_server_session(struct osmo_pcap_conn *conn, struct osmo_pcap_server *server);