|
OpenVPN
|
#include "syshead.h"#include "tun.h"#include "fdmisc.h"#include "run_command.h"#include "manage.h"#include "win32.h"#include "wfp_block.h"#include "argv.h"#include "options.h"#include "socket.h"#include <string.h>#include <unistd.h>#include <sys/wait.h>#include <signal.h>#include <stdlib.h>
Go to the source code of this file.
Functions | |
| static void | tun_afunix_exec_child (const char *dev_node, struct tuntap *tt, struct env_set *env) |
| void | open_tun_afunix (struct options *o, int mtu, struct tuntap *tt, struct env_set *orig_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. | |
| 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 123 of file tun_afunix.c.
References tuntap::actual_name, tuntap::afunix, ASSERT, and afunix_context::childprocess.
Referenced by do_close_tun_simple().
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 71 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 151 of file tun_afunix.c.
References tuntap::afunix, afunix_context::childprocess, M_WARN, msg, openvpn_waitpid_check(), and read.
Referenced by read_incoming_tun().
|
static |
Definition at line 51 of file tun_afunix.c.
References tuntap::afunix, argv_free(), argv_new(), argv_printf(), afunix_context::childprocess, M_WARN, openvpn_execve_check(), openvpn_waitpid_check(), and S_NOWAITPID.
Referenced by open_tun_afunix().
| 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 138 of file tun_afunix.c.
References tuntap::afunix, afunix_context::childprocess, M_WARN, msg, openvpn_waitpid_check(), and write.
Referenced by process_outgoing_tun().