blob: 8144f866df85db3aa8974c22dac2410e30faa777 [file] [log] [blame]
Harald Welte39cfbf42016-07-28 09:04:11 +02001#pragma once
2#include <stdint.h>
3
4enum osmo_e1cap_capture_mode {
5 OSMO_E1CAP_MODE_RAW,
6 OSMO_E1CAP_MODE_HDLC,
7 OSMO_E1CAP_MODE_TRAU,
8 OSMO_E1CAP_MODE_PGSL,
9};
10
11/* header for each frame we store */
12struct osmo_e1cap_pkthdr {
Harald Welteafb6d392016-10-17 18:50:19 +020013 /* Timestamp at which frame was received */
Harald Welte39cfbf42016-07-28 09:04:11 +020014 struct timeval ts;
Harald Welteafb6d392016-10-17 18:50:19 +020015 /* length of frame data after this header */
Harald Welte39cfbf42016-07-28 09:04:11 +020016 uint32_t len;
Harald Welteafb6d392016-10-17 18:50:19 +020017 /* line/span number on which frame was received */
Harald Welte39cfbf42016-07-28 09:04:11 +020018 uint8_t line_nr;
Harald Welteafb6d392016-10-17 18:50:19 +020019 /* timeslot number on which frame was received */
Harald Welte39cfbf42016-07-28 09:04:11 +020020 uint8_t ts_nr;
Harald Welteafb6d392016-10-17 18:50:19 +020021 /* see osmo_e1cap_capture_mode */
Harald Welte39cfbf42016-07-28 09:04:11 +020022 uint8_t capture_mode;
Harald Welteafb6d392016-10-17 18:50:19 +020023 /* any optional future flags */
Harald Welte39cfbf42016-07-28 09:04:11 +020024 uint8_t flags;
25} __attribute__((aligned));
26
27int e1frame_store(struct e1inp_ts *ts, struct msgb *msg, enum osmo_e1cap_capture_mode mode);