blob: 5e10a03980c82e46a767380a8085fe21f8e1dac5 [file] [log] [blame]
Alexander Huemer4376bcc2011-09-06 00:09:48 +02001#ifndef _CONTROL_IF_H
2#define _CONTROL_IF_H
3
4#include <osmocom/core/write_queue.h>
Harald Welte1238cc62014-08-20 19:50:04 +02005#include <osmocom/ctrl/control_cmd.h>
6
Harald Welte528134b2014-08-21 15:13:08 +02007int ctrl_parse_get_num(vector vline, int i, long *num);
8
9typedef int (*ctrl_cmd_lookup)(void *data, vector vline, int *node_type,
10 void **node_data, int *i);
Holger Hans Peter Freytherea62a382014-03-23 16:25:16 +010011
Daniel Willmann782974b2011-07-22 17:55:42 +020012struct ctrl_handle {
13 struct osmo_fd listen_fd;
Harald Weltec78e74e2014-08-21 14:34:32 +020014 void *data;
Daniel Willmann782974b2011-07-22 17:55:42 +020015
Harald Welte528134b2014-08-21 15:13:08 +020016 ctrl_cmd_lookup lookup;
Holger Hans Peter Freytherea62a382014-03-23 16:25:16 +010017
Daniel Willmann782974b2011-07-22 17:55:42 +020018 /* List of control connections */
19 struct llist_head ccon_list;
20};
21
Holger Hans Peter Freytherea62a382014-03-23 16:25:16 +010022
Alexander Huemer4376bcc2011-09-06 00:09:48 +020023int ctrl_cmd_send(struct osmo_wqueue *queue, struct ctrl_cmd *cmd);
Harald Weltec78e74e2014-08-21 14:34:32 +020024struct ctrl_handle *controlif_setup(void *data, uint16_t port,
Harald Welte528134b2014-08-21 15:13:08 +020025 ctrl_cmd_lookup lookup);
Holger Hans Peter Freytherea62a382014-03-23 16:25:16 +010026
Harald Welte528134b2014-08-21 15:13:08 +020027int ctrl_cmd_handle(struct ctrl_handle *ctrl, struct ctrl_cmd *cmd, void *data);
Alexander Huemer4376bcc2011-09-06 00:09:48 +020028
29#endif /* _CONTROL_IF_H */
30