Harald Welte | bd44858 | 2016-12-23 23:41:14 +0100 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <stdint.h> |
| 4 | #include <osmocom/core/msgb.h> |
Harald Welte | ce2f396 | 2016-12-30 15:48:22 +0100 | [diff] [blame] | 5 | #include <osmocom/core/gsmtap_util.h> |
Harald Welte | bd44858 | 2016-12-23 23:41:14 +0100 | [diff] [blame] | 6 | |
Harald Welte | efb3eca | 2017-01-01 11:41:02 +0100 | [diff] [blame] | 7 | #define DIAG_INST_F_HEXDUMP 0x00000001 |
| 8 | |
Harald Welte | bd44858 | 2016-12-23 23:41:14 +0100 | [diff] [blame] | 9 | struct diag_instance { |
| 10 | int fd; |
| 11 | struct { |
| 12 | struct msgb *msg; |
Harald Welte | bd44858 | 2016-12-23 23:41:14 +0100 | [diff] [blame] | 13 | } rx; |
| 14 | struct { |
| 15 | } tx; |
Harald Welte | ce2f396 | 2016-12-30 15:48:22 +0100 | [diff] [blame] | 16 | struct gsmtap_inst *gsmtap; |
Harald Welte | efb3eca | 2017-01-01 11:41:02 +0100 | [diff] [blame] | 17 | uint32_t flags; |
Harald Welte | bd44858 | 2016-12-23 23:41:14 +0100 | [diff] [blame] | 18 | }; |
| 19 | |
Harald Welte | dc2cafc | 2017-01-01 11:15:35 +0100 | [diff] [blame] | 20 | struct msgb *msgb_alloc_diag(void); |
Harald Welte | bd44858 | 2016-12-23 23:41:14 +0100 | [diff] [blame] | 21 | int diag_transmit_msgb(struct diag_instance *di, struct msgb *msg); |
| 22 | int diag_transmit_buf(struct diag_instance *di, const uint8_t *data, size_t data_len); |
Harald Welte | dc2cafc | 2017-01-01 11:15:35 +0100 | [diff] [blame] | 23 | struct msgb *diag_read_msg(struct diag_instance *di); |
| 24 | int diag_process_msg(struct diag_instance *di, struct msgb *msg); |
| 25 | struct msgb *diag_transceive_msg(struct diag_instance *di, struct msgb *tx); |
| 26 | void diag_transceive_msg_ign(struct diag_instance *di, struct msgb *tx); |
| 27 | struct msgb *diag_transceive_buf(struct diag_instance *di, const uint8_t *data, size_t data_len); |
| 28 | void diag_transceive_buf_ign(struct diag_instance *di, const uint8_t *data, size_t data_len); |