1 | /* |
1 | /* |
2 | device.C -- include the correct low-level implementation. |
2 | device.C -- include the correct low-level implementation. |
3 | Copyright (C) 2003-2004 Marc Lehmann <pcg@goof.com> |
3 | Copyright (C) 2003-2005 Marc Lehmann <gvpe@schmorp.de> |
4 | |
4 | |
|
|
5 | This file is part of GVPE. |
|
|
6 | |
5 | This program is free software; you can redistribute it and/or modify |
7 | GVPE is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by |
8 | 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 |
9 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. |
10 | (at your option) any later version. |
9 | |
11 | |
10 | This program is distributed in the hope that it will be useful, |
12 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. |
15 | GNU General Public License for more details. |
14 | |
16 | |
15 | You should have received a copy of the GNU General Public License |
17 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software |
18 | along with gvpe; if not, write to the Free Software |
17 | Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
18 | */ |
20 | */ |
19 | |
21 | |
20 | #include "config.h" |
22 | #include "config.h" |
21 | |
23 | |
22 | #include <cstring> |
24 | #include <cstring> |
… | |
… | |
30 | |
32 | |
31 | void *net_packet::operator new(size_t s) |
33 | void *net_packet::operator new(size_t s) |
32 | { |
34 | { |
33 | if (s > sizeof (data_packet)) |
35 | if (s > sizeof (data_packet)) |
34 | { |
36 | { |
35 | slog (L_ERR, _("FATAL: allocation for network packet larger than max supported packet size (%d > %d).\n"), |
37 | slog (L_ERR, _("FATAL: allocation for network packet larger than max supported packet size (%d > %d)."), |
36 | s, sizeof (data_packet)); |
38 | s, sizeof (data_packet)); |
37 | abort (); |
39 | abort (); |
38 | } |
40 | } |
39 | |
41 | |
40 | if (pkt_cachen) |
42 | if (pkt_cachen) |
… | |
… | |
65 | # include "device-tincd.C" |
67 | # include "device-tincd.C" |
66 | #elif IFTYPE_native && IF_linux |
68 | #elif IFTYPE_native && IF_linux |
67 | # include "device-linux.C" |
69 | # include "device-linux.C" |
68 | #elif IFTYPE_native && IF_cygwin |
70 | #elif IFTYPE_native && IF_cygwin |
69 | # include "device-cygwin.C" |
71 | # include "device-cygwin.C" |
|
|
72 | #elif IFTYPE_native && IF_darwin |
|
|
73 | # include "device-darwin.C" |
70 | #else |
74 | #else |
71 | # error No interface implementation for your IFTYPE/IFSUBTYPE combination. |
75 | # error No interface implementation for your IFTYPE/IFSUBTYPE combination. |
72 | #endif |
76 | #endif |
73 | |
77 | |
74 | |
78 | |