• Home
  • Raw
  • Download

Lines Matching +full:avahi +full:- +full:daemon

3 # (C) 2001-2015 Chris Liechti <cliechti@gmx.net>
5 # SPDX-License-Identifier: BSD-3-Clause
7 Multi-port serial<->TCP/IP forwarder.
8 - RFC 2217
9 - check existence of serial port periodically
10 - start/stop forwarders
11 - each forwarder creates a server socket and opens the serial port
12 - serial ports are opened only once. network connect/disconnect
14 - only one client per connection
29 # Try to import the avahi service definitions properly. If the avahi module is
30 # not available, fall back to a hard-coded solution that hopefully still works.
32 import avahi
34 class avahi: class
35 DBUS_NAME = "org.freedesktop.Avahi"
37 DBUS_INTERFACE_SERVER = "org.freedesktop.Avahi.Server"
39 IF_UNSPEC = -1
40 PROTO_UNSPEC, PROTO_INET, PROTO_INET6 = -1, 0, 1
45 A simple class to publish a network service with zeroconf using avahi.
62 avahi.DBUS_NAME,
63 avahi.DBUS_PATH_SERVER
65 avahi.DBUS_INTERFACE_SERVER
70 avahi.DBUS_NAME,
73 avahi.DBUS_INTERFACE_ENTRY_GROUP
76 g.AddService(avahi.IF_UNSPEC, avahi.PROTO_UNSPEC, dbus.UInt32(0),
94 Single port serial<->TCP/IP forarder that depends on an external select
96 - Buffers for serial -> network and network -> serial
97 - RFC 2217 state
98 - Zeroconf publish/unpublish on open/close.
188 """Update dictionaries for select call. insert fd->callback mapping"""
288 # connection: After 1 second of idle, start sending TCP keep-alive
289 # packets every 1 second. If 3 consecutive keep-alive packets
359 a TCP/IP <-> serial port gateway (implements RFC 2217).
361 If running as daemon, write to syslog. Otherwise write to stdout.
374 "--ports-regex",
376 default='/dev/ttyUSB[0-9]+',
382 "--tcp-port",
389 group = parser.add_argument_group("daemon")
392 "-d", "--daemon",
395 help="start as daemon",
399 "--pidfile",
407 "-o", "--logfile",
413 "-q", "--quiet",
421 "-v", "--verbose",
429 logging.basicConfig(level=VERBOSTIY[min(args.verbosity, len(VERBOSTIY) - 1)])
448 # if running as daemon is requested, do the fork magic
450 # do the UNIX double-fork magic, see Stevens' "Advanced
501 # ensure the that the daemon runs a normal user, if run as root
563 # print "select used %.3f s" % (select_end - select_start)
570 # print "operation used %.3f s" % (time.time() - select_end)