Copyright update for 2011
[bcusdk.git] / eibd / server / b-EIBNETIP.h
blob89c3fe2a49eda4474a452bdb37ff47370d6399f1
1 /*
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_EIBNETIP_H
21 #define C_EIBNETIP_H
23 #include <stdlib.h>
24 #include "eibnetrouter.h"
26 #define EIBNETIP_URL "ip:[multicast_addr[:port]]\n"
27 #define EIBNETIP_DOC "ip connects with the EIBnet/IP Routing protocol over an EIBnet/IP gateway. The gateway must be so configured, that it routes the necessary addresses\n\n"
29 #define EIBNETIP_PREFIX "ip"
30 #define EIBNETIP_CREATE eibnetip_Create
31 #define EIBNETIP_CLEANUP NULL
33 inline Layer2Interface *
34 eibnetip_Create (const char *dev, int flags, Trace * t)
36 if (!*dev)
37 return new EIBNetIPRouter ("224.0.23.12", 3671, arg.addr, t);
38 char *a = strdup (dev);
39 char *b;
40 int port;
41 Layer2Interface *c;
42 if (!a)
43 die ("out of memory");
44 for (b = a; *b; b++)
45 if (*b == ':')
46 break;
47 if (*b == ':')
49 *b = 0;
50 port = atoi (b + 1);
52 else
53 port = 3671;
54 c = new EIBNetIPRouter (a, port, arg.addr, t);
55 free (a);
56 return c;
59 #endif