Alexander Huemer | 4376bcc | 2011-09-06 00:09:48 +0200 | [diff] [blame] | 1 | #ifndef _CONTROL_IF_H |
| 2 | #define _CONTROL_IF_H |
| 3 | |
| 4 | #include <osmocom/core/write_queue.h> |
Harald Welte | 1238cc6 | 2014-08-20 19:50:04 +0200 | [diff] [blame] | 5 | #include <osmocom/ctrl/control_cmd.h> |
| 6 | |
Harald Welte | 528134b | 2014-08-21 15:13:08 +0200 | [diff] [blame] | 7 | int ctrl_parse_get_num(vector vline, int i, long *num); |
| 8 | |
| 9 | typedef int (*ctrl_cmd_lookup)(void *data, vector vline, int *node_type, |
| 10 | void **node_data, int *i); |
Holger Hans Peter Freyther | ea62a38 | 2014-03-23 16:25:16 +0100 | [diff] [blame] | 11 | |
Daniel Willmann | 782974b | 2011-07-22 17:55:42 +0200 | [diff] [blame] | 12 | struct ctrl_handle { |
| 13 | struct osmo_fd listen_fd; |
Harald Welte | c78e74e | 2014-08-21 14:34:32 +0200 | [diff] [blame] | 14 | void *data; |
Daniel Willmann | 782974b | 2011-07-22 17:55:42 +0200 | [diff] [blame] | 15 | |
Harald Welte | 528134b | 2014-08-21 15:13:08 +0200 | [diff] [blame] | 16 | ctrl_cmd_lookup lookup; |
Holger Hans Peter Freyther | ea62a38 | 2014-03-23 16:25:16 +0100 | [diff] [blame] | 17 | |
Daniel Willmann | 782974b | 2011-07-22 17:55:42 +0200 | [diff] [blame] | 18 | /* List of control connections */ |
| 19 | struct llist_head ccon_list; |
| 20 | }; |
| 21 | |
Holger Hans Peter Freyther | ea62a38 | 2014-03-23 16:25:16 +0100 | [diff] [blame] | 22 | |
Alexander Huemer | 4376bcc | 2011-09-06 00:09:48 +0200 | [diff] [blame] | 23 | int ctrl_cmd_send(struct osmo_wqueue *queue, struct ctrl_cmd *cmd); |
Harald Welte | ae2fcb2 | 2014-08-21 15:20:00 +0200 | [diff] [blame^] | 24 | struct ctrl_handle *ctrl_interface_setup(void *data, uint16_t port, |
| 25 | ctrl_cmd_lookup lookup); |
Holger Hans Peter Freyther | ea62a38 | 2014-03-23 16:25:16 +0100 | [diff] [blame] | 26 | |
Harald Welte | 528134b | 2014-08-21 15:13:08 +0200 | [diff] [blame] | 27 | int ctrl_cmd_handle(struct ctrl_handle *ctrl, struct ctrl_cmd *cmd, void *data); |
Alexander Huemer | 4376bcc | 2011-09-06 00:09:48 +0200 | [diff] [blame] | 28 | |
| 29 | #endif /* _CONTROL_IF_H */ |
| 30 | |