summaryrefslogtreecommitdiffstats
path: root/include/osmocom/ctrl/control_if.h
blob: 9ab3b2a42d13be6e6cf036f6165848e697664793 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef _CONTROL_IF_H
#define _CONTROL_IF_H

#include <osmocom/core/write_queue.h>
#include <osmocom/ctrl/control_cmd.h>

/* FIXME: this must go */
struct gsm_network;

typedef int (*ctrl_cmd_handler)(struct ctrl_cmd *, void *);

struct ctrl_handle {
	struct osmo_fd listen_fd;
	struct gsm_network *gsmnet;

	ctrl_cmd_handler handler;

	/* List of control connections */
	struct llist_head ccon_list;
};


int ctrl_cmd_send(struct osmo_wqueue *queue, struct ctrl_cmd *cmd);
struct ctrl_handle *controlif_setup(struct gsm_network *, uint16_t port,
					ctrl_cmd_handler handler);
struct ctrl_handle *bsc_controlif_setup(struct gsm_network *gsmnet, uint16_t port);

int bsc_ctrl_cmd_handle(struct ctrl_cmd *cmd, void *data);

#endif /* _CONTROL_IF_H */