0
0
mirror of https://github.com/OpenVPN/openvpn.git synced 2024-09-20 12:02:28 +02:00
openvpn/include/openvpn-msg.h

117 lines
2.7 KiB
C
Raw Normal View History

interactive service v3 v1: Heiko Hund - Message-ID: <2215306.x9ci9DhAZ9@de-gn-40970> - extend openvpn service to provide "automatic service" and "interactive service" (which is used by GUI and OpenVPN to run openvpn non-privileged and still be able to install routes and configure IPv6 addresses) - add --msg-channel <n> option to openvpn to tell it which pipe to use to talk to the interactive service (used in tun.c for ifconfig + ARP flush, and route.c for routing) - add openvpn-msg.h with message definitions for talking to interactive service - routing in openvpn uses message-pipe automatically if --msg-channel <n> is configured, no other option needed - today, the integration in route.c and tun.c is windows-only, but could be adapted to other platforms v2: Steffan Karger - Message-ID: <548D9046.5000600@karger.me> - include "openvpn-msg.h" not "include/openvpn-msg.h" - add $(top_srcdir)/include to openvpnsrv build for out-of-tree builds v3: Gert Doering, rebasing and integrating review feedback - rebased to 417fe4a72c - r->metric_defined is now r->flags & RT_METRIC_DEFINED (c3ef2d2333fb) - move "openvpn-msg.h" include inside #ifdef WIN32 (windows-only right now) - hide "msg_channel" extra option inside tt->tuntap_options, so we do not need an extra argument to all the add/del_route...() functions - do_route_ipv6_service(): use r->adapter index (if set) for RGI6 routes Signed-off-by: Heiko Hund <heiko.hund@sophos.com> Signed-off-by: Gert Doering <gert@greenie.muc.de> Acked-by: Selva Nair <selva.nair@gmail.com> (Service changes) Acked-by: Arne Schwabe <arne@rfc2549.org> (OpenVPN changes) Message-Id: <1453835508-26119-1-git-send-email-gert@greenie.muc.de> URL: http://article.gmane.org/gmane.network.openvpn.devel/11027 Signed-off-by: Gert Doering <gert@greenie.muc.de>
2016-01-26 20:11:48 +01:00
/*
* OpenVPN -- An application to securely tunnel IP networks
* over a single TCP/UDP port, with support for SSL/TLS-based
* session authentication and key exchange,
* packet encryption, packet authentication, and
* packet compression.
*
* Copyright (C) 2013 Heiko Hund <heiko.hund@sophos.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING included with this
* distribution); if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef OPENVPN_MSG_H_
#define OPENVPN_MSG_H_
typedef enum {
msg_acknowledgement,
msg_add_address,
msg_del_address,
msg_add_route,
msg_del_route,
msg_add_dns_cfg,
msg_del_dns_cfg,
msg_add_nbt_cfg,
msg_del_nbt_cfg,
msg_flush_neighbors,
msg_add_block_dns,
msg_del_block_dns,
msg_register_dns
interactive service v3 v1: Heiko Hund - Message-ID: <2215306.x9ci9DhAZ9@de-gn-40970> - extend openvpn service to provide "automatic service" and "interactive service" (which is used by GUI and OpenVPN to run openvpn non-privileged and still be able to install routes and configure IPv6 addresses) - add --msg-channel <n> option to openvpn to tell it which pipe to use to talk to the interactive service (used in tun.c for ifconfig + ARP flush, and route.c for routing) - add openvpn-msg.h with message definitions for talking to interactive service - routing in openvpn uses message-pipe automatically if --msg-channel <n> is configured, no other option needed - today, the integration in route.c and tun.c is windows-only, but could be adapted to other platforms v2: Steffan Karger - Message-ID: <548D9046.5000600@karger.me> - include "openvpn-msg.h" not "include/openvpn-msg.h" - add $(top_srcdir)/include to openvpnsrv build for out-of-tree builds v3: Gert Doering, rebasing and integrating review feedback - rebased to 417fe4a72c - r->metric_defined is now r->flags & RT_METRIC_DEFINED (c3ef2d2333fb) - move "openvpn-msg.h" include inside #ifdef WIN32 (windows-only right now) - hide "msg_channel" extra option inside tt->tuntap_options, so we do not need an extra argument to all the add/del_route...() functions - do_route_ipv6_service(): use r->adapter index (if set) for RGI6 routes Signed-off-by: Heiko Hund <heiko.hund@sophos.com> Signed-off-by: Gert Doering <gert@greenie.muc.de> Acked-by: Selva Nair <selva.nair@gmail.com> (Service changes) Acked-by: Arne Schwabe <arne@rfc2549.org> (OpenVPN changes) Message-Id: <1453835508-26119-1-git-send-email-gert@greenie.muc.de> URL: http://article.gmane.org/gmane.network.openvpn.devel/11027 Signed-off-by: Gert Doering <gert@greenie.muc.de>
2016-01-26 20:11:48 +01:00
} message_type_t;
typedef struct {
message_type_t type;
size_t size;
int message_id;
} message_header_t;
typedef union {
struct in_addr ipv4;
struct in6_addr ipv6;
} inet_address_t;
typedef struct {
int index;
char name[256];
} interface_t;
typedef struct {
message_header_t header;
short family;
inet_address_t address;
int prefix_len;
interface_t iface;
} address_message_t;
typedef struct {
message_header_t header;
short family;
inet_address_t prefix;
int prefix_len;
inet_address_t gateway;
interface_t iface;
int metric;
} route_message_t;
typedef struct {
message_header_t header;
interface_t iface;
char domains[512];
struct in_addr primary_ipv4;
struct in_addr secondary_ipv4;
struct in_addr6 primary_ipv6;
struct in_addr6 secondary_ipv6;
} dns_cfg_message_t;
typedef struct {
message_header_t header;
interface_t iface;
int disable_nbt;
int nbt_type;
char scope_id[256];
struct in_addr primary_nbns;
struct in_addr secondary_nbns;
} nbt_cfg_message_t;
// TODO: NTP
typedef struct {
message_header_t header;
short family;
interface_t iface;
} flush_neighbors_message_t;
typedef struct {
message_header_t header;
int error_number;
} ack_message_t;
typedef struct {
message_header_t header;
interface_t iface;
} block_dns_message_t;
interactive service v3 v1: Heiko Hund - Message-ID: <2215306.x9ci9DhAZ9@de-gn-40970> - extend openvpn service to provide "automatic service" and "interactive service" (which is used by GUI and OpenVPN to run openvpn non-privileged and still be able to install routes and configure IPv6 addresses) - add --msg-channel <n> option to openvpn to tell it which pipe to use to talk to the interactive service (used in tun.c for ifconfig + ARP flush, and route.c for routing) - add openvpn-msg.h with message definitions for talking to interactive service - routing in openvpn uses message-pipe automatically if --msg-channel <n> is configured, no other option needed - today, the integration in route.c and tun.c is windows-only, but could be adapted to other platforms v2: Steffan Karger - Message-ID: <548D9046.5000600@karger.me> - include "openvpn-msg.h" not "include/openvpn-msg.h" - add $(top_srcdir)/include to openvpnsrv build for out-of-tree builds v3: Gert Doering, rebasing and integrating review feedback - rebased to 417fe4a72c - r->metric_defined is now r->flags & RT_METRIC_DEFINED (c3ef2d2333fb) - move "openvpn-msg.h" include inside #ifdef WIN32 (windows-only right now) - hide "msg_channel" extra option inside tt->tuntap_options, so we do not need an extra argument to all the add/del_route...() functions - do_route_ipv6_service(): use r->adapter index (if set) for RGI6 routes Signed-off-by: Heiko Hund <heiko.hund@sophos.com> Signed-off-by: Gert Doering <gert@greenie.muc.de> Acked-by: Selva Nair <selva.nair@gmail.com> (Service changes) Acked-by: Arne Schwabe <arne@rfc2549.org> (OpenVPN changes) Message-Id: <1453835508-26119-1-git-send-email-gert@greenie.muc.de> URL: http://article.gmane.org/gmane.network.openvpn.devel/11027 Signed-off-by: Gert Doering <gert@greenie.muc.de>
2016-01-26 20:11:48 +01:00
#endif