Coder Social home page Coder Social logo

cminyard / gensio Goto Github PK

View Code? Open in Web Editor NEW
78.0 8.0 24.0 9.29 MB

A library to abstract stream I/O like serial port, TCP, telnet, UDP, SSL, IPMI SOL, etc.

License: GNU General Public License v2.0

Makefile 1.41% C 78.11% M4 4.32% Python 7.36% Roff 0.93% Shell 0.26% SWIG 3.35% C++ 2.82% Go 1.10% Inno Setup 0.35%
stream-api serial-communication ssl authentication telnet multiplexer ipmi-sol sctp tcp udp

gensio's Introduction

gensio - General Stream I/O

This is gensio (pronounced gen'-see-oh), a framework for giving a consistent view of various stream (and packet) I/O types. You create a gensio object (or a gensio), and you can use that gensio without having to know too much about what is going on underneath. You can stack gensio on top of another one to add protocol funcionality. For instance, you can create a TCP gensio, stack SSL on top of that, and stack Telnet on top of that. It supports a number of network I/O and serial ports. It also supports sound interfaces. gensios that stack on other gensios are called filters.

You can do the same thing with receiving ports. You can set up a gensio accepter to accept connections in a stack. So in our previous example, you can setup TCP to listen on a specific port and automatically stack SSL and Telnet on top when the connection comes in, and you are not informed until everything is ready.

gensio works on Linux, BSDs, MacOS, and Windows. On Windows, it gives you a single-threaded capable (but also multi-thread capable) event-driven interface (with blocking interfaces available) to simplify programming with lots of I/Os. It goes a long way to making writing portable I/O driven code easy.

A very important feature of gensio is that it makes establishing encrypted and authenticated connections much easier than without it. Beyond basic key management, it's really no harder than TCP or anything else. It offers extended flexibility for controlling the authentication process if needed. It's really easy to use.

Note that the gensio(5) man page has more details on individual gensio types.

For instructions on building this from source, see the "Building" section at the end.

gensio tools

A couple of tools are available that use gensios, both as an example and for trying things out. These are:

gensiot

A tool for making basic gensio connections. You can create any arbitrary gensio setup you like. See gensiot(1) for details.

gtlsshd

An sshd-like daemon that uses certauth, ssl, and SCTP or TCP gensios for making connections. It uses standard PAM authentication and uses ptys. See gtlsshd(8) for details.

There is a item in FAQ.rst named "How to run gtlsshd on Windows", see that and the Building on Windows section below for more details, as there are a few tricky things you have to handle.

gtlssh

An ssh-like program that can connect to gtlsshd. It can also be used with ser2net to make establishing encrypted and authenticated connections easier. See gtlssh(1) for details.

Available gensios

The following gensios are available in the library:

sctp

Normal SCTP communication. Streams and out of bound data are supported. End of message demarcation is not supported because it doesn't currently work on Linux.

tcp

Normal TCP communication. Out of bound data is supported.

udp

Sort-of connection oriented UDP.

stdio

Access to either the calling program's stdio, or the ability to run a program and connect to its stdin, stdout, and stderr. NOTE: Do not use this for file I/O. Use the file gensio.

file

Used for accessing files. Allows both input and output file, and streams the data to/from the files. No accepter available.

pty

Run a program in a PTY and use the gensio to communicate with its tty. No accepter available.

serialdev

Connect to a device. You can use "sdev" as shorthand for "serialdev". It can hook to termios type devices, like ptys and /dev/tty, more than just serial ports. No accepter available.

dev

Connects to devices (like serialdev does) but does not do any serial port processing. It also has a write-only option for talking to printer ports or other write-only devices. It also has a rdonly option for talking to read-only devices. No accepter available.

ipmisol

Connect to a remote over IPMI SOL. Full serial port capabilities are available. No accepter available, unfortunately.

dummy

An accepter that doesn't do anything except look like an accepter to the user. Useful in some situations where an accepter is expected but you don't need to do anything.

echo

A gensio that echos everything that is sent to it. Useful for testing. No accepter available.

telnet

A filter gensio that implements the telnet protocol. It can do full serial support with RFC2217.

ssl

Implement SSL/TLS as a gensio filter. It supports client authentication, too.

certauth

A user authentication protocol implemented as a gensio filter.

mux

A channel multiplexer. You can create channels on top of it using open_channel(). Channels work as normal gensio, so you can have a number of gensios running on top of a single gensio. It also has end-of-message demarcation and obviously full flow-control capability individually on each channel. If you just need a gensio with end-of-message demarcation, you can use this as without creating channels.

msgdelim

Converts an unreliable stream interface into an unreliable packet interface. This is primarily so a reliable packet interface like relpkt can run over a serial port. It does not support streaming of data, so it's not very useful by itself.

relpkt

Converts an unreliable packet interface to a reliable packet interface (that also supports streaming). Made for running over msgdelim. It will run over UDP, but it's not ideal for that because it doesn't do all the internet-friendly flow control and such that SCTP and TCP do.

trace

A transparent gensio that allows the data read and/or written to be sent to a file, either as raw data or as human-readable hex data. It can also be used to block data flowing in one or both directions.

perf

A gensio that can send/receive data on top of a stack of gensios and measure the throughput on the channel. The received data from perf is information about the channel throughput.

conacc

A gensio accepter that takes a gensio stack string as a parameter. This lets you use a gensio as an accepter. When conacc is started, it opens the gensio, and when the gensio opens it reports a new child for the accepter. When the child closes it attempts to open the child again and go through the process again (unless accepts have been disabled on conacc).

Why would you want to use this? Say in ser2net you wanted to connect one serial port to another. You could have a connection like:

connection: &con0
  accepter: conacc,serialdev,/dev/ttyS1,115200
  connector: serialdev,/dev/ttyS2,115200

And it would connect /dev/ttyS1 to /dev/ttyS2. Without conacc, you could not use serialdev as an accepter. It would also let you use gtlsshd on a serial port if you wanted encrypted authenticated logins over a serial port. If you ran gtlsshd with the following:

gtlsshd --notcp --nosctp --oneshot --nodaemon --other_acc
   'conacc,relpkt(mode=server),msgdelim,/dev/ttyUSB1,115200n81'

You could connect with:

gtlssh --transport 'relpkt,msgdelim,/dev/ttyUSB2,115200n81' USB2

This creates a reliable packet transport over a serial port. The mode=server is required to make relpkt run as the server, since it would normally run as a client since it is not being started as an accepter. The ssl gensio (which runs over the transport) requires reliable communication, so it won't run directly over a serial port.

xlt

This gensio allows character translations to be done on data flowing through this filter. It's primarily to convert carraige returns and line feeds.

mdns

This gensio uses mDNS to lookup a service (protocol type, network type, port, address) and then connect to that service. If you have a program like ser2net that advertise mDNS service, you don't have to worry about finding port numbers and such, it's all handled for you.

keepopen

This gensio presents an always open connection to the upper layer and keeps the lower layer connection open. If it closes, it re-opens it.

script

This gensio executes an external program with the external program's stdio connected to the child of this gensio. Once the external program terminates, this gensio will report that it is open and pass all the data through. This can be used to run scripts to set things up on a connection before hooking to the parent gensio.

sound

A gensio that provides access to sound devices and files. It's a little complicated, read the docs in gensio.5

afskmdm

Yes, it looks like a jumble of letters.

A filter gensio that sits on top of the sound gensio and does an Audio Frequency Shift Keying modem, like is used on AX.25 amateur radio.

kiss

An amateur radio protocol for talking to TNCs. This is used by AX25 in many cases.

ax25

An amateur radio protocol for packet radio. To fully use this you would need to write code, since it uses channels and oob data for unnumbered information, but you can do basic things with just gensiot if all you need is one communication channel. For instance, if you wanted to chat with someone over the radio, and the kiss port is on 8001 on both machines, on the accepting machine you can run:

gensiot -i 'stdio(self)' -a \
    'ax25(laddr=AE5KM-1),kiss,conacc,tcp,localhost,8001'

which will hook to the TNC and wait for a connection on address AE5KM-1. Then you could run:

gensiot -i 'stdio(self)' \
    'ax25(laddr=AE5KM-2,addr="0,AE5KM-1,AE5KM-2"),kiss,tcp,localhost,8001'

on the other machine. This will connect to the other machine over TNC 0 with the given address. Then anything you type in one will appear on the other, a line at a time. Type "Ctrl-D" to exit. The 'stdio(self)' part turns off raw mode, so it's a line at a time and you get local echo. Otherwise every character you types would send a packet and you couldn't see what you were typing.

To hook to the N5COR-11 AX.25 BBS system, you would do:

gensiot -i 'xlt(nlcr),stdio(self)' \
  'ax25(laddr=AE5KM-2,addr="0,N5COR-11,AE5KM-2"),kiss,tcp,localhost,8001'

Most BBS systems use CR, not NL, for the new line, so the xlt gensio is used to translate incoming these characters.

Of course, this being gensio, you can put any workable gensio underneath ax25 that you would like. So if you want to play around or test without a radio, you could do ax25 over UDP multicast. Here's the accepter side:

gensiot -i 'stdio(self)' -a \
'ax25(laddr=AE5KM-1),conacc,'\
'udp(mcast="ipv4,224.0.0.20",laddr="ipv4,1234",nocon),'\
'ipv4,224.0.0.20,1234'

and here's the connector side:

gensiot -i 'stdio(self)' \
'ax25(laddr=AE5KM-2,addr="0,AE5KM-1,AE5KM-2"),'\
'udp(mcast="ipv4,224.0.0.20",laddr="ipv4,1234",nocon),'\
'ipv4,224.0.0.20,1234'

kiss is not required because UDP is already a packet-oriented media. Or you can use the greflector program to create a simulated radio situation. On the machine "radiopi2", run:

greflector kiss,tcp,1234

which will create a program that will reflect all received input to all other connections. Then on the accepter side:

gensiot -i 'stdio(self)' -a \
'ax25(laddr=AE5KM-1),kiss,conacc,tcp,radiopi2,1234'

and the connecting side:

gensiot -i 'stdio(self)' \
'ax25(laddr=AE5KM-2,addr="0,AE5KM-1,AE5KM-2"),kiss,tcp,radiopi2,1234'

The test code uses the reflector for some testing, since it's so convenient to use.

ratelimit

Limit the data throughput for a gensio stack.

cm108gpio

Allow a GPIO on a CMedia CM108 or equivalent sound device to be controlled. Used with afskmdm for keying a transmitter.

These are all documented in detail in gensio(5). Unless otherwise stated, these all are available as accepters or connecting gensios.

Creating Your Own Gensios

You can create your own gensios and register them with the library and stack them along with the other gensios.

The easiest way to do this is to steal code from a gensio that does kind of what you want, then modify it to create your own gensio. There is, unfortunately, no good documentation on how to do this.

The include file include/gensio/gensio_class.h has the interface between the main gensio library and the gensio. The gensio calls all come through a single function with numbers to identify the function being requested. You have to map all these to the actual operations. This is somewhat painful, but it makes forwards and backwards compatibility much easier.

Creating your own gensio this way is fairly complex. The state machine for something like this can be surprisingly complex. Cleanup is the hardest part. You have to make sure you are out of all callbacks and no timers might be called back in a race condition at shutdown. Only the simplest gensios (echo, dummy), strange gensios (conadd, keepopen, stdio), and gensios that have channels (mux, ax25) directly implement the interface. Everything else uses include/gensio/gensio_base.h. gensio_base provides the basic state machine for a gensio. It has a filter portion (which is optional) and a low-level (ll) portion, which is not.

The filter interface has data run through it for the processing. This is used for things like ssl, certauth, ratelimit, etc. Filter gensios would use this. These all use gensio_ll_gensio (for stacking a gensio on top of another gensio) for the ll.

Terminal gensios each have their own ll and generally no filter. For lls based on a file descriptor (fd), gensio_ll_fd is used. There is also an ll for IPMI serial-over-lan (ipmisol) and for sound. Most of the terminal gensios (tcp, udp, sctp, serial port, pty) use the fd ll, obviously.

Once you have a gensio, you can compile it as a module and stick it in $(moduleinstalldir)/<version>. Then the gensio will just pick it up and use it. You can also link it in with your application and do the init function from your application.

mDNS support

The mdns gensio has already been discussed, but the gensio library provides an easy to use mDNS interface. The include file for it is in gensio_mdns.h, and you can use the gensio_mdns(3) man page to get more information on it.

To make an mdns connection using gensiot, say you have ser2net set up with mdns enabled like:

connection: &my-port
  accepter: telnet(rfc2217),tcp,3001
  connector: serialdev,/dev/ttyUSB1,115200N81
  options:
    mdns: true

then you can connection to it with gensiot:

gensiot 'mdns,my-port'

gensiot will find the server, port, and whether telnet and rfc2217 are enabled and make the connection.

In addition, there is an gmdns tool that lets you do queries and advertising, and gtlssh can do mDNS queries to find services. If you have secure authenticated logins for ser2net, and you enable mdns on ser2net, like:

connection: &access-console
  accepter: telnet(rfc2217),mux,certauth(),ssl,tcp,3001
  connector: serialdev,/dev/ttyUSBaccess,115200N81
  options:
    mdns: true

it makes the setup very convenient, as you can just do:

gtlssh -m access-console

That's right, you can just directly use the connection name, no need to know the host, whether telnet or rfc2217 is enabled, or what the port is. You still have to set up the keys and such on the ser2net server, of course, per those instructions.

General Concepts

gensio has an object oriented interface that is event-driven. Synchronous interfaces are also available. You deal with two main objects in gensio: a gensio and a gensio accepter. A gensio provides a communication interface where you can connect, disconnect, write, receive, etc.

A gensio accepter lets you receive incoming connections. If a connection comes in, it gives you a gensio.

The interface is event-driven because it is, for the most part, completely non-blocking. If you open a gensio, you give it a callback that will be called when the connection is up, or the connection fails. Same for close. A write will return the number of bytes accepted, but it may not take all the bytes (or even any of the bytes) and the caller must account for that.

The open and close interfaces have a secondary blocking interface for convenience. These end in _s. This is for convenience, but it's not necessary and use of these must be careful because you can't really use them from callbacks.

Speaking of callbacks, data and information coming from gensio to the user is done with a function callback. Read data, and when the gensio is ready for write data comes back in a callback. A similar interface is used for calling from the user to the gensio layer, but it is hidden from the user. This sort of interface is easily extensible, new operations can be easily added without breaking old interfaces.

The library provides several ways to create a gensio or gensio accepter. The main way is str_to_gensio() and str_to_gensio_accepter(). These provide a way to specify a stack of gensios or accepters as a string and build. In general, you should use this interface if you can.

In general, interfaces that are not performance sensitive are string based. You will see this in gensio_control, and in auxiliary data in the read and write interface to control certain aspects of the write.

The library also provides ways to set up your gensios by individually creating each one. In some situations this might be necessary, but it limits the ability to use new features of the gensio library as it gets extended.

If a gensio supports multiple streams (like SCTP), stream numbers are passed in the auxdata with "stream=n". Streams are not individually flow controlled.

Channels, on the other hand, are separate flows of data over the same connection. Channels are represented as separate gensios, and they can be individually flow controlled.

Include Files

There are a few include files you might need to deal with when using gensios:

gensio.h

The main include files for gensios and gensio accepters.

sergensio.h

Serial port handling gensios and gensio accepters.

gensio_os_funcs.h

The definition for an OS handler.

argvutils.h

Many gensio functions take an argv array, this is utilities for dealing with argvs.

gensio_selector.h

A definition for a default OS handler.

These are for the most part documented in the man pages.

For creating your own gensios, the following include files are available for you:

gensio_class.h

The main include file for creating your own gensio.

sergensio_class.h

The main include file for creating your own serial port gensio.

gensio_base.h

This handles a lot of the boiler plate for a gensio. Most of the standard gensios use this. It splits the gensio function into an optional filter, and a lower layer interface called an ll.

gensio_ll_fd.h

An ll that provides most of the boilerplate for dealing with a file descriptor.

gensio_ll_gensio.h

An ll that provides all that is necessary for stacking a gensio on top of another gensio. The filter gensios (telnet, ssl, etc.) use this as the ll.

Each include file has lots of documentation about the individual calls and handlers.

Errors

gensio has it's own set of errors to abstract it from the OS errors (named GE_xxx) and provide more flexibility in error reporting. These are in the gensio_err.h include file (automatically included from gensio.h) and may be translated from numbers to a meaningful string with gensio_err_to_str(). Zero is defined to be not an error.

If an unrecongnized operating system error occurs, GE_OSERR is returned and a log is reported through the OS handler log interface.

OS Handler

One slightly annoying thing about gensio is that it requires you to provide an OS handler (struct gensio_os_funcs) to handle OS-type functions like memory allocation, mutexes, the ability to handle file descriptors, timers and time, and a few other things.

The library does provide several OS handlers. You can call gensio_alloc_os_funcs() to allocate a default one for your system (POSIX or Windows). You can see that man page for more details. This will generally be the best performing option you have for your system.

For POSIX systems, OS handlers for glib and TCL are available, allocated with gensio_glib_funcs_alloc() and gensio_tcl_funcs_alloc(). These really don't work very well, especially from a performance point of view, the APIs for glib and TCL are not well designed for what gensio does. TCL can only support single-threaded operation. glib multithreaded operation only has one thread at a time waiting for I/O. But they do work, and the tests are run with them. These are not available on Windows because of poor abstractions on glib and because of lack of motivation on TCL.

But if you are using something else like X Windows, etc that has it's own event loop, you may need to adapt one for your needs. But the good thing is that you can do this, and integrate gensio with pretty much anything.

There is also a waiter interface that provides a convenient way to wait for things to occur while running the event loop. This is how you generally enter the event loop, because it provides a convenient way to signal when you are done and need to leave the loop.

Documentation for this is in:

include/gensio/gensio_os_funcs.h

Threads

The gensio library fully supports threads and is completely thread-safe. However, it uses signals on POSIX system, and COM on Windows systems, so some setup is required.

The "main" thread should call gensio_os_proc_setup() at startup and call gensio_os_proc_cleanup() when it is complete. This sets up signals and signal handlers, thread local storage on Windows, and other sorts of things.

You can spawn new threads from a thread that is already set up using gensio_os_new_thread(). This gives you a basic OS thread and is configured properly for gensio.

If you have a thread created by other means that you want to use in gensio, as long as the thread create another thread and doesn't do any blocking functions (any sort of wait, background processing, functions that end in _s like read_s, etc.) you don't have to set them up. That way, some external thread can write data, wake another thread, or do things like that.

If an external thread needs to do those things, it should call gensio_os_thread_setup().

Signals

As mentioned in the threads section, the gensio library on Unix uses signals for inter-thread wakeups. I looked hard, and there's really no other way to do this cleanly. But Windows has a couple of signal-like things, too, and these are available in gensio, also.

If you use gensio_alloc_os_funcs(), you will get an OS funcs using the passed in signal for IPC. You can pass in GENSIO_OS_FUNCS_DEFAULT_THREAD_SIGNAL for the signal if you want the default, which is SIGUSR1. The signal you use will be blocked and taken over by gensio, you can't use it.

gensio also provides some generic handling for a few signals. On Unix, it will handle SIGHUP through the gensio_os_proc_register_reload_handler() function.

On Windows and Unix you can use gensio_os_proce_register_term_handler(), which will handle termination requests (SIGINT, SIGTERM, SIGQUIT on Unix) and gensio_os_proc_register_winsize_handler() (SIGWINCH on Unix). How these come in through Windows is a little messier, but invisible to the user.

All the callbacks from from a waiting routine's wait, not from the signal handler. That should simplify your life a lot.

You can see the man pages for more details on all of these.

Creating a gensio

Connecting gensios

To create a gensio, the general way to do this is to call str_to_gensio() with a properly formatted string. The string is formatted like so:

<type>[([<option>[,<option[...]]])][,<type>...][,<end option>[,<end option>]]

The end option is for terminal gensios, or ones that are at the bottom of the stack. For instance, tcp,localhost,3001 will create a gensio that connects to port 3001 on localhost. For a serial port, an example is serialdev,/dev/ttyS0,9600N81 will create a connection to the serial port /dev/ttyS0.

This lets you stack gensio layers on top of gensio layers. For instance, to layer telnet on top of a TCP connection:

telnet,tcp,localhost,3001

Say you want to enable RFC2217 on your telnet connection. You can add an option to do that:

telnet(rfc2217=true),tcp,localhost,3001

When you create a gensio, you supply a callback with user data. When events happen on a gensio, the callback will be called so the user could handle it.

gensio accepters

A gensio accepter is similar to a connecting gensio, but with str_to_gensio_accepter() instead. The format is the same. For instance:

telnet(rfc2217=true),tcp,3001

will create a TCP accepter with telnet on top. For accepters, you generally do not need to specify the hostname if you want to bind to all interfaces on the local machine.

Using a gensio

Once you have created a gensio, it's not yet open or operational. To use it, you have to open it. To open it, do:

struct gensio *io;
int rv;

rv = str_to_gensio("tcp,localhost,3001", oshnd,
                   tcpcb, mydata, &io);
if (rv) { handle error }
rv = gensio_open(io, tcp_open_done, mydata);
if (rv) { handle error }

Note that when gensio_open() returns, the gensio is not open. You must wait until the callback (tcp_open_done() in this case) is called. After that, you can use it.

Once the gensio is open, you won't immediately get any data on it because receive is turned off. You must call gensio_set_read_callback_enable() to turn on and off whether the callback (tcpcb in this case) will be called when data is received.

When the read handler is called, the buffer and length is passed in. You do not have to handle all the data if you cannot. You must update the buflen with the number of bytes you actually handled. If you don't handle data, the data not handled will be buffered in the gensio for later. Not that if you don't handle all the data, you should turn off the read enable or the event will immediately called again.

If something goes wrong on a connection, the read handler is called with an error set. buf and buflen will be NULL in this case.

For writing, you can call gensio_write() to write data. You may use gensio_write() at any time on an open gensio. gensio_write() may not take all the data you write to it. The count parameter passes back the number of bytes actually taken in the write call.

You can design your code to call gensio_set_write_callback_enable() when you have data to send and the gensio will call the write ready callback and you can write from the callback. This is generally simpler, but enabling and disabling the write callback adds some overhead.

A more efficient approach is to write data whenever you need to and have the write callback disabled. If the write operation returns less than the full request, the other end has flow-controlled and you should enable the write callback and wait until it is called before sending more data.

In the callbacks, you can get the user data you passed in to the create call with gensio_get_user_data().

Note that if you open then immediately close a gensio, this is fine, even if the open callback hasn't been called. The open callback may or may not be called in that case, though, so it can be difficult to handle this properly.

Synchronous I/O

You can do basic synchronous I/O with gensios. This is useful in some situations where you need to read something inline. To do this, call:

err = gensio_set_sync(io);

The given gensio will cease to deliver read and write events. Other events are delivered. Then you can do:

err = gensio_read_s(io, &count, data, datalen, &timeout);
err = gensio_write_s(io, &count, data, datalen, &timeout);

Count is set to the actual number of bytes read/written. It may be NULL if you don't care (though that doesn't make much sense for read).

