int device_fd = -1;
char *device = NULL;
char *iface = NULL;
-static char *device_info = NULL;
+static const char *device_info = "OS X utun device";
#if defined(ENABLE_TUNEMU)
static device_type_t device_type = DEVICE_TYPE_TUNEMU;
#elif defined(HAVE_OPENBSD) || defined(HAVE_FREEBSD) || defined(HAVE_DRAGONFLY)
iface = xstrdup(name);
}
- device_info = "OS X utun device";
-
logger(DEBUG_ALWAYS, LOG_INFO, "%s is a %s", device, device_info);
return true;
static HANDLE device_handle = INVALID_HANDLE_VALUE;
char *device = NULL;
char *iface = NULL;
-static char *device_info = NULL;
+static const char *device_info = "Windows tap device";
static pid_t reader_pid;
static int sp[2];
return false;
}
- device_info = "Windows tap device";
-
logger(DEBUG_ALWAYS, LOG_INFO, "%s (%s) is a %s", device, iface, device_info);
return true;
#include "device.h"
#include "logger.h"
#include "net.h"
+#include "xalloc.h"
-static char *device_info = "dummy device";
+static const char *device_info = "dummy device";
static bool setup_device(void) {
- device = "dummy";
- iface = "dummy";
+ device = xstrdup("dummy");
+ iface = xstrdup("dummy");
logger(DEBUG_ALWAYS, LOG_INFO, "%s (%s) is a %s", device, iface, device_info);
return true;
}
char *iface = NULL;
static char *type = NULL;
static char ifrname[IFNAMSIZ];
-static char *device_info;
+static const char *device_info;
static bool setup_device(void) {
if(!get_config_string(lookup_config(config_tree, "Device"), &device)) {
static vpn_packet_t device_write_packet;
char *device = NULL;
char *iface = NULL;
-static char *device_info = NULL;
+static const char *device_info = "Windows tap device";
extern char *myport;
#include "route.h"
#include "xalloc.h"
-static char *device_info;
+static const char *device_info = "multicast socket";
static struct addrinfo *ai = NULL;
static mac_t ignore_src = {{0}};
char *space;
int ttl = 1;
- device_info = "multicast socket";
-
get_config_string(lookup_config(config_tree, "Interface"), &iface);
if(!get_config_string(lookup_config(config_tree, "Device"), &device)) {
#include "xalloc.h"
#if defined(PF_PACKET) && defined(ETH_P_ALL) && defined(AF_PACKET) && defined(SIOCGIFINDEX)
-static char *device_info;
+static const char *device_info = "raw_socket";
static bool setup_device(void) {
struct ifreq ifr;
device = xstrdup(iface);
}
- device_info = "raw socket";
-
if((device_fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL))) < 0) {
logger(DEBUG_ALWAYS, LOG_ERR, "Could not open %s: %s", device_info,
strerror(errno));
static int ip_fd = -1;
char *device = NULL;
char *iface = NULL;
-static char *device_info = NULL;
+static const char *device_info = NULL;
static bool setup_device(void) {
char *type;
static int data_fd = -1;
static int write_fd = -1;
static int state = 0;
-static char *device_info;
+static const char *device_info = "UML network socket";
enum request_type { REQ_NEW_CONTROL };
get_config_string(lookup_config(config_tree, "Interface"), &iface);
- device_info = "UML network socket";
-
if((write_fd = socket(PF_UNIX, SOCK_DGRAM, 0)) < 0) {
logger(DEBUG_ALWAYS, LOG_ERR, "Could not open write %s: %s", device_info, strerror(errno));
event_exit();
static struct vdeconn *conn = NULL;
static int port = 0;
static char *group = NULL;
-static char *device_info;
+static const char *device_info = "VDE socket";
static bool setup_device(void) {
libvdeplug_dynopen(plug);
get_config_string(lookup_config(config_tree, "VDEGroup"), &group);
- device_info = "VDE socket";
-
struct vde_open_args args = {
.port = port,
.group = group,