OpenVPN
|
Go to the source code of this file.
Functions | |
void | open_tun_afunix (struct options *o, int mtu, struct tuntap *tt, struct env_set *env) |
Opens an AF_UNIX based tun device. | |
void | close_tun_afunix (struct tuntap *tt) |
Closes the socket used for the AF_UNIX based device. | |
ssize_t | write_tun_afunix (struct tuntap *tt, uint8_t *buf, int len) |
Writes a packet to a AF_UNIX based tun device. | |
ssize_t | read_tun_afunix (struct tuntap *tt, uint8_t *buf, int len) |
Reads a packet from a AF_UNIX based tun device. | |
static bool | is_tun_afunix (const char *devnode) |
Checks whether a –dev-node parameter specifies a AF_UNIX device. | |
void close_tun_afunix | ( | struct tuntap * | tt | ) |
Closes the socket used for the AF_UNIX based device.
Also sends a SIGINT to the child process that was spawned to handle the tun device
Definition at line 129 of file tun_afunix.c.
References tuntap::actual_name, tuntap::afunix, ASSERT, and afunix_context::childprocess.
Referenced by do_close_tun_simple().
|
inlinestatic |
Checks whether a –dev-node parameter specifies a AF_UNIX device.
devnode | the string to check |
Definition at line 69 of file tun_afunix.h.
References strprefix().
Referenced by do_init_tun().
Opens an AF_UNIX based tun device.
This also executes the command that the user provided taking care of implementing the actual tun device.
Definition at line 74 of file tun_afunix.c.
References tuntap::actual_name, options::dev, options::dev_node, options::dev_type, dev_type_string(), env_set_create(), env_set_inherit(), gc, gc_free(), gc_new(), options::lladdr, M_ERR, msg, options::route_default_gateway, set_cloexec(), setenv_int(), setenv_str(), socket_set_buffers(), string_alloc(), and tun_afunix_exec_child().
Referenced by open_tun_backend().
ssize_t read_tun_afunix | ( | struct tuntap * | tt, |
uint8_t * | buf, | ||
int | len | ||
) |
Reads a packet from a AF_UNIX based tun device.
Definition at line 157 of file tun_afunix.c.
References tuntap::afunix, afunix_context::childprocess, M_WARN, msg, openvpn_waitpid_check(), and read.
Referenced by read_incoming_tun().
ssize_t write_tun_afunix | ( | struct tuntap * | tt, |
uint8_t * | buf, | ||
int | len | ||
) |
Writes a packet to a AF_UNIX based tun device.
Definition at line 144 of file tun_afunix.c.
References tuntap::afunix, afunix_context::childprocess, M_WARN, msg, openvpn_waitpid_check(), and write.
Referenced by process_outgoing_tun().