Timeout may be NULL, if so then wait for forever. If you set a timeout, it is updated to the amount of time left.

Note that signals will cause these to return immediately, but no error is reported.

Reads will block until some data comes in and returns that data. It does not wait until the buffer is full. timeout is a timeval, the read will wait that amount of time for the read to complete and return. A timeout is not an error, the count will just be set to zero.

Writes block until the whole buffer is written or a timeout occurs. Again, the timeout is not an error, the total bytes actually written is returned in count.

Once you are done doing synchronous I/O with a gensio, call:

err = gensio_clear_sync(io);

and delivery through the event interface will continue as before. You must not be in a synchronous read or write call when calling this, the results will be undefined.

Note that other I/O on other gensios will still occur when waiting for synchronous I/O

There is not currently a way to wait for multiple gensios with synchronous I/O. If you are doing that, you should really just use the event-driven I/O. It's more efficient, and you end up doing the same thing in the end, anyway.

Using a gensio accepter

Like a gensio, a gensio accepter is not operational when you create it. You must call gensio_acc_startup() to enable it:

struct gensio_accepter *acc;
int rv;

rv = str_to_gensio_accepter("tcp,3001", oshnd,
                            tcpacccb, mydata, &acc);
if (rv) { handle error }
rv = gensio_startup(acc);
if (rv) { handle error }

Note that there is no callback to the startup call to know when it's enabled, because there's no real need to know because you cannot write to it, it only does callbacks.

Even after you start up the accepter, it still won't do anything until you call gensio_acc_set_accept_callback_enable() to enable that callback.

When the callback is called, it gives you a gensio in the data parameter that is already open with read disabled. A gensio received from a gensio acceptor may have some limitations. For instance, you may not be able to close and then reopen it.

gensio accepters can do synchronous accepts using gensio_acc_set_sync() and gensio_acc_accept_s. See the man pages on those for details.

Logging

struct gensio_os_funcs has a vlog callback for handling internal gensio logs. These are called when something of significance happens but gensio has no way to report an error. It also may be called to make it easier to diagnose an issue when something goes wrong.

Serial I/O

The gensio and gensio accepter classes each have subclasses for handling serial I/O and setting all the parameters associated with a serial port.

You can discover if a gensio (or any of its children) is a serial port by calling gensio_to_sergensio(). If that returns NULL, it is not a sergensio and none of it's children are sergensios. If it returns non-NULL, it returns the sergensio object for you to use. Note that the gensio returned by sergensio_to_gensio() will be the one passed in to gensio_to_sergensio(), not necessarily the gensio that sergensio is directly associated with.

A sergensio may be a client, meaning that it can set serial settings, or it may be a server, meaning that it will receive serial settings from the other end of the connection.

Most sergensios are client only: serialdev (normal serial port), ipmisol, and stdio accepter. Currently only telnet has both client and server capabilities.

Python Interface

NOTE: The python interface described here is deprecated. Use the one in c++/swig/pygensio now.

You can access pretty much all of the gensio interface through python, though it's done a little differently than the C interface.

Since python is fully object oriented, gensios and gensio accepters are first-class objects, along with gensio_os_funcs, sergensios, and waiters.

Here's a small program:

import gensio

class Logger:
    def gensio_log(self, level, log):
        print("***%s log: %s" % (level, log))

class GHandler:
    def __init__(self, o, to_write):
        self.to_write = to_write
        self.waiter = gensio.waiter(o)
        self.readlen = len(to_write)

    def read_callback(self, io, err, buf, auxdata):
        if err:
            print("Got error: " + err)
            return 0
        print("Got data: " + buf);
        self.readlen -= len(buf)
        if self.readlen == 0:
            io.read_cb_enable(False)
            self.waiter.wake()
        return len(buf)

    def write_callback(self, io):
        print("Write ready!")
        if self.to_write:
            written = io.write(self.to_write, None)
            if (written >= len(self.to_write)):
                self.to_write = None
                io.write_cb_enable(False)
            else:
                self.to_write = self.to_write[written:]
        else:
            io.write_cb_enable(False)

    def open_done(self, io, err):
        if err:
            print("Open error: " + err);
            self.waiter.wake()
        else:
            print("Opened!")
            io.read_cb_enable(True)
            io.write_cb_enable(True)

    def wait(self):
        self.waiter.wait_timeout(1, 2000)

o = gensio.alloc_gensio_selector(Logger())
h = GHandler(o, "This is a test")
g = gensio.gensio(o, "telnet,tcp,localhost,2002", h)
g.open(h)

h.wait()

The interface is a pretty direct translation from the C interface. A python representation of the interface is in swig/python/gensiodoc.py, you can see that for documentation.

C++

The C++ interface is documented in c++/README.rst.

pygensio

The new pygensio interface is a cleaner implementation using swig directors instead of hand-coded callbacks into python. See the README.rst in c++/swig/pygensio. There are also glib and tcl OS_Funcs in the glib and tcl directories.

GO

The full C++ interface is available to Go programs through swig and swig directors. See c++/swig/go/README.rst for details.

Building

This is a normal autoconf system, nothing special. Note that if you get this directly from git, you won't have the build infrastructure included. There is a script named "reconf" in the main directory that will create it for you.

If you don't know about autoconf, the INSTALL file has some info, or google it.

To fully build gensio, you need the following:

  • swig - For python and go bindings
  • python dev libraries - For python bindings
  • go language installed in the path
  • openssl dev libraries and executable - For all the crypto
  • openipmi dev libraries - For IPMI serial over lan, if you want that. Note that you need a pretty recent one, really 2.0.31 or newer.
  • libsctp dev library - For sctp support
  • pkgconfig - If you want gensio to install its pkgconfig files.
  • avahi dev - If you want gensio to have mdns support.
  • pam dev - For support of logins with gtlsshd
  • libwrap - for tcpd
  • glib dev - for the glib os funcs
  • tcl dev - for the tcl os funcs
  • alsa dev - for sound (on Linux)
  • udev dev - for cm108 GPIO soundcard support (on Linux)

The following sets everything except openipmi up on ubuntu 20.04:

sudo apt install gcc g++ git swig python3-dev libssl-dev pkg-config libavahi-client-dev avahi-daemon libtool autoconf automake make libsctp-dev libpam-dev libwrap0-dev libglib2.0-dev tcl-dev libasound2-dev libudev-dev

On Redhat, libwrap is gone, so you won't be using that, and swig doesn't appear to be available, so you will have to built that yourself with at least go and python support. Here's the command for Redhat-like systems:

sudo yum install gcc gcc-c++ git python3-devel swig openssl-devel pkg-config avahi-devel libtool autoconf automake make lksctp-tools-devel pam-devel glib2-devel tcl-devel alsa-lib-devel systemd-devel

You might have to do the following to enable access to the development packages:

sudo dnf config-manager --set-enabled devel

And get the SCTP kernel modules, you might have to do:

sudo yum install kernel-modules-extra

To use Go language, you must get a version of swig 4.1.0 or greater. You may have to pull a bleeding edge version out of git and use that.

