From 530ecc0879572a7281655693a53cc17b6920b118 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 31 May 2011 15:47:44 +0200 Subject: osmo_pcap_client: Start with the framework for the pcap client This is just the normal skeleton for the osmocom code. --- include/osmo-pcap/Makefile.am | 2 +- include/osmo-pcap/common.h | 50 ++++++++++++++++++++++++++++++++++++ include/osmo-pcap/osmo_pcap_client.h | 34 ++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 include/osmo-pcap/common.h create mode 100644 include/osmo-pcap/osmo_pcap_client.h (limited to 'include') diff --git a/include/osmo-pcap/Makefile.am b/include/osmo-pcap/Makefile.am index c3a402d..491f50e 100644 --- a/include/osmo-pcap/Makefile.am +++ b/include/osmo-pcap/Makefile.am @@ -1 +1 @@ -noinst_HEADERS = +noinst_HEADERS = common.h diff --git a/include/osmo-pcap/common.h b/include/osmo-pcap/common.h new file mode 100644 index 0000000..9275f0a --- /dev/null +++ b/include/osmo-pcap/common.h @@ -0,0 +1,50 @@ +/* + * osmo-pcap common + * + * (C) 2011 by Holger Hans Peter Freyther + * (C) 2011 by On-Waves + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#ifndef OSMO_PCAP_COMMON_H +#define OSMO_PCAP_COMMON_H + +#include + +#include +#include +#include + +enum { + DPCAP, + DCLIENT, + DSERVER, + DVTY, + Debug_LastEntry, +}; + +enum { + CLIENT_NODE = _LAST_OSMOVTY_NODE + 1, + SERVER_NODE, +}; + +extern const struct log_info log_info; +extern const char *osmopcap_copyright; +extern enum node_type osmopcap_go_parent(struct vty *vty); +extern int osmopcap_is_config_node(struct vty *vty, int node); + +#endif diff --git a/include/osmo-pcap/osmo_pcap_client.h b/include/osmo-pcap/osmo_pcap_client.h new file mode 100644 index 0000000..8dc2ee8 --- /dev/null +++ b/include/osmo-pcap/osmo_pcap_client.h @@ -0,0 +1,34 @@ +/* + * osmo-pcap-client code + * + * (C) 2011 by Holger Hans Peter Freyther + * (C) 2011 by On-Waves + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include + + +struct osmo_pcap_client { + char *device; + pcap_t *handle; + + struct bpf_program *bpf; + char *filter_string; +}; + +int vty_client_init(); -- cgit v1.2.3