aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo_server_network.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-05-31 22:52:41 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-05-31 23:42:48 +0200
commit9f6127f592c979582a4d2d34627e09cfcd439778 (patch)
tree6c4ffb1d9b37d06177f9f5f00236996e8f40549d /src/osmo_server_network.c
parent13619dd235969126d5129e5bf129d344ed2643e2 (diff)
osmo-pcap-server: Work on the generic VTY interface for the server
Work on being able to configure clients that are allowed to connect to the server.
Diffstat (limited to 'src/osmo_server_network.c')
-rw-r--r--src/osmo_server_network.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/osmo_server_network.c b/src/osmo_server_network.c
index 5523974..6562829 100644
--- a/src/osmo_server_network.c
+++ b/src/osmo_server_network.c
@@ -21,6 +21,38 @@
*/
#include <osmo-pcap/osmo_pcap_server.h>
+#include <osmo-pcap/common.h>
+
+#include <osmocom/core/talloc.h>
+
+#include <string.h>
+
+void osmo_pcap_server_delete(struct osmo_pcap_conn *conn)
+{
+ llist_del(&conn->entry);
+ talloc_free(conn);
+}
+
+
+struct osmo_pcap_conn *osmo_pcap_server_find(struct osmo_pcap_server *server,
+ const char *name)
+{
+ struct osmo_pcap_conn *conn;
+ llist_for_each_entry(conn, &server->conn, entry) {
+ if (strcmp(conn->name, name) == 0)
+ return conn;
+ }
+
+ conn = talloc_zero(server, struct osmo_pcap_conn);
+ if (!conn) {
+ LOGP(DSERVER, LOGL_ERROR,
+ "Failed to find the connection.\n");
+ return NULL;
+ }
+
+ llist_add_tail(&conn->entry, &server->conn);
+ return conn;
+}
int osmo_pcap_server_listen(struct osmo_pcap_server *server)
{