Handling python installation configuration is a bit of a pain. By default the build scripts will put it wherever the python program expects installed python programs to be. A normal user generally doesn't have write access to that directory.

To override this, you can use the --with-pythoninstall and --with-pythoninstalllib configure options or you can set the pythoninstalldir and pythoninstalllibdir environment variables to where you want the libraries and modules to go.

Note that you may need to set --with-uucp-locking to your lockdir (on older systems it's /var/lock, which is the default. On newer it might be /run/lock/lockdev. You might also need to be a member of dialout and lock groups to be able to open serial devices and/or locks.

go language support requires go to be installed and in the path.

Dynamic vs Built In gensios

As I continued to add gensios to the library, like crypto, mdns, sound, IPMI, sctp, etc. the number of dependencies in the library was getting out of control. Why should you be loading libasound, or libOpenIPMI, if you don't need it? Plus, though the library supported adding your own gensios through a programatic API, it had no standard way to add them for the system so you could write your own gensio and let everyone on the system use it.

The gensio library supports loading gensios dynamically or building them in to the library. By default if you create shared libraries, then all gensios are compiled as modules for dynamic loading and installed in a place that makes it possible. If you do not create shared libraries, all gensios are built in to the library. But you can override this behaviour.

To set all gensios to be built in to the library, you can add "--with-all-gensios=yes" on the configure command line and it will build them in to the library.

You can also set them to all be dynamically loaded by adding "--with-all-gensios=dynamic", but this is the default.

You can also disable all gensios by default by specifying "--with-all-gensios=no". Then no gensios will be built by default. This is useful if you only want a few gensios, you can turn all of them off then enable then ones you want.

To set how individual gensios are built, you do "--with-<gensio>=x" where x is "no (don't build), yes (build into library) or dynamic (dynamically loaded executable). For instance, if you only wanted to build the tcp gensio into the library and make the rest dynamic, you could set up for all dynamic gensios and then add "--with-net=yes".

These modules are put by default into $(moduleinstalldir) (specified with --with-moduleinstall on the configure line) which defaults to $(pkglibexecdir) (which is generally /usr/libexec/gensio).

Note that dynamic loading is always available, even if you build in all the gensios in the library. So you can still add your own gensios by adding then to the proper directory.

Gensios will be loaded first from the environment variable LD_LIBRARY_PATH, then from GENSIO_LIBRARY_PATH, then from the default location.

Building on MacOS

MacOS, being a sort of *nix, builds pretty cleanly with Homebrew (https://brew.sh). You have to, of course, install all the libraries you need. Most everything works, with the following exceptions:

* cm108gpio
* sctp
* uucp locking

The built-in DNSSD code is used for MDNS, so avahi is not required.

flock locking for serial ports works, so uucp locking really isn't required.

openipmi should work, but it is not available in homebrew so you would have to build it yourself.

Building on Windows

The gensio library can be built under Windows using mingw64. The following things don't work:

* sctp
* pam
* libwrap

You also don't need to install alsa, it uses the Windows sound interface for sound.

The cm108gpio uses native windows interfaces, so udev is not required.

The Windows built-in MDNS interfaces are used, so you don't need avahi or DNSSD. You will need to install the pcre library if you want regular expressions in it.

You need to get msys2 from https://msys2.org. Then install autoconf, automake, libtool, git, make, and swig as host tools:

pacman -S autoconf automake libtool git make swig

You have to install the mingw-w64-x86_64-xxx version of all the libraries or the mingw-w64-i686-xxx version of all the libraries. 32-bit is not well tested:

pacman -S mingw-w64-x86_64-gcc \
  mingw-w64-x86_64-python3 \
  mingw-w64-x86_64-pcre \
  mingw-w64-x86_64-openssl

for mingw64, or for ucrt64:

pacman -S mingw-w64-ucrt-x86_64-gcc \
  mingw-w64-ucrt-x86_64-python3 \
  mingw-w64-ucrt-x86_64-pcre \
  mingw-w64-ucrt-x86_64-openssl

For go, install go from https://go.dev and log out and log back in. It should then be in the PATH, but if it's not, you will need to add it to the PATH. I haven't gotten go working on on mingw32, but I haven't tried a 32-bit version of go.

For gtlsshd, --sysconfdir has no meaning on Windows. Instead, the sysconf dir is relative to the patch of the executable, in ../etc/gtlssh. So if gtlsshd is in:

C:/Program Files/Gensio/bin/gtlsshd

the sysconfdir will be:

C:/Program Files/Gensio/etc/gtlssh

For standard installation, you can run:

../configure --sbindir=/Gensio/bin --libexecdir=/Gensio/bin \
   --mandir=/Gensio/man --includedir=/Gensio/include \
   --with-pythoninstall=/Gensio/python3 --prefix=/Gensio

and when you run "make install DESTDIR=..." and you set DESTDIR to where you want it to go, like "C:/Program Files". Then you can add that to the PATH using the control panel. To use gtlsshd, you create an etc/gtlsshd directory in the Gensio directory,

For using the Inno Setup Compiler, do "make install DESTDIR=$HOME/install" and then run Inno on gensio.iss. It will create an executable installer for installing Gensio.

Then you need to remove the .la files from the install directory, as they screw up linking with other things:

rm $HOME/install/Gensio/lib/*.la

Running Tests

There are a number of tests for gensios. They currently only run on Linux and require some external tools.

They require the serialsim kernel module and python interface. These are at https://github.com/cminyard/serialsim and allow the tests to use a simulated serial port to read modem control line, inject errors, etc.

You can get by without serialsim if you have three serial devices: one hooked in echo mode (RX and TX tied together) and two serial devices hooked together do I/O on one device goes to/comes from the other. Then set the following environment variables:

export GENSIO_TEST_PIPE_DEVS="/dev/ttyxxx:/dev/ttywww"
export GENSIO_TEST_ECHO_DEV="/dev/ttyzzz"

It will not be able to test modemstate or rs485.

They also require the ipmi_sim program from the OpenIPMI library at https://github.com/cminyard/openipmi to run the ipmisol tests.

To run the tests, you need to enable some internal debugging to get the full effect. You generally want to run something like:

./configure --enable-internal-trace CFLAGS='-g -Wall'

You can turn on -O3 in the CFLAGS, too, if you like, but it makes debugging harder.

There are two basic types of tests. The python tests are functional tests testing both the python interface and the gensio library. Currently they are ok, but there is plenty of room for improvement. If you want to help, you can write tests.

The oomtest used to be an out of memory tester, but has morphed into something more extensive. It spawns a gensiot program with specific environment variables to cause it to fail at certain points, and to do memory leak and other memory checks. It writes data to the gensiot through its stdin and receives data on stdout. Some tests (like serialdev) use an echo. Other tests make a separate connection over the network and data flows both into stdin and comes back over the separate connection, and flows into the separate connection and comes back via stdout. oomtest is multi-threaded and the number of threads can be controlled. oomtest has found a lot of bugs. It has a lot of knobs, but you have to look at the source code for the options. It needs to be documented, if someone would like to volunteer...

Fuzzing

To set up for fuzzing, install afl, then configure with the following:

mkdir Zfuzz; cd Zfuzz
../configure --enable-internal-trace=yes --disable-shared --with-go=no \
    CC=afl-gcc CXX=afl-g++

Or use clang, if available:

../configure --enable-internal-trace=yes --disable-shared --with-go=no \
    CC=afl-clang-fast CXX=afl-clang-fast++ LIBS='-lstdc++'

I'm not sure why the LIBS thing is necessary above, but I had to add it to get it to compile.

Then build. Then "cd tests" and run "make test_fuzz_xxx" where xxx is one of: certauth, mux, ssl, telnet, or relpkt. You will probably need to adjust some things, afl will tell you. Note that it will run forever, you will need to ^C it when you are done.

The makefile in tests/Makefile.am has instructions on how to handle a failure to reproduce for debugging.

Code Coverage

Running code coverage on the library is pretty easy. First you need to configure the code to enable coverage:

mkdir Ocov; cd Ocov
../configure --enable-internal-trace=yes \
    CC='gcc -fprofile-arcs -ftest-coverage' \
    CXX='g++ -fprofile-arcs -ftest-coverage'

The compile and run "make check".

To generate the report, run:

gcovr -f '.*/.libs/.*' -e '.*python.*'

This will generate a summary. If you want to see the coverage of individual lines in a file, you can do:

cd lib
gcov -o .libs/ *.o

You can look in the individual .gcov files created for information about what is covered. See the gcov docs for detail.

At the time of writing, I was getting about 74% code coverage, So that's really pretty good. I'll be working to improve that, mostly through improved functional testing.

ser2net is used for testing some things, primarily the serial port configuration (termios and rfc2217). You can build ser2net against the gcov version of the gensio library and run "make check" in ser2net to get coverage on those parts. With that, I'm seeing about 76% coverage, so it doesn't add much to the total.

It would be nice to be able to combine this with fuzzing, but I'm not sure how to do that. afl does it's own thing with code coverage. There appears to be a afl-cov package that somehow integrated gcov, but I haven't looked into it.

gensio's People

Contributors

aeberlemw avatar cminyard avatar ffontaine avatar jameshilliard avatar jluebbe avatar kaechele avatar kraj avatar majenkotech avatar masenf avatar mhei avatar morganchristiansson avatar seekingmeaning avatar yegorich avatar zugschlus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gensio's Issues

manual pages installed as copy?

Hi,

I have noticed that many of the gensio_os_funcs*.3 manual pages get installed as regular files, leading to the same content being installed multiple times. Other manual pages get installed as symlinks.

Is this the intended behavior or a toolchain bug?

Greetings
Marc

Feature Request: Add Multicast TTL option

Looks like multicast works great, (using ser2net). But I don't see an option for setting the Multicast TTL value. Am I missing it? I'm assuming it is set to 1 by default?

It would be nice to be able to modify this value.
An example could be:

udp(mcast=224.0.0.2,laddr='ipv4,3000',mttl=5),224.0.0.2,3000

gensio_os_funcs_wake() not waiking up the waiter in another thread.

I'm doing some experimenting with the library, and I initialize the waiter and then start it in another thread.
Something like this:

static void vser_dummy_thread(void *args)
{
    int rc = gensio_os_funcs_wait(vser_os_funcs, vser_waiter, 1, NULL);
    printf("WAITER RETURN: %d\n", rc);
}
 
int main() {
...
   rc = gensio_default_os_hnd(0, &vser_os_funcs);
    if (rc) {
        err_str = "vser init could not allocate OS handler";
        goto rc_error_out;
    }

    gensio_os_funcs_set_vlog(vser_os_funcs, vser_vlog);

    rc = gensio_os_proc_setup(vser_os_funcs, &vser_proc_data);
    if (rc) {
        err_str = "vser could not setup process data";
        goto rc_error_out;
    }

    vser_waiter = gensio_os_funcs_alloc_waiter(vser_os_funcs);
    if (!vser_waiter) {
        err_str = "vser could not allocate waiter";
	rc = GE_NOMEM;
	goto rc_error_out;
    }

    rc = gensio_os_new_thread(vser_os_funcs, vser_dummy_thread, NULL,
                              &vser_tid);
    if (rc) {
        err_str = "vser could not initialize service thread";
	goto rc_error_out;
    }

The thread does not seem to return when calling gensio_os_funcs_wake(vser_os_funcs, vser_waiter) until there is some IO happening. Is this by design, or am I doing something wrong?

gensio-1.1 patch for configure --with-tcp-wrappers

When building with the configure --with-tcp-wrappers option, the following patch is needed.

--- gensio-1.1/lib/gensio_osops.c       2019-03-22 13:45:46.000000000 -0700
+++ gensio-1.1+tcp-wrappers/lib/gensio_osops.c  2019-05-18 14:39:18.870397424 -0700
@@ -37,6 +37,11 @@
 #include <netinet/sctp.h>
 #endif

+#ifdef HAVE_TCPD_H
+#include <tcpd.h>
+static char *progname = "gensio";
+#endif /* HAVE_TCPD_H */
+
 #include <gensio/gensio_osops.h>

 static int

man syntax warnings

Hi,

checking the man page for man/gensio_set_sync.3 gives a warning:
LC_ALL=en_US.UTF-8 MANROFFSEQ='' MANWIDTH=80 man --warnings -E UTF-8 -l -Tutf8 -Z man/gensio_set_sync.3 >/dev/null troff: :55: warning: macro '..' not defined

I guess this is missing leading whitespace, as this patch here:

--- gensio_set_sync.3   2020-09-26 17:57:52.324897967 +0200
+++ man/gensio_set_sync.3       2020-09-26 16:24:39.344583049 +0200
@@ -52,7 +52,7 @@
    call fd1_write_handler()
 .br
 if (fd2 read is set)
-   ...
+...
 .PP
 The gensio handling does all this for you.  Just register a handler
 with the gensio to get the read and write calls.  It's more efficient,

Fixes the warning and the output looks more as it was intended.

Similiar issues can be fixed by applying the following trivial patches:

--- a/man/gensio.5
+++ b/man/gensio.5
@@ -123,7 +123,7 @@ Some gensio types support serial port se
 serial ports, IPMI Serial Over LAN, and telnet with RFC2217 enabled.
 
 A client serial gensio can set and get serial port options using the
-.Bsergensio_xxx()
+.B sergensio_xxx()
 functions.  Server serial gensios receive requests from the client via
 .I GENSIO_EVENT_SER_xxx
 events in the callback.
@@ -517,7 +517,7 @@ A file will be created with the given so
 permissions to create a writeable file in that location.  If the file
 already exists, an error will be returned on an accepter socket unless
 you specify
-.i delsock
+.I delsock
 which will cause the file to be deleted.
 
 You should read the unix(7) man page for details on the semantics of

trying to compile in slackware 14.2 gives error

hi, i did an ./configure && make, and got this error, any idea?

# ./configure
checking for a BSD-compatible install... /usr/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/x86_64-slackware-linux/bin/ld
checking if the linker (/usr/x86_64-slackware-linux/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/x86_64-slackware-linux/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/x86_64-slackware-linux/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking linux/version.h usability... yes
checking linux/version.h presence... yes
checking for linux/version.h... yes
checking for Linux epoll(7) interface with signals extension... yes
checking whether gcc is Clang... no
checking whether pthreads work with "-pthread" and "-lpthread"... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking whether more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
checking OpenIPMI/ipmiif.h usability... no
checking OpenIPMI/ipmiif.h presence... no
checking for OpenIPMI/ipmiif.h... no
checking for pkg-config... /usr/bin/pkg-config
checking whether compiling and linking against OpenSSL works... yes
checking for library containing clock_gettime... none required
checking whether TIOCSRS485 is declared... yes
checking whether make supports nested variables... (cached) yes
checking for ANSI C header files... (cached) yes
checking for main in -lnsl... yes
checking for swig... /usr/bin/swig
checking SWIG version... 3.0.7
checking for SWIG library... /usr/share/swig/3.0.7
checking for python3... no
checking for python... /usr/bin/python
checking for a version of Python >= '2.1.0'... yes
checking for the distutils Python package... yes
checking for Python include path... -I/usr/include/python2.7
checking for Python library path... -L/usr/lib64 -lpython2.7
checking for Python site-packages path... /usr/lib64/python2.7/site-packages
checking python extra libraries... -lpthread -ldl  -lutil -lm
checking python extra linking flags... -Xlinker -export-dynamic
checking consistency of all components of python development environment... yes
checking for python version... 2.7.11
checking for python threads... yes
checking for sctp_bindx in -lsctp... no
checking for pam_start in -lpam... no
checking for getrandom... no
checking for ptsname_r... yes
checking for cfmakeraw... yes
checking for struct termios2.c_ispeed... yes
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking for isatty... yes
checking for strcasecmp... yes
checking for strncasecmp... yes
checking for prctl... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating lib/libgensio.pc
config.status: creating lib/Makefile
config.status: creating include/Makefile
config.status: creating include/gensio/Makefile
config.status: creating include/gensio/gensio_version.h
config.status: creating tests/Makefile
config.status: creating tools/Makefile
config.status: creating swig/Makefile
config.status: creating swig/python/Makefile
config.status: creating man/Makefile
config.status: creating examples/Makefile
config.status: creating tests/runtest
config.status: creating tests/gensios_enabled.py
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
# make
make  all-recursive
make[1]: Entering directory '/root/gensio-master'
Making all in lib
make[2]: Entering directory '/root/gensio-master/lib'
  CC       gensio.lo
  CC       gensio_osops.lo
  CC       gensio_net.lo
  CC       gensio_udp.lo
  CC       gensio_stdio.lo
  CC       sergensio.lo
  CC       sergensio_telnet.lo
  CC       sergensio_serialdev.lo
  CC       uucplock.lo
  CC       gensio_selector.lo
  CC       gensio_ssl.lo
  CC       gensio_base.lo
  CC       gensio_filter_ssl.lo
  CC       gensio_filter_telnet.lo
  CC       telnet.lo
  CC       buffer.lo
  CC       gensio_ll_fd.lo
  CC       gensio_ll_gensio.lo
  CC       gensio_acc.lo
  CC       gensio_acc_gensio.lo
  CC       gensio_ll_ipmisol.lo
  CC       sergensio_ipmisol.lo
  CC       utils.lo
  CC       selector.lo
  CC       gensio_sctp.lo
  CC       gensio_filter_certauth.lo
  CC       gensio_certauth.lo
  CC       gensio_pty.lo
  CC       gensio_dummy.lo
  CC       gensio_echo.lo
  CC       gensio_mux.lo
  CC       gensio_file.lo
  CC       gensio_filter_msgdelim.lo
  CC       gensio_msgdelim.lo
  CC       gensio_filter_relpkt.lo
  CC       gensio_relpkt.lo
  CC       gensio_filter_trace.lo
  CC       gensio_trace.lo
  CC       gensio_filter_perf.lo
  CC       gensio_perf.lo
  CC       gensio_conacc.lo
  CCLD     libgensio.la
make[2]: Leaving directory '/root/gensio-master/lib'
Making all in include
make[2]: Entering directory '/root/gensio-master/include'
Making all in gensio
make[3]: Entering directory '/root/gensio-master/include/gensio'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/root/gensio-master/include/gensio'
make[3]: Entering directory '/root/gensio-master/include'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/root/gensio-master/include'
make[2]: Leaving directory '/root/gensio-master/include'
Making all in swig
make[2]: Entering directory '/root/gensio-master/swig'
Making all in .
make[3]: Entering directory '/root/gensio-master/swig'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/root/gensio-master/swig'
Making all in python
make[3]: Entering directory '/root/gensio-master/swig/python'
/usr/bin/swig -DHAVE_CONFIG_H -python  -o gensio_wrap.c \
        -I../../swig/python ../../swig/gensio.i
  CC       gensio_wrap.lo
  CCLD     _gensio.la
make[3]: Leaving directory '/root/gensio-master/swig/python'
make[2]: Leaving directory '/root/gensio-master/swig'
Making all in tests
make[2]: Entering directory '/root/gensio-master/tests'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/root/gensio-master/tests'
Making all in tools
make[2]: Entering directory '/root/gensio-master/tools'
  CC       ioinfo.o
  CC       ser_ioinfo.o
  CC       utils.o
  CC       localports.o
  AR       libgensiotool.a
  CC       gtlssh-shared.o
  AR       libgtlssh.a
  CC       gensiotool.o
gensiotool.c:95:13: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
     .seed = dummyrnd_seed,
             ^
gensiotool.c:95:13: note: (near initialization for 'dummyrnd.seed')
gensiotool.c:98:12: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
     .add = dummyrnd_add,
            ^
gensiotool.c:98:12: note: (near initialization for 'dummyrnd.add')
  CCLD     gensiot
  CC       gtlssh.o
gtlssh.c: In function 'check_cert_expiry':
gtlssh.c:305:9: warning: implicit declaration of function 'X509_get0_notAfter' [-Wimplicit-function-declaration]
     t = X509_get0_notAfter(x);
         ^
gtlssh.c:305:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     t = X509_get0_notAfter(x);
       ^
  CCLD     gtlssh
gtlssh.o: In function `check_cert_expiry':
/root/gensio-master/tools/gtlssh.c:305: undefined reference to `X509_get0_notAfter'
collect2: error: ld returned 1 exit status
Makefile:576: recipe for target 'gtlssh' failed
make[2]: *** [gtlssh] Error 1
make[2]: Leaving directory '/root/gensio-master/tools'
Makefile:441: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/gensio-master'
Makefile:373: recipe for target 'all' failed
make: *** [all] Error 2
 

Minor: gensiot -h prints help menu twice then segfaults

Version 2.2.7

$ gensiot -h

gensiot [options] io2

A program to connect gensios together.  This programs has two
gensios, io1 (default is local terminal) and io2 (must be set).

options are:
  -i, --input <gensio> - Set the io1 device, default is
    serialdev,/dev/tty for tty or stdio(self) for non-tty stdin
  -d, --debug - Enable debug.  Specify more than once to increase
    the debug level
  -a, --accepter - Accept a connection on io2 instead of initiating a connection
  -p, --printacc - When the accepter is started, print out all the addresses being listened on.
  -l, --printlocaddr - When the connection opens, print out all the local addresses.
  -r, --printremaddr - When the connection opens, print out all the remote addresses.
  -v, --verbose - Print all gensio logs
  --signature <sig> - Set the RFC2217 server signature to <sig>
  -e, --escchar - Set the local terminal escape character.
    Set to -1 to disable the escape character
    Default is ^\ for tty stdin and disabled for non-tty stdin
  -h, --help - This help
No gensio string given to connect to
gensiot [options] io2

A program to connect gensios together.  This programs has two
gensios, io1 (default is local terminal) and io2 (must be set).

options are:
  -i, --input <gensio> - Set the io1 device, default is
    serialdev,/dev/tty for tty or stdio(self) for non-tty stdin
  -d, --debug - Enable debug.  Specify more than once to increase
    the debug level
  -a, --accepter - Accept a connection on io2 instead of initiating a connection
  -p, --printacc - When the accepter is started, print out all the addresses being listened on.
  -l, --printlocaddr - When the connection opens, print out all the local addresses.
  -r, --printremaddr - When the connection opens, print out all the remote addresses.
  -v, --verbose - Print all gensio logs
  --signature <sig> - Set the RFC2217 server signature to <sig>
  -e, --escchar - Set the local terminal escape character.
    Set to -1 to disable the escape character
    Default is ^\ for tty stdin and disabled for non-tty stdin
  -h, --help - This help
Segmentation fault

tools/greflector.1

Hi,

the manual page tools/greflector.1 seems to be in a strange place (should it not be in man?), and, probably as result to the strange placement, it doesn't get installed. Is that intended?

Greetings
Marc

Feature Request: echo filter

I've some RS-485 hardware which always echos back each byte which is actually sent out.
I'm wondering whether it could be implemented as additional, stackable filter or as option for serialdev?

tcp,::1,portnum only listens on IPv6

Hi,

In Debian, I would like to have ser2net listen on localhost only in the default configuration. Most services, when configured to listen on "::1", the IPv6 localhost address, will also accept connections to 127.0.0.1. ser2net doesn't.

I think this can be set by some TCP socket option. Sorry that I cannot be of more help here, I am not a programmer.

Please consider adding this option so that listening to ::1 will also allow IPv4 to be used.

Greetings
Marc

Support: Cross compile gensio lib for Windows

In order to implement a Windows client for connecting to ser2net using certauth I try to build a Windows library of gensio. I did the following steps (on a recent debian testing installation) but make always fails with serveral compilation erroros:

  1. Checkout tag v.2.2.4
  2. Run autoreconf -i
  3. Run configure using mingw as target and host: ./configure --target=i686-w64-mingw64 --host=i686-w64-mingw64 --without-python --without-swig
  4. Run make
  5. Compilation error, e.g.
gensio_osops.c:17:10: fatal error: termios.h: Datei oder Verzeichnis nicht gefunden
   17 | #include <termios.h>
      |          ^~~~~~~~~~~
compilation terminated.

I think there is something wrong with my configure command. Do you have any suggestions how to correctly cross compile the lib for Windows?

Build failure: ld: ../lib/.libs/libgensio.so: undefined reference to `ipmisol_gensio_ll_set_sio'

Hi, I maintain the gensio and ser2net packages for NixOS, during a bump to 2.2.1 the library does currently not build:

these derivations will be built:
  /nix/store/z6hbjfk10hs4jjhg0snclzjiija2fncg-gensio-2.2.1.drv
  /nix/store/8jxizl2gm2ah9p5axzp8gq3hxyhppacw-ser2net-4.3.0.drv
building '/nix/store/z6hbjfk10hs4jjhg0snclzjiija2fncg-gensio-2.2.1.drv'...
unpacking sources
unpacking source archive /nix/store/2xqrf67xyikp7yb3v42v6rpm15i03nvv-source
source root is source
patching sources
autoreconfPhase
autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: configure.ac: not using Intltool
autoreconf: configure.ac: not using Gtkdoc
autoreconf: running: aclocal --force -I m4
autoreconf: running: /nix/store/86kvkyhgg3n679slw5n46ddffp78hcy0-autoconf-2.70/bin/autoconf --force
configure.ac:10: warning: The macro `AM_PROG_LIBTOOL' is obsolete.
configure.ac:10: You should run autoupdate.
m4/libtool.m4:100: AM_PROG_LIBTOOL is expanded from...
configure.ac:10: the top level
configure.ac:25: warning: The macro `AC_HAVE_HEADERS' is obsolete.
configure.ac:25: You should run autoupdate.
./lib/autoconf/oldnames.m4:35: AC_HAVE_HEADERS is expanded from...
configure.ac:25: the top level
configure.ac:76: warning: $as_echo is obsolete; use AS_ECHO(["message"]) instead
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2248: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2269: AC_CACHE_CHECK is expanded from...
m4/ax_pthread.m4:89: AX_PTHREAD is expanded from...
configure.ac:76: the top level
configure.ac:201: warning: The macro `AC_STDC_HEADERS' is obsolete.
configure.ac:201: You should run autoupdate.
./lib/autoconf/oldnames.m4:75: AC_STDC_HEADERS is expanded from...
configure.ac:201: the top level
configure.ac:201: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:201: You should run autoupdate.
./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
./lib/autoconf/oldnames.m4:75: AC_STDC_HEADERS is expanded from...
configure.ac:201: the top level
configure.ac:428: warning: AC_OUTPUT should be used without arguments.
configure.ac:428: You should run autoupdate.
autoreconf: running: /nix/store/86kvkyhgg3n679slw5n46ddffp78hcy0-autoconf-2.70/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:9: installing './ar-lib'
configure.ac:8: installing './compile'
configure.ac:10: installing './config.guess'
configure.ac:10: installing './config.sub'
configure.ac:6: installing './install-sh'
configure.ac:6: installing './missing'
Makefile.am: installing './INSTALL'
examples/Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
autoreconf: './config.sub' is updated
autoreconf: './config.guess' is updated
autoreconf: Leaving directory '.'
configuring
fixing libtool script ./ltmain.sh
configure flags: --disable-static --disable-dependency-tracking --prefix=/nix/store/fmzcwji56ipms62fj526cizx6jyb49wd-gensio-2.2.1 --with-python=no
checking for a BSD-compatible install... /nix/store/0rrv6ycny1mf7hwqk67717z9bn08vc9w-coreutils-8.32/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /nix/store/0rrv6ycny1mf7hwqk67717z9bn08vc9w-coreutils-8.32/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... none
checking the archiver (ar) interface... ar
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /nix/store/56l3lzjaw1ynh4m5937djgi29kq9p1bd-gnused-4.8/bin/sed
checking for grep that handles long lines and -e... /nix/store/28ydlbwk132phwhwpj9bbb3n964f1wsl-gnugrep-3.6/bin/grep
checking for egrep... /nix/store/28ydlbwk132phwhwpj9bbb3n964f1wsl-gnugrep-3.6/bin/grep -E
checking for fgrep... /nix/store/28ydlbwk132phwhwpj9bbb3n964f1wsl-gnugrep-3.6/bin/grep -F
checking for ld used by gcc... ld
checking if the linker (ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... nm
checking the name lister (nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse nm output from gcc object... ok
checking for sysroot... no
checking for a working dd... /nix/store/0rrv6ycny1mf7hwqk67717z9bn08vc9w-coreutils-8.32/bin/dd
checking how to truncate binary pipes... /nix/store/0rrv6ycny1mf7hwqk67717z9bn08vc9w-coreutils-8.32/bin/dd bs=4096 count=1
./configure: line 7485: /usr/bin/file: No such file or directory
checking for mt... no
checking if : is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for linux/version.h... yes
checking for Linux epoll(7) interface with signals extension... yes
checking how to run the C preprocessor... gcc -E
checking whether gcc is Clang... no
checking whether pthreads work with "-pthread" and "-lpthread"... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking whether more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
checking for OpenIPMI/ipmiif.h... no
checking for pkg-config... no
checking for openssl/ssl.h in /usr/local/ssl... no
checking for openssl/ssl.h in /usr/lib/ssl... no
checking for openssl/ssl.h in /usr/ssl... no
checking for openssl/ssl.h in /usr/pkg... no
checking for openssl/ssl.h in /usr/local... no
checking for openssl/ssl.h in /usr... no
checking whether compiling and linking against OpenSSL works... no
checking for library containing clock_gettime... none required
checking how gcc reports undeclared, standard C functions... error
checking whether TIOCSRS485 is declared... yes
checking whether make supports nested variables... (cached) yes
checking for egrep... (cached) /nix/store/28ydlbwk132phwhwpj9bbb3n964f1wsl-gnugrep-3.6/bin/grep -E
checking for main in -lnsl... no
checking for avahi_client_new in -lavahi-client... no
checking for swig... no
checking for swig3.0... no
checking for swig2.0... no
checking for sctp_bindx in -lsctp... no
checking for pam_start in -lpam... no
checking for getrandom... yes
checking for ptsname_r... yes
checking for cfmakeraw... yes
checking for signalfd... yes
checking for regexec... yes
checking for fnmatch... yes
checking for struct termios2.c_ispeed... yes
checking for sys/un.h... yes
checking for isatty... yes
checking for strcasecmp... yes
checking for strncasecmp... yes
checking for prctl... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating lib/libgensio.pc
config.status: creating lib/Makefile
config.status: creating include/Makefile
config.status: creating include/gensio/Makefile
config.status: creating include/gensio/gensio_version.h
config.status: creating tests/Makefile
config.status: creating tools/Makefile
config.status: creating swig/Makefile
config.status: creating swig/python/Makefile
config.status: creating man/Makefile
config.status: creating examples/Makefile
config.status: creating tests/runtest
config.status: creating tests/gensios_enabled.py
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
building
build flags: SHELL=/nix/store/zcl19h06322c3kss6bvf05w2pxg4kfll-bash-4.4-p23/bin/bash
make  all-recursive
make[1]: Entering directory '/build/source'
Making all in lib
make[2]: Entering directory '/build/source/lib'
  CC       gensio.lo
  CC       gensio_osops.lo
  CC       gensio_net.lo
  CC       gensio_udp.lo
  CC       gensio_stdio.lo
  CC       sergensio.lo
  CC       sergensio_telnet.lo
  CC       sergensio_serialdev.lo
  CC       uucplock.lo
  CC       gensio_selector.lo
  CC       gensio_ssl.lo
  CC       gensio_base.lo
  CC       gensio_filter_ssl.lo
  CC       gensio_filter_telnet.lo
  CC       telnet.lo
  CC       buffer.lo
  CC       gensio_ll_fd.lo
  CC       gensio_ll_gensio.lo
  CC       gensio_acc.lo
  CC       gensio_acc_gensio.lo
  CC       gensio_ll_ipmisol.lo
  CC       sergensio_ipmisol.lo
  CC       utils.lo
  CC       selector.lo
  CC       gensio_sctp.lo
  CC       gensio_filter_certauth.lo
  CC       gensio_certauth.lo
  CC       gensio_pty.lo
  CC       gensio_dummy.lo
  CC       gensio_echo.lo
  CC       gensio_mux.lo
  CC       gensio_file.lo
  CC       gensio_filter_msgdelim.lo
  CC       gensio_msgdelim.lo
  CC       gensio_filter_relpkt.lo
  CC       gensio_relpkt.lo
  CC       gensio_filter_trace.lo
  CC       gensio_trace.lo
  CC       gensio_filter_perf.lo
  CC       gensio_perf.lo
  CC       gensio_conacc.lo
  CC       errtrig.lo
  CC       mdns.lo
  CC       avahi_watcher.lo
  CC       gensio_mdns.lo
  CCLD     libgensio.la
make[2]: Leaving directory '/build/source/lib'
Making all in include
make[2]: Entering directory '/build/source/include'
Making all in gensio
make[3]: Entering directory '/build/source/include/gensio'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/build/source/include/gensio'
make[3]: Entering directory '/build/source/include'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/build/source/include'
make[2]: Leaving directory '/build/source/include'
Making all in tests
make[2]: Entering directory '/build/source/tests'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/build/source/tests'
Making all in tools
make[2]: Entering directory '/build/source/tools'
  CC       gensiotool.o
  CC       ioinfo.o
  CC       ser_ioinfo.o
  CC       utils.o
  CC       localports.o
  AR       libgensiotool.a
ar: `u' modifier ignored since `D' is the default (see `U')
  CCLD     gensiot
/nix/store/4l1qrgxfy171bngpphp4p9wj7bhrlfn3-binutils-2.34/bin/ld: ../lib/.libs/libgensio.so: undefined reference to `ipmisol_gensio_ll_set_sio'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:596: gensiot] Error 1
make[2]: Leaving directory '/build/source/tools'
make[1]: *** [Makefile:458: all-recursive] Error 1
make[1]: Leaving directory '/build/source'
make: *** [Makefile:390: all] Error 2

Unable to build on macos

Hello !

Today I tried to build gensio on macos, but it failed.

steps:

git clone;

autoreconf -i 
./configure
make

And here's the output of make :

/Library/Developer/CommandLineTools/usr/bin/make  all-recursive
Making all in lib
  CC       gensio.lo
  CC       gensio_osops.lo
gensio_osops.c:897:37: error: use of undeclared identifier 'IPV6_ADD_MEMBERSHIP'
                rv = setsockopt(fd, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP,
                                                  ^
gensio_osops.c:953:37: error: use of undeclared identifier 'IPV6_ADD_MEMBERSHIP'
                rv = setsockopt(fd, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP,
                                                  ^
gensio_osops.c:1089:43: warning: passing 'gid_t *' (aka 'unsigned int *') to parameter of type 'int *' converts between pointers to integer types with different sign [-Wpointer-sign]
    getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroup);
                                          ^~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:650:43: note: passing argument to parameter here
int      getgrouplist(const char *, int, int *, int *);
                                              ^
gensio_osops.c:1095:46: warning: passing 'gid_t *' (aka 'unsigned int *') to parameter of type 'int *' converts between pointers to integer types with different sign [-Wpointer-sign]
        err = getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroup);
                                                    ^~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:650:43: note: passing argument to parameter here
int      getgrouplist(const char *, int, int *, int *);
                                              ^
2 warnings and 2 errors generated.
make[2]: *** [gensio_osops.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Is it because it's trying to use macos building-tools and libraries?

Thanks!

Packets sent to network in bursts with long delay

Hi. I installed ser2net on Ubuntu 22.04 using apt, and its showing version 4.3.4. I'm sending serial data to my PC and using the following ser2net settings.

connection: &con0096
    accepter: udp,2000
    enable: on
    options:
      banner: *banner
      kickolduser: true
      telnet-brk-on-sync: true
    connector: serialdev,
              /dev/ttyUSB0,
              115200n82,local

The serial data is packets typically 40 bytes long (around 3 milliseconds) with 7 milliseconds spacing between packets and 115200 baud. I am able to send this stream over the network between PC1 and PC2, and I can capture the incoming and outgoing streams on my oscilloscope. Here are the serial port settings shown by stty

speed 115200 baud; rows 0; columns 0; line = 0;
intr = <undef>; quit = <undef>; erase = <undef>; kill = <undef>; eof = <undef>; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q;
stop = ^S; susp = <undef>; rprnt = <undef>; werase = <undef>; lnext = <undef>; discard = <undef>; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl cstopb cread clocal -crtscts
ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke -flusho -extproc

The problem I'm seeing is that ser2net appears to buffer the serial data for around 100ms or so before putting it on the network. I verfied that ser2net is the source of the issue by running a wireshark capture on the ethernet port that ser2net directly puts data on. The UDP packets are properly split up, but they are being sent in bursts. See the example below. While the individual UDP packets are properly split up, they are coming in bursts instead of with the timing on the serial port. I have tried playing with some of ser2net's configuration options, but I haven't found anything that helps.

Is this normal behavior, or perhaps a known issue? Thanks!

Screenshot from 2023-11-10 12-01-07

debian error compiling gensio_ll_ipmisol.c

debian 9.9 4.9.0-9-amd64
gensio_ll_ipmisol.c:1261:13: error: ‘ipmi_con_t {aka struct ipmi_con_s}’ has no member named ‘disable’ solll->ipmi->disable(solll->ipmi);

./configure --with-openipmi=no compiles fine

dpkg -l | grep ii | grep ipmi

ii freeipmi-common 1.4.11-1.1+b1 amd64 GNU implementation of the IPMI protocol - common files
ii libfreeipmi-dev 1.4.11-1.1+b1 amd64 GNU IPMI - development package
ii libfreeipmi16 1.4.11-1.1+b1 amd64 GNU IPMI - libraries
ii libopenipmi-dev 2.0.22-1.1 amd64 Intelligent Platform Management Interface - development
ii libopenipmi0 2.0.22-1.1 amd64 Intelligent Platform Management Interface - runtime
ii openipmi 2.0.22-1.1 amd64 Intelligent Platform Management Interface (for servers)

symbol visibility in C++

Hi,

I don't understand much of what I am writing now. gensio is my first library package that I am packaging for a distribution.

Debian writes (see https://wiki.debian.org/UsingSymbolsFiles):

Proper visibility for C++ symbols

If your upstream is on board with this, they should be building with -fvisibility=hidden,
and decorate everything intentionally public with a macro that (when building with
gcc or clang) expands to __attribute__((__visibility__("default"))).

Some upstreams will be doing something similar already, because they are
portable to Windows and need to decorate public symbols with
__declspec(dllexport) on Windows. 

I at least dont see the -fvisibility=hidden setting in the gensio Makefiles, but I might be looking for the wrong thing. Can you please tell me whether you're already doing this and whether you would consider to do that to ease packaging. Thank you very much.

Greetings
Marc

Session end on failing TIOCCBRK

I am using a setup where I start a generic ser2net for each serial port.

A rather long time ago a failing TIOCCBRK would not end the session:

gensio/ChangeLog

Lines 398 to 400 in 08285ec

2006-01-09 Corey Minyard <[email protected]>
* dataxfer.c: Don't kill the session if TIOCCBRK doesn't work.

This seems to be different now:

gensio/lib/gensio_osops.c

Lines 1963 to 1973 in 3f6c3ce

*((int *) val) = t->break_set;
} else {
if (val)
nval = TIOCSBRK;
else
nval = TIOCCBRK;
if (ioctl(fd, nval) == -1) {
if (errno != ENOTTY) /* Happens with PTYs. */
return gensio_os_err_to_err(o, errno);
}
t->break_set = nval;

..leading to:

openat(AT_FDCWD, "/dev/ttyACM0", O_RDWR|O_NOCTTY|O_NONBLOCK) = 9
ioctl(9, TCGETS2, {B9600 opost isig icanon echo ...}) = 0
ioctl(9, TCSETS2, {B115200 -opost -isig -icanon -echo ...}) = 0
ioctl(9, TIOCCBRK)                      = -1 EPIPE (Broken pipe)
ioctl(9, TCSETS2, {B9600 opost isig icanon echo ...}) = 0
close(9)                                = 0
sendmsg(8, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\377\373\3\377\375\3\377\373\1\377\376\1\377\375\0\377\373\0\377\375,", iov_len=21}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 21
sendmsg(8, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="Device open failure: Remote end "..., iov_len=51}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 51

Should a failing TIOCCBRK really be fatal?

macOS compilation issues

(continuation of https://sourceforge.net/p/ser2net/discussion/90083/thread/f3ae30894e/)

Seeing on 10.15:

../../c++/include/gensio/gensio:722:10: error: exception specification of overriding function is more lax than base version
        virtual ~Serial_Event() = default;
                ^
gensio.cc:432:52: error: non-aggregate type 'std::map<std::string, gensio_allocator>' (aka 'map<basic_string<char, char_traits<char>, allocator<char> >, gensio::Gensio *(*)(gensio::Os_Funcs &, struct gensio *)>')
      cannot be initialized with an initializer list
    static std::map<std::string, gensio_allocator> classes = {
                                                   ^         ~
gensio.cc:1133:11: error: exception specification of overriding function is more lax than base version
    class Std_Ser_Op_Done: public Serial_Op_Done {
          ^
../../c++/include/gensio/gensio:731:10: note: overridden virtual function is here
        virtual ~Serial_Op_Done() = default;
                ^
gensio.cc:1563:56: error: non-aggregate type 'std::map<std::string, gensio_acc_allocator>' (aka 'map<basic_string<char, char_traits<char>, allocator<char> >, gensio::Accepter *(*)(gensio::Os_Funcs &, struct
      gensio_accepter *)>') cannot be initialized with an initializer list
    static std::map<std::string, gensio_acc_allocator> acc_classes = {
                                                       ^             ~

libtool files installed to package?

Make install puts the examples subdirectory into the install target including Makefiles and libtool output:

debian/libgensio-dev/usr/share/doc/libgensio-dev/examples
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/c++
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/c++/Makefile.in
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/c++/mdns
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/c++/mdns.cc
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/c++/telnet_server
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/c++/CMakeLists.txt
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/c++/Makefile.am
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/c++/telnet_client.cc
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/c++/Makefile
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/c++/telnet_server.cc
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/c++/telnet_client
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/Makefile.in
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/basic_server.c
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/CMakeLists.txt
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/basic_server
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/basic_client.py
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/basic_client
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/Makefile.am
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/basic_client.c
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/LICENSE.apache
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/basic_server.py
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/basic_server_sync.c
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/basic_server_sync
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/basic_server_sync_fork
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/Makefile
debian/libgensio-dev/usr/share/doc/libgensio-dev/examples/basic_server_sync_fork.c

Is this intended? Since those files contain information about the build path, it breaks the reproducibility of the build.

Greetings
Marc

spelling error in manpage

Hi,

in gensio_os_funcs.3 there is once "alrady" instead of "already".

Also, in gensio.5, I think that ".B::1" is actually meant to be ".B ::1", right?

Sorry for not filing a merge request for this ;-)

Greetings
Marc

Fails to build with "Error: Unable to find 'gensio_base.i'"

Trying to build from HEAD (7e88102). After successfully running ./reconf followed by ./configure --prefix=/usr/local/pkg/gensio, gensio fails to build with:

$ make
.
.
.
go mod tidy
go: found github.com/cminyard/go/gensio in github.com/cminyard/go/gensio v0.0.0-00010101000000-000000000000
go build example.go
# github.com/cminyard/go/gensio
gensio.swigcxx:45: Error: Unable to find 'gensio_base.i'
make[5]: *** [Makefile:601: example] Error 1
make[5]: Leaving directory '/home/lars/tmp/gensio/c++/swig/go/examples'
make[4]: *** [Makefile:479: all-recursive] Error 1
make[4]: Leaving directory '/home/lars/tmp/gensio/c++/swig/go'
make[3]: *** [Makefile:475: all-recursive] Error 1
make[3]: Leaving directory '/home/lars/tmp/gensio/c++/swig'
make[2]: *** [Makefile:475: all-recursive] Error 1
make[2]: Leaving directory '/home/lars/tmp/gensio/c++'
make[1]: *** [Makefile:534: all-recursive] Error 1
make[1]: Leaving directory '/home/lars/tmp/gensio'
make: *** [Makefile:466: all] Error 2

I see the mentioned file in ./c++/swig/include/gensio_base.i.

Running ./configure --without-go ... allows the build to complete without errors.

Fail to build on gentoo x86_64 and arm

On my gentoo x86_64 (and arm also), gensio master fail to build:
repository: https://github.com/cminyard/gensio.git
at the commit: 9ecf524

Source unpacked in /var/tmp/portage/dev-libs/gensio-9999/work
Preparing source in /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999 ...

  • Source directory (CMAKE_USE_DIR): "/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999"
  • Build directory (BUILD_DIR): "/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build"

Source prepared.
Configuring source in /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999 ...

  • Source directory (CMAKE_USE_DIR): "/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999"
  • Build directory (BUILD_DIR): "/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build"
    cmake -C /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/gentoo_common_config.cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/gentoo_toolchain.cmake /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999
    loading initial cache file /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/gentoo_common_config.cmake
    -- The C compiler identification is GNU 11.2.1
    -- The CXX compiler identification is GNU 11.2.1
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /usr/bin/x86_64-pc-linux-gnu-gcc - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: /usr/bin/x86_64-pc-linux-gnu-g++ - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found PkgConfig: /usr/bin/x86_64-pc-linux-gnu-pkg-config (found version "1.8.0")
    -- Found Tclsh: /usr/bin/tclsh (found version "8.6")
    -- Found TCL: /usr/lib64/libtcl.so
    -- Could NOT find TCLTK (missing: TK_LIBRARY TK_INCLUDE_PATH)
    -- Could NOT find TK (missing: TK_LIBRARY TK_INCLUDE_PATH)
    -- Looking for tcpd.h
    -- Looking for tcpd.h - found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Looking for sys/epoll.h
    -- Looking for sys/epoll.h - found
    -- Checking for module 'glib-2.0'
    -- Found glib-2.0, version 2.70.4
    -- Looking for ipmi_alloc_os_handler in OpenIPMI
    -- Looking for ipmi_alloc_os_handler in OpenIPMI - not found
    -- Looking for OpenIPMI/ipmiif.h
    -- Looking for OpenIPMI/ipmiif.h - not found
    -- Looking for SSL_connect in ssl
    -- Looking for SSL_connect in ssl - found
    -- Looking for X509_verify_cert in crypto
    -- Looking for X509_verify_cert in crypto - found
    -- Looking for openssl/ssl.h
    -- Looking for openssl/ssl.h - found
    -- Looking for openssl/x509.h
    -- Looking for openssl/x509.h - found
    -- Looking for avahi_client_new in avahi-client
    -- Looking for avahi_client_new in avahi-client - not found
    -- Looking for avahi_malloc in avahi-common
    -- Looking for avahi_malloc in avahi-common - not found
    -- Looking for avahi-client/client.h
    -- Looking for avahi-client/client.h - not found
    -- Looking for avahi-common/malloc.h
    -- Looking for avahi-common/malloc.h - not found
    -- Found SWIG: /usr/bin/swig (found version "4.0.2")
    -- Found PythonInterp: /usr/bin/python (found version "3.9.12")
    -- Found PythonLibs: /usr/lib64/libpython3.9.so (found version "3.9.12")
    -- Looking for sctp_bindx in sctp
    -- Looking for sctp_bindx in sctp - not found
    -- Looking for pam_start in pam
    -- Looking for pam_start in pam - found
    -- Looking for TIOCSRS485
    -- Looking for TIOCSRS485 - found
    -- Looking for SIGWINCH
    -- Looking for SIGWINCH - found
    -- Looking for sys/un.h
    -- Looking for sys/un.h - found
    -- Performing Test HAVE_GCC_ATOMICS
    -- Performing Test HAVE_GCC_ATOMICS - Success
    -- Looking for sendmsg
    -- Looking for sendmsg - found
    -- Looking for recvmsg
    -- Looking for recvmsg - found
    -- Looking for isatty
    -- Looking for isatty - found
    -- Looking for strcasecmp
    -- Looking for strcasecmp - found
    -- Looking for strncasecmp
    -- Looking for strncasecmp - found
    -- Looking for prctl
    -- Looking for prctl - found
    -- Looking for getrandom
    -- Looking for getrandom - found
    -- Looking for ptsname_r
    -- Looking for ptsname_r - found
    -- Looking for cfmakeraw
    -- Looking for cfmakeraw - found
    -- Looking for signalfd
    -- Looking for signalfd - not found
    -- Looking for regexec
    -- Looking for regexec - found
    -- Looking for fnmatch
    -- Looking for fnmatch - found
    CMake Warning (dev) at /usr/share/cmake/Modules/UseSWIG.cmake:617 (message):
    Policy CMP0086 is not set: UseSWIG honors SWIG_MODULE_NAME via -module
    flag. Run "cmake --help-policy CMP0086" for policy details. Use the
    cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
/usr/share/cmake/Modules/UseSWIG.cmake:888 (SWIG_ADD_SOURCE_TO_MODULE)
c++/swig/pygensio/CMakeLists.txt:9 (swig_add_library)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/share/cmake/Modules/UseSWIG.cmake:617 (message):
Policy CMP0086 is not set: UseSWIG honors SWIG_MODULE_NAME via -module
flag. Run "cmake --help-policy CMP0086" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
/usr/share/cmake/Modules/UseSWIG.cmake:888 (SWIG_ADD_SOURCE_TO_MODULE)
glib/swig/python/CMakeLists.txt:9 (swig_add_library)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/share/cmake/Modules/UseSWIG.cmake:617 (message):
Policy CMP0086 is not set: UseSWIG honors SWIG_MODULE_NAME via -module
flag. Run "cmake --help-policy CMP0086" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
/usr/share/cmake/Modules/UseSWIG.cmake:888 (SWIG_ADD_SOURCE_TO_MODULE)
tcl/swig/python/CMakeLists.txt:9 (swig_add_library)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/share/cmake/Modules/UseSWIG.cmake:617 (message):
Policy CMP0086 is not set: UseSWIG honors SWIG_MODULE_NAME via -module
flag. Run "cmake --help-policy CMP0086" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
/usr/share/cmake/Modules/UseSWIG.cmake:888 (SWIG_ADD_SOURCE_TO_MODULE)
swig/python/CMakeLists.txt:37 (swig_add_library)
This warning is for project developers. Use -Wno-dev to suppress it.

-- <<< Gentoo configuration >>>
Build type RelWithDebInfo
Install path /usr
Compiler flags:
C -Wall
C++ -O2 -pipe -march=znver2
Linker flags:
Executable -Wl,-O1 -Wl,--as-needed
Module -Wl,-O1 -Wl,--as-needed
Shared -Wl,-O1 -Wl,--as-needed

-- Configuring done
-- Generating done
-- Build files have been written to: /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build

Source configured.
Compiling source in /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999 ...

  • Source directory (CMAKE_USE_DIR): "/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999"
  • Build directory (BUILD_DIR): "/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build"
    ninja -v -j11 -l0
    [1/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/buffer.c.o -MF lib/CMakeFiles/gensio.dir/buffer.c.o.d -o lib/CMakeFiles/gensio.dir/buffer.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/buffer.c
    [2/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_trace.c.o -MF lib/CMakeFiles/gensio.dir/gensio_trace.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_trace.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_trace.c
    [3/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_ll_gensio.c.o -MF lib/CMakeFiles/gensio.dir/gensio_ll_gensio.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_ll_gensio.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_ll_gensio.c
    [4/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_acc.c.o -MF lib/CMakeFiles/gensio.dir/gensio_acc.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_acc.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_acc.c
    [5/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_acc_gensio.c.o -MF lib/CMakeFiles/gensio.dir/gensio_acc_gensio.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_acc_gensio.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_acc_gensio.c
    [6/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_filter_trace.c.o -MF lib/CMakeFiles/gensio.dir/gensio_filter_trace.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_filter_trace.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_filter_trace.c
    [7/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_filter_telnet.c.o -MF lib/CMakeFiles/gensio.dir/gensio_filter_telnet.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_filter_telnet.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_filter_telnet.c
    [8/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_ll_ipmisol.c.o -MF lib/CMakeFiles/gensio.dir/gensio_ll_ipmisol.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_ll_ipmisol.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_ll_ipmisol.c
    [9/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_ll_fd.c.o -MF lib/CMakeFiles/gensio.dir/gensio_ll_fd.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_ll_fd.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_ll_fd.c
    [10/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_msgdelim.c.o -MF lib/CMakeFiles/gensio.dir/gensio_msgdelim.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_msgdelim.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_msgdelim.c
    [11/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_ssl.c.o -MF lib/CMakeFiles/gensio.dir/gensio_ssl.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_ssl.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_ssl.c
    [12/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_dummy.c.o -MF lib/CMakeFiles/gensio.dir/gensio_dummy.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_dummy.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_dummy.c
    [13/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/sergensio_ipmisol.c.o -MF lib/CMakeFiles/gensio.dir/sergensio_ipmisol.c.o.d -o lib/CMakeFiles/gensio.dir/sergensio_ipmisol.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/sergensio_ipmisol.c
    [14/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_net.c.o -MF lib/CMakeFiles/gensio.dir/gensio_net.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_net.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_net.c
    [15/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_base.c.o -MF lib/CMakeFiles/gensio.dir/gensio_base.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_base.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_base.c
    [16/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/sergensio.c.o -MF lib/CMakeFiles/gensio.dir/sergensio.c.o.d -o lib/CMakeFiles/gensio.dir/sergensio.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/sergensio.c
    [17/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_echo.c.o -MF lib/CMakeFiles/gensio.dir/gensio_echo.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_echo.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_echo.c
    [18/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_udp.c.o -MF lib/CMakeFiles/gensio.dir/gensio_udp.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_udp.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_udp.c
    [19/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/telnet.c.o -MF lib/CMakeFiles/gensio.dir/telnet.c.o.d -o lib/CMakeFiles/gensio.dir/telnet.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/telnet.c
    [20/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_certauth.c.o -MF lib/CMakeFiles/gensio.dir/gensio_certauth.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_certauth.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_certauth.c
    [21/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_file.c.o -MF lib/CMakeFiles/gensio.dir/gensio_file.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_file.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_file.c
    [22/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_relpkt.c.o -MF lib/CMakeFiles/gensio.dir/gensio_relpkt.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_relpkt.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_relpkt.c
    [23/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_filter_msgdelim.c.o -MF lib/CMakeFiles/gensio.dir/gensio_filter_msgdelim.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_filter_msgdelim.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_filter_msgdelim.c
    [24/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_sctp.c.o -MF lib/CMakeFiles/gensio.dir/gensio_sctp.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_sctp.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_sctp.c
    [25/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/utils.c.o -MF lib/CMakeFiles/gensio.dir/utils.c.o.d -o lib/CMakeFiles/gensio.dir/utils.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/utils.c
    [26/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/sergensio_telnet.c.o -MF lib/CMakeFiles/gensio.dir/sergensio_telnet.c.o.d -o lib/CMakeFiles/gensio.dir/sergensio_telnet.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/sergensio_telnet.c
    [27/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/mdns.c.o -MF lib/CMakeFiles/gensio.dir/mdns.c.o.d -o lib/CMakeFiles/gensio.dir/mdns.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/mdns.c
    [28/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/avahi_watcher.c.o -MF lib/CMakeFiles/gensio.dir/avahi_watcher.c.o.d -o lib/CMakeFiles/gensio.dir/avahi_watcher.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/avahi_watcher.c
    [29/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_perf.c.o -MF lib/CMakeFiles/gensio.dir/gensio_perf.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_perf.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_perf.c
    [30/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_mdns.c.o -MF lib/CMakeFiles/gensio.dir/gensio_mdns.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_mdns.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_mdns.c
    [31/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_mux.c.o -MF lib/CMakeFiles/gensio.dir/gensio_mux.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_mux.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_mux.c
    [32/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_filter_perf.c.o -MF lib/CMakeFiles/gensio.dir/gensio_filter_perf.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_filter_perf.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_filter_perf.c
    [33/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_filter_relpkt.c.o -MF lib/CMakeFiles/gensio.dir/gensio_filter_relpkt.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_filter_relpkt.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_filter_relpkt.c
    [34/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_conacc.c.o -MF lib/CMakeFiles/gensio.dir/gensio_conacc.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_conacc.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_conacc.c
    [35/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_circbuf.c.o -MF lib/CMakeFiles/gensio.dir/gensio_circbuf.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_circbuf.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_circbuf.c
    [36/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio.c.o -MF lib/CMakeFiles/gensio.dir/gensio.c.o.d -o lib/CMakeFiles/gensio.dir/gensio.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio.c
    [37/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/uucplock.c.o -MF lib/CMakeFiles/gensio.dir/uucplock.c.o.d -o lib/CMakeFiles/gensio.dir/uucplock.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/uucplock.c
    [38/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_osops_env.c.o -MF lib/CMakeFiles/gensio.dir/gensio_osops_env.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_osops_env.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_osops_env.c
    [39/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_filter_certauth.c.o -MF lib/CMakeFiles/gensio.dir/gensio_filter_certauth.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_filter_certauth.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_filter_certauth.c
    [40/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_filter_ssl.c.o -MF lib/CMakeFiles/gensio.dir/gensio_filter_ssl.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_filter_ssl.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_filter_ssl.c
    [41/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_kiss.c.o -MF lib/CMakeFiles/gensio.dir/gensio_kiss.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_kiss.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_kiss.c
    [42/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/crc16.c.o -MF lib/CMakeFiles/gensio.dir/crc16.c.o.d -o lib/CMakeFiles/gensio.dir/crc16.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/crc16.c
    [43/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/sergensio_serialdev.c.o -MF lib/CMakeFiles/gensio.dir/sergensio_serialdev.c.o.d -o lib/CMakeFiles/gensio.dir/sergensio_serialdev.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/sergensio_serialdev.c
    [44/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_addrinfo.c.o -MF lib/CMakeFiles/gensio.dir/gensio_addrinfo.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_addrinfo.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_addrinfo.c
    [45/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_stdio.c.o -MF lib/CMakeFiles/gensio.dir/gensio_stdio.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_stdio.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_stdio.c
    [46/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_pty.c.o -MF lib/CMakeFiles/gensio.dir/gensio_pty.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_pty.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_pty.c
    [47/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_filter_kiss.c.o -MF lib/CMakeFiles/gensio.dir/gensio_filter_kiss.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_filter_kiss.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_filter_kiss.c
    [48/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_stdsock.c.o -MF lib/CMakeFiles/gensio.dir/gensio_stdsock.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_stdsock.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_stdsock.c
    [49/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_ax25_addr.c.o -MF lib/CMakeFiles/gensio.dir/gensio_ax25_addr.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_ax25_addr.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_ax25_addr.c
    [50/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_osops.c.o -MF lib/CMakeFiles/gensio.dir/gensio_osops.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_osops.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_osops.c
    [51/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/selector.c.o -MF lib/CMakeFiles/gensio.dir/selector.c.o.d -o lib/CMakeFiles/gensio.dir/selector.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/selector.c
    [52/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_unix.c.o -MF lib/CMakeFiles/gensio.dir/gensio_unix.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_unix.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_unix.c
    [53/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensiotcl_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tcl/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT tcl/CMakeFiles/gensiotcl.dir/gensio_tcl.c.o -MF tcl/CMakeFiles/gensiotcl.dir/gensio_tcl.c.o.d -o tcl/CMakeFiles/gensiotcl.dir/gensio_tcl.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tcl/gensio_tcl.c
    [54/116] /usr/bin/x86_64-pc-linux-gnu-gcc -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/glib/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tcl/include -Wall -MD -MT tools/CMakeFiles/gensiotool.dir/ioinfo.c.o -MF tools/CMakeFiles/gensiotool.dir/ioinfo.c.o.d -o tools/CMakeFiles/gensiotool.dir/ioinfo.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tools/ioinfo.c
    [55/116] : && /usr/bin/x86_64-pc-linux-gnu-gcc -fPIC -Wall -Wl,-O1 -Wl,--as-needed -shared -Wl,-soname,libgensiotcl.so.0 -o tcl/libgensiotcl.so.0.0.0 tcl/CMakeFiles/gensiotcl.dir/gensio_tcl.c.o /usr/lib64/libtcl.so && :
    [56/116] /usr/bin/cmake -E cmake_symlink_library tcl/libgensiotcl.so.0.0.0 tcl/libgensiotcl.so.0 tcl/libgensiotcl.so && :
    [57/116] /usr/bin/x86_64-pc-linux-gnu-gcc -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/glib/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tcl/include -Wall -MD -MT tools/CMakeFiles/gensiotool.dir/ser_ioinfo.c.o -MF tools/CMakeFiles/gensiotool.dir/ser_ioinfo.c.o.d -o tools/CMakeFiles/gensiotool.dir/ser_ioinfo.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tools/ser_ioinfo.c
    [58/116] /usr/bin/x86_64-pc-linux-gnu-gcc -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/glib/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tcl/include -Wall -MD -MT tools/CMakeFiles/gensiotool.dir/utils.c.o -MF tools/CMakeFiles/gensiotool.dir/utils.c.o.d -o tools/CMakeFiles/gensiotool.dir/utils.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tools/utils.c
    [59/116] /usr/bin/x86_64-pc-linux-gnu-gcc -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/glib/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tcl/include -Wall -MD -MT tools/CMakeFiles/gensiotool.dir/localports.c.o -MF tools/CMakeFiles/gensiotool.dir/localports.c.o.d -o tools/CMakeFiles/gensiotool.dir/localports.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tools/localports.c
    [60/116] /usr/bin/x86_64-pc-linux-gnu-gcc -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/glib/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tcl/include -Wall -MD -MT tools/CMakeFiles/gensiotool.dir/file_utils.c.o -MF tools/CMakeFiles/gensiotool.dir/file_utils.c.o.d -o tools/CMakeFiles/gensiotool.dir/file_utils.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tools/file_utils.c
    [61/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensioglib_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/glib/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT glib/CMakeFiles/gensioglib.dir/gensio_glib.c.o -MF glib/CMakeFiles/gensioglib.dir/gensio_glib.c.o.d -o glib/CMakeFiles/gensioglib.dir/gensio_glib.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/glib/gensio_glib.c
    [62/116] /usr/bin/x86_64-pc-linux-gnu-gcc -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/glib/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tcl/include -Wall -MD -MT tools/CMakeFiles/gensiotool.dir/run_get_output.c.o -MF tools/CMakeFiles/gensiotool.dir/run_get_output.c.o.d -o tools/CMakeFiles/gensiotool.dir/run_get_output.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tools/run_get_output.c
    [63/116] /usr/bin/x86_64-pc-linux-gnu-gcc -Dgensio_EXPORTS -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -Wall -fPIC -DBUILDING_GENSIO_DLL -MD -MT lib/CMakeFiles/gensio.dir/gensio_ax25.c.o -MF lib/CMakeFiles/gensio.dir/gensio_ax25.c.o.d -o lib/CMakeFiles/gensio.dir/gensio_ax25.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib/gensio_ax25.c
    [64/116] : && /usr/bin/x86_64-pc-linux-gnu-gcc -fPIC -Wall -Wl,-O1 -Wl,--as-needed -shared -Wl,-soname,libgensioglib.so.0 -o glib/libgensioglib.so.0.0.0 glib/CMakeFiles/gensioglib.dir/gensio_glib.c.o -lwrap -lpthread -lssl -lcrypto && :
    [65/116] /usr/bin/x86_64-pc-linux-gnu-gcc -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/glib/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tcl/include -Wall -MD -MT tools/CMakeFiles/gtlssh-shared.dir/gtlssh-shared.c.o -MF tools/CMakeFiles/gtlssh-shared.dir/gtlssh-shared.c.o.d -o tools/CMakeFiles/gtlssh-shared.dir/gtlssh-shared.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tools/gtlssh-shared.c
    [66/116] /usr/bin/cmake -E cmake_symlink_library glib/libgensioglib.so.0.0.0 glib/libgensioglib.so.0 glib/libgensioglib.so && :
    [67/116] /usr/bin/x86_64-pc-linux-gnu-gcc -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/glib/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tcl/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/glib -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tcl -Wall -MD -MT tools/CMakeFiles/gensiot.dir/gensiotool.c.o -MF tools/CMakeFiles/gensiot.dir/gensiotool.c.o.d -o tools/CMakeFiles/gensiot.dir/gensiotool.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tools/gensiotool.c
    [68/116] : && /usr/bin/x86_64-pc-linux-gnu-gcc -fPIC -Wall -Wl,-O1 -Wl,--as-needed -shared -Wl,-soname,libgensio.so.0 -o lib/libgensio.so.0.0.0 lib/CMakeFiles/gensio.dir/buffer.c.o lib/CMakeFiles/gensio.dir/gensio_net.c.o lib/CMakeFiles/gensio.dir/gensio_filter_telnet.c.o lib/CMakeFiles/gensio.dir/gensio_ssl.c.o lib/CMakeFiles/gensio.dir/gensio_acc.c.o lib/CMakeFiles/gensio.dir/gensio_filter_trace.c.o lib/CMakeFiles/gensio.dir/gensio_acc_gensio.c.o lib/CMakeFiles/gensio.dir/gensio_trace.c.o lib/CMakeFiles/gensio.dir/gensio_base.c.o lib/CMakeFiles/gensio.dir/gensio_ll_gensio.c.o lib/CMakeFiles/gensio.dir/gensio_ll_fd.c.o lib/CMakeFiles/gensio.dir/gensio_udp.c.o lib/CMakeFiles/gensio.dir/gensio.c.o lib/CMakeFiles/gensio.dir/gensio_ll_ipmisol.c.o lib/CMakeFiles/gensio.dir/gensio_certauth.c.o lib/CMakeFiles/gensio.dir/gensio_msgdelim.c.o lib/CMakeFiles/gensio.dir/sergensio.c.o lib/CMakeFiles/gensio.dir/gensio_dummy.c.o lib/CMakeFiles/gensio.dir/gensio_mux.c.o lib/CMakeFiles/gensio.dir/sergensio_ipmisol.c.o lib/CMakeFiles/gensio.dir/gensio_echo.c.o lib/CMakeFiles/gensio.dir/gensio_file.c.o lib/CMakeFiles/gensio.dir/sergensio_telnet.c.o lib/CMakeFiles/gensio.dir/gensio_filter_certauth.c.o lib/CMakeFiles/gensio.dir/telnet.c.o lib/CMakeFiles/gensio.dir/gensio_filter_msgdelim.c.o lib/CMakeFiles/gensio.dir/gensio_relpkt.c.o lib/CMakeFiles/gensio.dir/utils.c.o lib/CMakeFiles/gensio.dir/gensio_filter_relpkt.c.o lib/CMakeFiles/gensio.dir/gensio_sctp.c.o lib/CMakeFiles/gensio.dir/gensio_filter_ssl.c.o lib/CMakeFiles/gensio.dir/gensio_perf.c.o lib/CMakeFiles/gensio.dir/gensio_filter_perf.c.o lib/CMakeFiles/gensio.dir/gensio_conacc.c.o lib/CMakeFiles/gensio.dir/mdns.c.o lib/CMakeFiles/gensio.dir/avahi_watcher.c.o lib/CMakeFiles/gensio.dir/gensio_mdns.c.o lib/CMakeFiles/gensio.dir/gensio_stdio.c.o lib/CMakeFiles/gensio.dir/sergensio_serialdev.c.o lib/CMakeFiles/gensio.dir/gensio_circbuf.c.o lib/CMakeFiles/gensio.dir/gensio_addrinfo.c.o lib/CMakeFiles/gensio.dir/gensio_stdsock.c.o lib/CMakeFiles/gensio.dir/uucplock.c.o lib/CMakeFiles/gensio.dir/gensio_pty.c.o lib/CMakeFiles/gensio.dir/gensio_osops.c.o lib/CMakeFiles/gensio.dir/gensio_osops_env.c.o lib/CMakeFiles/gensio.dir/gensio_filter_kiss.c.o lib/CMakeFiles/gensio.dir/gensio_kiss.c.o lib/CMakeFiles/gensio.dir/crc16.c.o lib/CMakeFiles/gensio.dir/gensio_ax25_addr.c.o lib/CMakeFiles/gensio.dir/gensio_ax25.c.o lib/CMakeFiles/gensio.dir/selector.c.o lib/CMakeFiles/gensio.dir/gensio_unix.c.o -lwrap -lpthread -lssl -lcrypto && :
    [69/116] /usr/bin/cmake -E cmake_symlink_library lib/libgensio.so.0.0.0 lib/libgensio.so.0 lib/libgensio.so && :
    [70/116] /usr/bin/x86_64-pc-linux-gnu-gcc -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/glib/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tcl/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib -Wall -MD -MT tools/CMakeFiles/gtlssh-keygen.dir/gtlssh-keygen.c.o -MF tools/CMakeFiles/gtlssh-keygen.dir/gtlssh-keygen.c.o.d -o tools/CMakeFiles/gtlssh-keygen.dir/gtlssh-keygen.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tools/gtlssh-keygen.c
    [71/116] /usr/bin/x86_64-pc-linux-gnu-gcc -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/glib/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tcl/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib -Wall -MD -MT tools/CMakeFiles/gtlssh.dir/gtlssh.c.o -MF tools/CMakeFiles/gtlssh.dir/gtlssh.c.o.d -o tools/CMakeFiles/gtlssh.dir/gtlssh.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tools/gtlssh.c
    [72/116] cd /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/tcl/swig/python && /usr/bin/cmake -E make_directory /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/tcl/swig/python/CMakeFiles/_gensiotcl.dir /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/tcl/swig/python /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/tcl/swig/python/CMakeFiles/_gensiotcl.dir && /usr/bin/cmake -E env SWIG_LIB=/usr/share/swig/4.0.2 /usr/bin/swig -python -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tcl/swig/python -py3 -outdir /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/tcl/swig/python -interface __gensiotcl -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tcl/include -I/usr/include/python3.9 -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tcl/swig/python -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/swig/include -o /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/tcl/swig/python/CMakeFiles/_gensiotcl.dir/gensiotclPYTHON_wrap.c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tcl/swig/gensiotcl.i
    [73/116] cd /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/glib/swig/python && /usr/bin/cmake -E make_directory /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/glib/swig/python/CMakeFiles/_gensioglib.dir /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/glib/swig/python /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/glib/swig/python/CMakeFiles/_gensioglib.dir && /usr/bin/cmake -E env SWIG_LIB=/usr/share/swig/4.0.2 /usr/bin/swig -python -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/glib/swig/python -py3 -outdir /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/glib/swig/python -interface __gensioglib -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/glib/include -I/usr/include/python3.9 -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/glib/swig/python -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/swig/include -o /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/glib/swig/python/CMakeFiles/_gensioglib.dir/gensioglibPYTHON_wrap.c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/glib/swig/gensioglib.i
    [74/116] /usr/bin/x86_64-pc-linux-gnu-g++ -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/c++/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib -O2 -pipe -march=znver2 -MD -MT c++/tests/CMakeFiles/serial_test.dir/serial_test.cc.o -MF c++/tests/CMakeFiles/serial_test.dir/serial_test.cc.o.d -o c++/tests/CMakeFiles/serial_test.dir/serial_test.cc.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/c++/tests/serial_test.cc
    [75/116] /usr/bin/x86_64-pc-linux-gnu-g++ -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/c++/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib -O2 -pipe -march=znver2 -MD -MT c++/examples/CMakeFiles/telnet_server.dir/telnet_server.cc.o -MF c++/examples/CMakeFiles/telnet_server.dir/telnet_server.cc.o.d -o c++/examples/CMakeFiles/telnet_server.dir/telnet_server.cc.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/c++/examples/telnet_server.cc
    [76/116] /usr/bin/x86_64-pc-linux-gnu-gcc -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib -Wall -MD -MT examples/CMakeFiles/basic_client.dir/basic_client.c.o -MF examples/CMakeFiles/basic_client.dir/basic_client.c.o.d -o examples/CMakeFiles/basic_client.dir/basic_client.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/examples/basic_client.c
    [77/116] /usr/bin/x86_64-pc-linux-gnu-gcc -DSYSCONFDIR="/etc" -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/glib/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tcl/include -I/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/lib -Wall -MD -MT tools/CMakeFiles/gtlsshd.dir/gtlsshd.c.o -MF tools/CMakeFiles/gtlsshd.dir/gtlsshd.c.o.d -o tools/CMakeFiles/gtlsshd.dir/gtlsshd.c.o -c /var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999/tools/gtlsshd.c
    [78/116] : && /usr/bin/x86_64-pc-linux-gnu-gcc -Wall -Wl,-O1 -Wl,--as-needed examples/CMakeFiles/basic_client.dir/basic_client.c.o -o examples/basic_client -Wl,-rpath,/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/lib lib/libgensio.so.0.0.0 -lwrap -lpthread -lssl -lcrypto && :
    FAILED: examples/basic_client
    : && /usr/bin/x86_64-pc-linux-gnu-gcc -Wall -Wl,-O1 -Wl,--as-needed examples/CMakeFiles/basic_client.dir/basic_client.c.o -o examples/basic_client -Wl,-rpath,/var/tmp/portage/dev-libs/gensio-9999/work/gensio-9999_build/lib lib/libgensio.so.0.0.0 -lwrap -lpthread -lssl -lcrypto && :
    /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld : lib/libgensio.so.0.0.0 : référence indéfinie vers « str_to_keepopen_gensio »
    /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld : lib/libgensio.so.0.0.0 : référence indéfinie vers « str_to_xlt_gensio »
    /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld : lib/libgensio.so.0.0.0 : référence indéfinie vers « xlt_gensio_accepter_alloc »
    /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld : lib/libgensio.so.0.0.0 : référence indéfinie vers « str_to_xlt_gensio_accepter »
    /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld : lib/libgensio.so.0.0.0 : référence indéfinie vers « xlt_gensio_alloc »
    /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld : lib/libgensio.so.0.0.0 : référence indéfinie vers « keepopen_gensio_alloc »
    collect2: error: ld returned 1 exit status

Let's talk stdio!

Hi,

The gensio library looks like a very interesting and promising project. Although we haven't had much communication up until now, I've followed your Pat fork with great interest. The idea of having such a flexible and portable user-land AX.25+++ implementation is very tempting.

As previously stated, my main concern is the complexity of taking in such a large dependency chain in Pat. So a couple of days ago (in the shower of all places), it occured to me that this often is solved using micro services in backends. And in UNIX, the tradition is to build smaller composable apps talking to each other through pipes and sockets.

So how about if we could add gensio to the mix as a separate app which can be spawned by the host application, and communicate over stdio? Sort of like a netcat - a geniocat if you'd like 🤓.

The primary benefits would be to have independent release cycles and build systems for the two projects, much like we have with ARDOP and other soft modems. But still, from a user perspective it would be (mostly) transpartent as Pat would be able to spawn gensiocat under the hood when needed. All the user would need to do is to install the two separate apps.

Also, I'd imagine gensiocat would be useful in many other applications and a very good alternative to ax25-apps's call and listen.

We could talk raw stdio, or we could add a layer of AGWPE or similar to multiplex several connections. I guess the latter would be a good fit for AX.25, supporting simultaneous listen and connect(s) over the same KISS tty device.

Please let me know what you think of such an approach. Thank you!

Error compiling

When i try to compile the library i recieve the following error:
(i ran autoreconf -i, then ./configure)

[23:39:36] root@domotica-03:/opt/gensio# make
Making all in .
make[1]: Entering directory '/opt/gensio'
CC gensio_ssl.lo
gensio_ssl.c:314:1: error: conflicting types for 'ssl_gensio_accepter_alloc'
ssl_gensio_accepter_alloc(char *args[],
^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./include/gensio/gensio_class.h:24:0,
from gensio_ssl.c:22:
./include/gensio/gensio.h:769:5: note: previous declaration of 'ssl_gensio_accepter_alloc' was here
int ssl_gensio_accepter_alloc(struct gensio_accepter *child, char *args[],
^~~~~~~~~~~~~~~~~~~~~~~~~
Makefile:556: recipe for target 'gensio_ssl.lo' failed
make[1]: *** [gensio_ssl.lo] Error 1
make[1]: Leaving directory '/opt/gensio'
Makefile:578: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
[23:39:39] root@domotica-03:/opt/gensio#

no manpage for gensiot

Hi,

while the geniso source contains man pages for library functions and configuration files, the manual page for /usr/bin/gensiot seems to be missing.

Greetings
Marc

gtlsshd is calling setuid and setgid without setgroups or initgroups

As I'm packaging gensio for Fedora and preparing it for review I've stumbled across this error from rpmlint:
gensio.x86_64: E: missing-call-to-setgroups-before-setuid /usr/sbin/gtlsshd

If we have rpmlint explain this error to us we learn

$ rpmlint -e missing-call-to-setgroups-before-setuid
missing-call-to-setgroups-before-setuid:
This executable is calling setuid and setgid without setgroups or initgroups.
This means it didn't relinquish all groups, and this would be a potential
security issue.

I think it is a little sad about what is happening here: https://github.com/cminyard/gensio/blob/master/tools/gtlsshd.c#L1045

In looking into it more I've found this discussion on StackOverflow: https://security.stackexchange.com/questions/122141/always-setgroups-before-setuid

To be honest, I don't have enough experience to determine whether this an actual problem or not. I'd at least want to try to understand it better because it for sure will come up in the packaging review.

Does not build on Debian unstable

Hi,

gensio 2.3.4 does not build successfully on current Debian unstable:

[44/5028]mh@salida:~/packages/gensio/build-area/gensio-2.3.4/lib $ gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -I../include -I../include -DBUILDING_GENSIO_DLL -g -O2 -ffile-prefix-map=/home/mh/packages/gensio/build-area/gensio-2.3.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -pthread -c gensio_stdsock.c  -fPIC -DPIC -o .libs/gensio_stdsock.o
In file included from ../include/gensio/gensio.h:28,
                 from gensio_stdsock.c:49:
gensio_stdsock.c: In function ‘close_socket’:
../include/gensio/gensio_err.h:73:38: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
   73 |     gensio_i_os_err_to_err(o, oserr, __FUNCTION__, __FILE__, __LINE__)
      |                                      ^~~~~~~~~~~~
gensio_stdsock.c:179:16: note: in expansion of macro ‘gensio_os_err_to_err’
  179 |         return gensio_os_err_to_err(o, sock_errno);
      |                ^~~~~~~~~~~~~~~~~~~~
gensio_stdsock.c: In function ‘gensio_os_sctp_open_sockets’:
../include/gensio/gensio_err.h:73:38: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
   73 |     gensio_i_os_err_to_err(o, oserr, __FUNCTION__, __FILE__, __LINE__)
      |                                      ^~~~~~~~~~~~
gensio_stdsock.c:246:26: note: in expansion of macro ‘gensio_os_err_to_err’
  246 |                     rv = gensio_os_err_to_err(o, sock_errno);
      |                          ^~~~~~~~~~~~~~~~~~~~
gensio_stdsock.c: In function ‘gensio_stdsock_sctp_recvmsg’:
../include/gensio/gensio_err.h:73:38: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
   73 |     gensio_i_os_err_to_err(o, oserr, __FUNCTION__, __FILE__, __LINE__)
      |                                      ^~~~~~~~~~~~
gensio_stdsock.c:154:10: note: in expansion of macro ‘gensio_os_err_to_err’
  154 |     rv = gensio_os_err_to_err(o, err);                          \
      |          ^~~~~~~~~~~~~~~~~~~~
gensio_stdsock.c:325:5: note: in expansion of macro ‘ERRHANDLE’
  325 |     ERRHANDLE();
      |     ^~~~~~~~~
gensio_stdsock.c: In function ‘l_sctp_send’:
../include/gensio/gensio_err.h:73:38: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
   73 |     gensio_i_os_err_to_err(o, oserr, __FUNCTION__, __FILE__, __LINE__)
      |                                      ^~~~~~~~~~~~
gensio_stdsock.c:154:10: note: in expansion of macro ‘gensio_os_err_to_err’
  154 |     rv = gensio_os_err_to_err(o, err);                          \
      |          ^~~~~~~~~~~~~~~~~~~~
gensio_stdsock.c:338:5: note: in expansion of macro ‘ERRHANDLE’
  338 |     ERRHANDLE();
      |     ^~~~~~~~~
gensio_stdsock.c: At top level:
gensio_stdsock.c:376:1: error: redefinition of ‘gensio_stdsock_sctp_send’
  376 | gensio_stdsock_sctp_send(struct gensio_iod *iod,
      | ^~~~~~~~~~~~~~~~~~~~~~~~
gensio_stdsock.c:347:1: note: previous definition of ‘gensio_stdsock_sctp_send’ with type ‘int(struct gensio_iod *, const struct gensio_sg *, gensiods,  gensiods *, const struct sctp_sndrcvinfo *, uint32_t)’ {aka ‘int(struct gensio_iod *, const struct gensio_sg *, long unsigned int,  long unsigned int *, const struct sctp_sndrcvinfo *, unsigned int)’}
  347 | gensio_stdsock_sctp_send(struct gensio_iod *iod,
      | ^~~~~~~~~~~~~~~~~~~~~~~~

(snipped, it's long).

Debian unstable has recently switched to gcc-11, can this be a reason?

Greetings
Marc

need some example project

Hallow!
library looks pretty, but it hard to though in without examle. i need telnet domain. If you have some simple implementation of it, could you provide such compilable sample?

Using gensio to transfer a file via xmodem.

I'm trying to use gensio to transfer a file over xmodem:

gensiot --server -i 'serialdev,/dev/ttyUSB0,115200n81,local' -a 'telnet(rfc2217),5000'

(I also tried 'telnet' and 'tcp')

Next I use pyserial or sx to start the file transfer:

Example: https://pypi.org/project/xmodem/
sx -vv -X -b --tcp-client localhost:5000 <file>

In both cases I get "NAK on sector". Direct xmodem transfers (screen + sx) work fine. It is (or should it be) possible use xmodem via gensio?

Thanks!

PAM authentication support

I am planning to implement PAM authentication support on behalf of @AEberleMW. Our goal is to bring that into the mainline gensio project. To make that process as simple as possible I'd like to discuss a few details beforehand:

  • What is your preferred coding style? In the certauth code I saw a mixture of tabs and spaces which seems a bit uncommon to me.
  • I would name it pamauth.
  • I am still at the start of my research but I think gensios are strictly non-blocking while PAM authentication is designed to block until a response is present. Therefore we may need to spawn a thread handling the PAM authentication.
  • certauth runs its own custom protocol on top of the underlying gensio, so we are free to define our own protocol in pamauth, correct? I'd probably try to serialize and transfer PAM structures.
  • I am not yet sure why certauth is split into lib/gensio_certauth.c and lib/gensio_filter_certauth.c but I will probably get behind that.

Please if you have any thoughts or hints on that I would like to discuss them.

cc @THerbrecher

Feature request: Send winch when receiving telnet IAC NAWS commands (RFC 1073)

Currently gensiot can send winch updates if you are connected pty<->stdio or similar. It would be great if when acting as a telnet server the window size updates could be propogated.

My use case is running the telnet protocol over a serial port, and allowing the client to be resized.

Really cool library by the way.

Details of serial port locking / UUCP locking

Currently, as far as I can tell, gensio only implements its own UUCP-style locking mechanism.

It seems that at least on Linux there are other (and possibly better) ways of locking serial ports.
There was an effort within Debian in 2014 to streamline this: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=734086
From this discussion one of the participants developed some recommendations for best practices around this issue: https://stackoverflow.com/questions/30316722/what-is-the-best-practice-for-locking-serial-ports-and-other-devices-in-linux

  1. Would it be beneficial for gensio to support flock(1) based locking of serial ports on Linux, given that the information above suggests it could be more robust?
  2. Would using liblockdev be beneficial on distributions that utilize it more or less consistently (like Fedora)?

It is my understanding, that when using flock(1) UUCP-style locking (with or without liblockdev) can still occur to support programs that use or require it as it does not interfere with programs that ignore it.

Less relevant context on why I bring this up

ser2net recently started shipping a systemd unit file.
In this unit file there is a definition of a User and a Group. In trying to incorporate this in my Fedora package I noticed that ser2net would not be able to write to /var/lock, gensio's default UUCP lock path, unless ser2net was run as root. So I looked into the issue further and found that most other software in Fedora uses lockdev (and liblockdev) to facilitate UUCP-style locking and the path to use for that would be /run/lock/lockdev, which is group writeable by users in the lock group.
So I fixed the issue as suggested in the gensio README: by creating a ser2net user and adding it to both the dialout and lock groups and compiling gensio with the --with-uucp-locking=/run/lock/lockdev option.

GCC10 build error

GCC complains about the multiple definition of localport_err:

arm-buildroot-linux-gnueabihf/bin/ld: libgensiotool.a(localports.o):(.bss+0xc): multiple definition of `localport_err'; gtlssh.o:(.bss+0x24): first defined here
collect2: error: ld returned 1 exit status

Is there a udp option to make it read only or write only?

I want to setup 3 different types of multicast connections:

  • Sender
  • Receiver
  • Peer (Sender and Receiver)

But I'm having a hard time configuring the yaml file in a way that allows each of these. Here's what I've found so far.

Send and receive on same multicast address:

  • Same as example in gensio manual
    accepter:conacc,udp(mcast=224.0.0.2,laddr='ipv4,3000',mloop=true,nocon=true,reuseaddr=true),224.0.0.2,3000

Send only to multicast address:

  • Setting nocon to false has the effect of not receiving anything from multicast group
    accepter:conacc,udp(mcast=224.0.0.2,laddr='ipv4,3000',mloop=true,nocon=false,reuseaddr=true),224.0.0.2,3000
  • Setting readbuf to 0 also has the effect of not receiving anything from multicast group
    accepter:conacc,udp(mcast=224.0.0.2,laddr='ipv4,3000',mloop=true,nocon=true,reuseaddr=true,readbuf=0),224.0.0.2,3000

Receive only from multicast:

  • The best I could do is changing the destination port number, so sendto traffic doesn't go to the same address I'm receiving on. But its still sending somewhere which I don't want.
    accepter: conacc, udp(mcast=224.0.0.2,laddr='ipv4,3000',mloop=true,nocon=true,reuseaddr=true),224.0.0.2,3001

Neither the sender or receiver option is very straight forward. It would be nice to have rdonly and wronly flags that could be added in the UDP options. It would probably be useful for TCP as well. They should probably be mutually exclusive so you can't set both to true.

Build system issues (pkgconfig files, overlinking)

I went down a bit of a rabbit hole trying to debug a build issue with ser2net I've been seeing on Fedora:

ser2net will not build unless avahi-devel is installed even though ser2net doesn't explicitly require it.

Curiously, the step that fails is the AC_CHECK_LIB(yaml, yaml_document_initialize, [...]) step in ser2net's configure.ac. And the reason for that is that the previous PKG_CHECK_MODULES(GENSIOMDNS, libgensiomdns, [LIBS="$LIBS $GENSIOMDNS_LIBS"], [...]) step will pull in libgensiomdns.pc for information on how to build with libgensiomdns.

libgensiomdns.pc is generated from https://github.com/cminyard/gensio/blob/master/lib/libgensiomdns.pc.in.
The issue with this file is that it lists all its dependencies as Libs, instead of Libs.private or Requires.private. The result is that anything linking against libgensiomdns based on that pkgconfig file will also try linking against (among others) -lavahi-client even if nothing in the program being linked uses any symbols from there explicitly.
In the configure step of ser2net linking yaml will also try linking the stub test code configure tries to compile against -lavahi-client, necessitating the presence of avahi-devel for no other reason than not having that check fail.

The other issue this creates is that the resulting binaries will have unused direct dependencies. This is an issue with gensio as well, which I temporarily worked around in the Fedora build using a hack.

On a side note: I've recently embarked on learning about the meson build system and have used the gensio project as my study object to try it out as I thought it'd be reasonably complex to be interesting but not overwhelming.
You can look at the work I've done so far here: https://github.com/kaechele/gensio/tree/meson It's still a mess, fairly incomplete and unorganized but it's just intended for my personal learning experience.

In doing that I've found some cruft in the current autotools setup that I intend to submit patches for, eventually. One example would be libnsl which I think is unused but still being looked for by autoconf. Or that https://github.com/cminyard/gensio/blob/master/lib/libgensioosh.pc.in suffers from some copypasta from libgensiomdns.

Looking for an example "drop in" application code to replace an existing "real" serial port.

I'm looking at replacing an existing application's real serial port socket implementation with a remote ser2net serdev. This application uses a socket with read()/write() in combination with select() and poll().

What would be the best way to mimic this with the gensio library, allowing it to wait on data through poll() as a lot of other stuff is handled in the poll() loop?

I might not have looked good enough, but I could not find something in the examples.

tools/gtlsshd bug?

inspects tools/gtlsshd.
at static void handle_new(.. found this :
`

if (pw_login)
certauth_args[2] = "enable-password";
err = certauth_gensio_alloc(ssl_io, certauth_args, o,
			certauth_event, NULL, &certauth_io);
if (err) {
syslog(LOG_ERR, "Unable to allocate certauth gensio: %s",
       gensio_err_to_str(err));
exit(1);
}

err = gensio_open_nochild_s(certauth_io); 

`

looks if pw_login== false , certauth_io is not initialised, and have random pointer?

Porting gensio to an embedded system

It turns out that the makesystem does not produce an executable. Instead it produces an extensive bash script which makes it very hard to understand

  1. How to debug the code with a debugger
  2. How to port the code to an embedded system as dependencies are unclear

It would really help if the build system was simplified so that it became clear what dependancies the package has to external sources. And so that code can be debugged.

Also, the complete lack of detailed documentation of functions and datastructures makes the package literally unusable to anything else than to use the predefined tools as is which is unfortunate since there is a great need for a usable package with this functionality.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.