The remaining intf_line.c really only manages the data structures.
This is useful for building other programs than osmo-e1d, such as
an upcoming E1 test utility called osmo-e1gen which will also use
the USB interface and icE1usb hardware, but not any of the mux/demux/ctl
code.
Change-Id: I1ceaea85a15e2fae1d2e041173be9d758c6d0b78
Existing applications (such as those written for DAHDI) expect to
be reading data in buffer/chunk sizes. For example OsmoNITB: It
doesn't want to execute an expensive read/recv syscall to receive 11
bytes, if it needs at least 160 bytes.
Change-Id: I807671bc6f2acaef740ce215b8d8abcb5dce2640
This groups all HDLC-specific members together, in preparation
of adding more fields for other modes.
Change-Id: Ide0577c25836252862153b4f24da550bee013687
In superchannel mode, all 31 TS are grouped together.
There is no way to enable it yet, see next patch.
Change-Id: Id340b1925471f427deb6cda7eb54e80dfc71faec
We treat the superchannel as an extra, separate timeslot. Initially
I thought of simply re-using TS1, but keeping the superchannel
separate ensures that it doesn't inherit any state (like half-sent
HDLC frames) from another timeslot when we switch between the modes
at runtime.
Change-Id: I0aacf251e155de2bb6ad03ffc4181067b22f1c90
If we are not able to read more packets from the user application,
the recv/read call will return 0 and set errno = EAGAIN. In this
situation we cannot bail out but still ask the HDLC code to generate
output (sequences of flag octets). If we fail to do that, we will
transmit all-ones pattern instaed of all-flag octets.
Change-Id: Id3bc76f1956138dcd9cb7b499f7251cd94af1329
SEQPACKET is great for preserving message boundaries on signaling
channels that use HDLC. However, its semantics, particularly regarding
truncation, are sub-optimal for RAW slots containing raw user
bitstreams (typically TRAU frames or PCM audio data).
So let's use SOCK_STREAM for RAW and keep SEQPACKET for HDLCFCS.
Closes: OS#4663
Change-Id: I1767ceaa5d2a008db0009b8027667a71c0fdc0f1
The idea is to generate a pair of virtual E1 interfaces (each with
identical number of lines), where each line A:n is connected to line B:n
of the pair and vice-versa.
This allows to test E1 using applications back to back against each
other, without any physical E1 circuits in between.
Change-Id: If42c959556b17d543762546eb45dd69d25f715f2
'struct e1_ts' always had a back-pointer to the line it is part of,
but apparently this was never initialized so far.
Change-Id: I5e6c8189bf5aa4af26d6cd6c6d288a149ed7fa66
We always want to know as much context as possible. Which exact
timeslot on which line of which interface ha logged something?
Change-Id: I3d8909b396928ed3c023b8ac47fa9ec72c99e681
If the user application has closed the timeslot socket, we will
get error returns from read/write calls, which we must use to clean
up the daemon-side state for this timeslot.
Change-Id: I2e3e5010f36e916b4c8908af91447b3d3661123f
By using llist_add_tail(), we add new elements at the end of the list,
rather than inserting at front. Among other things, this has the added
benefit that when the VTY prints information on lines, they are printed
in numerically ascending orrder (0,1,2, ...) and not the reverse.
Change-Id: I07a6ba706f855a29b4e33b1a6b008e0d2f11b6f3