2 EIBD eib bus access and management daemon
3 Copyright (C) 2005-2011 Martin Koegler <mkoegler@auto.tuwien.ac.at>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #ifndef C_EIBNETIPTUNNEL_H
21 #define C_EIBNETIPTUNNEL_H
24 #include "eibnettunnel.h"
26 #define EIBNETIPTUNNEL_URL "ipt:router-ip[:dest-port[:src-port[:nat-ip[:data-port]]]]]\n"
27 #define EIBNETIPTUNNEL_DOC "ipt connects with the EIBnet/IP Tunneling protocol over an EIBnet/IP gateway. The gateway must be so configured, that it routes the necessary addresses\n\n"
29 #define EIBNETIPTUNNEL_PREFIX "ipt"
30 #define EIBNETIPTUNNEL_CREATE eibnetiptunnel_Create
31 #define EIBNETIPTUNNEL_CLEANUP NULL
33 #define EIBNETIPTUNNELNAT_URL "iptn:router-ip[:dest-port[:src-port]]\n"
34 #define EIBNETIPTUNNELNAT_DOC "iptn connects with the EIBnet/IP Tunneling protocol over an EIBnet/IP gateway using the NAT mode\n\n"
36 #define EIBNETIPTUNNELNAT_PREFIX "iptn"
37 #define EIBNETIPTUNNELNAT_CREATE eibnetiptunnelnat_Create
38 #define EIBNETIPTUNNELNAT_CLEANUP NULL
41 inline Layer2Interface
*
42 eibnetiptunnel_Create (const char *dev
, int flags
, Trace
* t
)
44 char *a
= strdup (dev
);
52 Layer2Interface
*iface
;
54 die ("out of memory");
62 for (c
= b
+ 1; *c
; c
++)
68 for (d
= c
+ 1; *d
; d
++)
73 for (e
= d
+ 1; *e
; e
++)
77 dataport
= atoi (e
+ 1);
91 iface
= new EIBNetIPTunnel (a
, dport
, sport
, d
, dataport
, flags
, t
);
96 inline Layer2Interface
*
97 eibnetiptunnelnat_Create (const char *dev
, int flags
, Trace
* t
)
99 char *a
= strdup (dev
);
104 Layer2Interface
*iface
;
106 die ("out of memory");
114 for (c
= b
+ 1; *c
; c
++)
120 sport
= atoi (c
+ 1);
122 dport
= atoi (b
+ 1);
127 iface
= new EIBNetIPTunnel (a
, dport
, sport
, "0.0.0.0", -1, flags
, t
);