3 * System definitions and capabilities.
4 * $Id: system.c,v 1.5 2004/11/14 02:45:51 cpressey Exp $
8 #include <sys/sysctl.h>
27 sysctl(mib
, 2, NULL
, &len
, NULL
, 0);
29 sysctl(mib
, 2, p
, &len
, NULL
, 0);
54 * Get transport from transport name.
56 * return(0) if transport is not supported.
57 * retirn(-1) if transport unknown.
60 get_transport(const char *transport_name
)
62 if (strcmp(transport_name
, "npipe") == 0) {
64 return DFUI_TRANSPORT_NPIPE
;
66 } else if (strcmp(transport_name
, "tcp") == 0) {
68 return DFUI_TRANSPORT_TCP
;
75 * Get transport upon user request
77 * Print appropriate error message to stderr
78 * and exit if transport not supported or unknown.
81 user_get_transport(const char *transport_name
)
85 transport
= get_transport(transport_name
);
88 errx(EX_UNAVAILABLE
, "Transport is not supported: ``%s''.\n",
90 } else if (transport
< 0) {
91 errx(EX_CONFIG
, "Wrong transport name: ``%s''.\n",