[Nut-upsdev] network serial patch for nut-2.0
Charles Lepple
clepple at gmail.com
Fri Aug 14 23:19:06 UTC 2009
On Aug 14, 2009, at 3:13 PM, Stuart D. Gathman wrote:
> We also often attach the serial cable from a UPS to a network terminal
> server, since servers these days don't come with very many serial
> ports.
> (They call them "legacy" ports.) I submitted a patch to support
> these for
> nut-1.x, and it was rejected - for very rational reasons. But I am
> trying
> again. It allows you to specify "port = trmsrv1:4015" for instance if
> the UPS is connected to a serial port on trmsrv1 listening on 4015.
> Baud
> rate, etc, are configured on the terminal server in this case, and
> set_set_speed is ignored. (In theory, it could log on to the terminal
> server in admin mode and auto configure, but that would be highly
> device
> dependent. Maybe doable with an expect script and admin port.)
This looks like some useful functionality.
Anticipating some of the other developers' comments, we might want to
add IPv6 support here, and there could be some code reuse with the
existing client-side TCP setup.
Also, I think there are a few error-checking string functions that we
could swap in (xstrdup() for alloca/strcpy). Not to be too pedantic,
but we should probably free the string at the end of ser_open() as well.
As with the other patch, I will try to take a look at it this weekend.
Hopefully the changes between 2.0.x and 2.4.1 should be minimal.
--
Charles Lepple
clepple at gmail
More information about the Nut-upsdev
mailing list