libosmo-e1d 0.7.1
Osmocom e1d client library
Loading...
Searching...
No Matches
proto.h File Reference

Specification of the IPC protocol used on the CTL UNIX domain socket between osmo-e1d and its client programs. More...

#include <stdint.h>
#include <osmocom/core/select.h>
#include <osmocom/core/utils.h>

Go to the source code of this file.

Data Structures

struct  osmo_e1dp_msg_hdr
 message header of osmo-e1d CTL protocol. More...
 
struct  osmo_e1dp_intf_info
 Information about an E1 interface. More...
 
struct  osmo_e1dp_line_config
 Configuration of an E1 line. More...
 
struct  osmo_e1dp_line_info
 Information about an E1 line. More...
 
struct  osmo_e1dp_ts_config
 Configuration of an E1 timeslot. More...
 
struct  osmo_e1dp_ts_info
 Information about an E1 timeslot. More...
 

Macros

#define E1DP_TS_OPEN_F_FORCE   0x80
 Flag that can be used as osmo_e1dp_ts_config.flags to force opening a TS.
 
#define E1DP_MAGIC   0x01e1
 Magic value.
 
#define E1DP_MAX_LEN   4096
 Maximum length of a protocol message.
 
#define E1DP_TS_SUPERCHAN   0xfe
 magic value used to indicate superchannel instead of timeslot.
 
#define E1DP_INVALID   0xff
 magic value to indicate given field (interface/line/timeslot) is unspecified/invalid.
 
#define E1DP_DEFAULT_SOCKET   "/tmp/osmo-e1d.ctl"
 default location of osmo-e1d CTL protocol UNIX domain socket
 
#define E1DP_MAX_SIZE_HDLC   264
 Maximum length of HDLC messages.
 

Enumerations

enum  osmo_e1dp_msg_type {
  E1DP_CMD_INTF_QUERY = 0x00 ,
  E1DP_CMD_LINE_QUERY = 0x01 ,
  E1DP_CMD_TS_QUERY = 0x02 ,
  E1DP_CMD_LINE_CONFIG = 0x03 ,
  E1DP_CMD_TS_OPEN = 0x04 ,
  E1DP_CMD_SABITS = 0x05 ,
  E1DP_EVT_LOS_ON = 0x40 ,
  E1DP_EVT_LOS_OFF = 0x41 ,
  E1DP_EVT_AIS_ON = 0x42 ,
  E1DP_EVT_AIS_OFF = 0x43 ,
  E1DP_EVT_RAI_ON = 0x44 ,
  E1DP_EVT_RAI_OFF = 0x45 ,
  E1DP_EVT_LOF_ON = 0x46 ,
  E1DP_EVT_LOF_OFF = 0x47 ,
  E1DP_EVT_SABITS = 0x7f ,
  E1DP_EVT_TYPE = 0x40 ,
  E1DP_RESP_TYPE = 0x80 ,
  E1DP_ERR_TYPE = 0xc0 ,
  E1DP_TYPE_MSK = 0xc0
}
 e1d CTL protocol message type definition. More...
 
enum  osmo_e1dp_line_mode {
  E1DP_LMODE_OFF = 0x00 ,
  E1DP_LMODE_CHANNELIZED = 0x20 ,
  E1DP_LMODE_SUPERCHANNEL = 0x21 ,
  E1DP_LMODE_E1OIP = 0x22
}
 e1d CTL protocol line mode. More...
 
enum  osmo_e1dp_ts_mode {
  E1DP_TSMODE_OFF = 0x00 ,
  E1DP_TSMODE_RAW = 0x10 ,
  E1DP_TSMODE_HDLCFCS = 0x11
}
 e1d CTL protocol timeslot mode. More...
 

Functions

struct osmo_e1dp_msg_hdr __attribute__ ((packed))
 
struct msgb * osmo_e1dp_recv (struct osmo_fd *ofd, int *fd)
 
int osmo_e1dp_send (struct osmo_fd *ofd, struct msgb *msgb, int fd)
 

Variables

uint16_t magic
 
uint16_t len
 
uint8_t type
 
uint8_t intf
 
uint8_t line
 
uint8_t ts
 
uint8_t id
 
uint8_t n_lines
 
uint8_t mode
 
struct osmo_e1dp_line_config cfg
 
uint8_t status
 E1 line configuration.
 
uint8_t flags
 
uint16_t read_bufsize
 
const struct value_string osmo_e1dp_msg_type_names []
 
const struct value_string osmo_e1dp_line_mode_names []
 
const struct value_string osmo_e1dp_ts_mode_names []
 

Detailed Description

Specification of the IPC protocol used on the CTL UNIX domain socket between osmo-e1d and its client programs.

Macro Definition Documentation

◆ E1DP_DEFAULT_SOCKET

#define E1DP_DEFAULT_SOCKET   "/tmp/osmo-e1d.ctl"

default location of osmo-e1d CTL protocol UNIX domain socket

◆ E1DP_INVALID

#define E1DP_INVALID   0xff

magic value to indicate given field (interface/line/timeslot) is unspecified/invalid.

Referenced by osmo_e1dp_client_intf_query(), osmo_e1dp_client_line_config(), osmo_e1dp_client_line_query(), and osmo_e1dp_client_set_sa_bits().

