David van Moolenbroek 181fb1b2b5 RS: add infrastructure for mapping socket drivers
This patch introduces the first piece of support for the concept of
"socket drivers": services that implement one or more socket protocol
families.  The latter are also known as "domains", as per the first
parameter of the socket(2) API.  More specifically, this patch adds
the basic infrastructure for specifying that a particular service is
the socket driver for a set of domains.

Unlike major number mappings for block and character drivers, socket
domain mappings are static.  For that reason, they are specified in
system.conf files, using the "domain" keyword.  Such a keyword is to
be followed by one or more protocol families, without their "PF_"
prefix.  For example, a service with the line "domain INET INET6;"
will be mapped as the socket driver responsible for the AF_INET and
AF_INET6 protocol families.

This patch implements only the infrastructure for creating such
mappings; the actual mapping will be implemented in VFS in a later
patch.  The infrastructure is implemented in service(8), RS, and VFS.

For now there is a hardcoded limit of eight domains per socket driver.
This may sound like a lot, but the upcoming new LWIP service will
already use four of those.  Also, it is allowed for a service to be
both a block/character driver and a socket driver at the same time,
which is a requirement for the new LWIP service.

Change-Id: I93352d488fc6c481e7079248082895d388c39f2d
2017-03-09 23:39:49 +00:00

26 lines
745 B
C

#define KW_SERVICE "service"
#define KW_UID "uid"
#define KW_SELF "SELF"
#define KW_SIGMGR "sigmgr"
#define KW_SCHEDULER "scheduler"
#define KW_PRIORITY "priority"
#define KW_QUANTUM "quantum"
#define KW_CPU "cpu"
#define KW_IRQ "irq"
#define KW_IO "io"
#define KW_PCI "pci"
#define KW_DEVICE "device"
#define KW_CLASS "class"
#define KW_SYSTEM "system"
#define KW_IPC "ipc"
#define KW_VM "vm"
#define KW_CONTROL "control"
#define KW_ALL "ALL"
#define KW_ALL_SYS "ALL_SYS"
#define KW_NONE "NONE"
#define KW_BASIC "BASIC"
#define KW_TYPE "type" /* set service type */
#define KW_NET "net" /* ethernet driver type */
#define KW_DESCR "descr" /* human-readable string */
#define KW_DOMAIN "domain" /* socket domain (protocol family) */