◆ E1DP_MAGIC

#define E1DP_MAGIC   0x01e1

Magic value.

the idea here is to use the first byte as a version number, to prevent incompatible clients from connecting to e1d

◆ E1DP_MAX_LEN

#define E1DP_MAX_LEN   4096

Maximum length of a protocol message.

◆ E1DP_MAX_SIZE_HDLC

#define E1DP_MAX_SIZE_HDLC   264

Maximum length of HDLC messages.

◆ E1DP_TS_OPEN_F_FORCE

#define E1DP_TS_OPEN_F_FORCE   0x80

Flag that can be used as osmo_e1dp_ts_config.flags to force opening a TS.

Referenced by osmo_e1dp_client_ts_open_force().

◆ E1DP_TS_SUPERCHAN

#define E1DP_TS_SUPERCHAN   0xfe

magic value used to indicate superchannel instead of timeslot.

Enumeration Type Documentation

◆ osmo_e1dp_line_mode

e1d CTL protocol line mode.

Enumerator
E1DP_LMODE_OFF 

Line is switched off.

E1DP_LMODE_CHANNELIZED 

Line is used in channelized mode with (64kBps) timeslots.

E1DP_LMODE_SUPERCHANNEL 

Line is used as superchannel (31TS combined together)

E1DP_LMODE_E1OIP 

Line is used in E1oIP mode (not available to CTL clients)

◆ osmo_e1dp_msg_type

e1d CTL protocol message type definition.

Split in 'type' and 'command' portion.

Enumerator
E1DP_CMD_INTF_QUERY 

Query information about E1 interface(s).

filter: intf (optional); in: n/a out: array of osmo_e1dp_intf_info

E1DP_CMD_LINE_QUERY 

Query information about E1 line(s).

filter: intf (required), line (optional); in: n/a; out: array of osmo_e1dp_line_info

E1DP_CMD_TS_QUERY 

Query information about E1 timeslot(s).

filter: intf (required), line (required), ts (optional); in: n/a; out: array of osmo_e1dp_ts_info

E1DP_CMD_LINE_CONFIG 

Configure a given E1 line.

filter: intf (required), line (required); in: osmo_e1dp_line_config; out: osmo_e1dp_line_info

E1DP_CMD_TS_OPEN 

Open a given E1 timeslot.

filter: intf (required), line (required), ts (required); in: osmo_e1dp_ts_config; out: osmo_e1dp_ts_info with the opened TS (or an invalid one with id == -1 for errors)

  • message with the file descriptor
E1DP_CMD_SABITS 

Send Sa bits to line.

filter: intf (required), line (required), ts n/a; in: uint8_t;

E1DP_EVT_LOS_ON 

Received signal loss from interface.

E1DP_EVT_LOS_OFF 

Ceased signal loss from interface.

E1DP_EVT_AIS_ON 

Received alarm indication signal from interface.

E1DP_EVT_AIS_OFF 

Ceased alarm indication signal from interface.

E1DP_EVT_RAI_ON 

Received remote alarm indication from interface.

E1DP_EVT_RAI_OFF 

Ceased remote alarm indication from interface.

E1DP_EVT_LOF_ON 

Received frame loss from interface.

E1DP_EVT_LOF_OFF 

Ceased frame loss from interface.

E1DP_EVT_SABITS 

Received Sa bits from interface.

out: uint8_t;

E1DP_EVT_TYPE 

Message is an event.

E1DP_RESP_TYPE 

Message is a response.

E1DP_ERR_TYPE 

Message is an error.

E1DP_TYPE_MSK 

Mask to separate type from command.

◆ osmo_e1dp_ts_mode

e1d CTL protocol timeslot mode.

Enumerator
E1DP_TSMODE_OFF 

Timeslot is switched off.

E1DP_TSMODE_RAW 

Timeslot is in RAW mode, containing transparent 64kBps bitstream.

E1DP_TSMODE_HDLCFCS 

Timeslot is in HLDC-FCS mode; e1d will run software HDLC processor.

Function Documentation

◆ __attribute__()

struct osmo_e1dp_ts_info __attribute__ ( (packed) )

◆ osmo_e1dp_recv()

struct msgb * osmo_e1dp_recv ( struct osmo_fd * ofd,
int * fd )

◆ osmo_e1dp_send()

int osmo_e1dp_send ( struct osmo_fd * ofd,
struct msgb * msgb,
int fd )

Variable Documentation

◆ cfg

◆ flags

uint8_t flags

◆ id

uint8_t id

◆ intf

◆ len

uint16_t len

◆ line

◆ magic

uint16_t magic

◆ mode

◆ n_lines

uint8_t n_lines

◆ osmo_e1dp_line_mode_names

const struct value_string osmo_e1dp_line_mode_names[]
extern

Referenced by osmo_e1dp_send().

◆ osmo_e1dp_msg_type_names

const struct value_string osmo_e1dp_msg_type_names[]
extern

Referenced by osmo_e1dp_send().

◆ osmo_e1dp_ts_mode_names

const struct value_string osmo_e1dp_ts_mode_names[]
extern

Referenced by osmo_e1dp_send().

◆ read_bufsize

uint16_t read_bufsize

◆ status

uint8_t status

E1 line configuration.

TBD

◆ ts

◆ type

uint8_t type