Paul Jakma | 010ebbb | 2014-09-16 11:53:49 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2006 Sun Microsystems, Inc. |
| 3 | * |
| 4 | * This file is part of Quagga. |
| 5 | * |
| 6 | * Quagga is free software; you can redistribute it and/or modify it |
| 7 | * under the terms of the GNU General Public License as published by the |
| 8 | * Free Software Foundation; either version 2, or (at your option) any |
| 9 | * later version. |
| 10 | * |
| 11 | * Quagga is distributed in the hope that it will be useful, but |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with Quagga; see the file COPYING. If not, write to the Free |
| 18 | * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 19 | * 02111-1307, USA. |
| 20 | */ |
| 21 | |
Paul Jakma | 457eb9a | 2006-07-27 19:59:58 +0000 | [diff] [blame] | 22 | #include <zebra.h> |
| 23 | |
| 24 | #include "zebra/rib.h" |
| 25 | #include "zebra/rt.h" |
| 26 | #include "zebra/ioctl.h" |
| 27 | |
| 28 | void ifreq_set_name (struct ifreq *a, struct interface *b) { return; } |
| 29 | |
Paul Jakma | d9d00a6 | 2007-04-10 19:28:04 +0000 | [diff] [blame] | 30 | int if_set_prefix (struct interface *a, struct connected *b) |
| 31 | { |
| 32 | kernel_address_add_ipv4 (a, b); |
| 33 | return 0; |
| 34 | } |
| 35 | |
| 36 | int if_unset_prefix (struct interface *a, struct connected *b) |
| 37 | { |
| 38 | kernel_address_delete_ipv4 (a, b); |
| 39 | return 0; |
| 40 | } |
| 41 | |
| 42 | int if_prefix_add_ipv6 (struct interface *a, struct connected *b) { return 0; } |
Doug VanLeuven | 327c4cd | 2012-12-14 14:58:30 +0200 | [diff] [blame] | 43 | #ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA |
Paul Jakma | d9d00a6 | 2007-04-10 19:28:04 +0000 | [diff] [blame] | 44 | #pragma weak if_prefix_delete_ipv6 = if_prefix_add_ipv6 |
Doug VanLeuven | 327c4cd | 2012-12-14 14:58:30 +0200 | [diff] [blame] | 45 | #else |
| 46 | int if_prefix_delete_ipv6 (struct interface *a, struct connected *b) { return 0; } |
| 47 | #endif |
Paul Jakma | 457eb9a | 2006-07-27 19:59:58 +0000 | [diff] [blame] | 48 | |
| 49 | int if_ioctl (u_long a, caddr_t b) { return 0; } |
| 50 | |
| 51 | int if_set_flags (struct interface *a, uint64_t b) { return 0; } |
Doug VanLeuven | 327c4cd | 2012-12-14 14:58:30 +0200 | [diff] [blame] | 52 | #ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA |
Paul Jakma | 457eb9a | 2006-07-27 19:59:58 +0000 | [diff] [blame] | 53 | #pragma weak if_unset_flags = if_set_flags |
Doug VanLeuven | 327c4cd | 2012-12-14 14:58:30 +0200 | [diff] [blame] | 54 | #else |
| 55 | int if_unset_flags (struct interface *a, uint64_t b) { return 0; } |
| 56 | #endif |
Paul Jakma | 457eb9a | 2006-07-27 19:59:58 +0000 | [diff] [blame] | 57 | |
| 58 | void if_get_flags (struct interface *a) { return; } |
Doug VanLeuven | 327c4cd | 2012-12-14 14:58:30 +0200 | [diff] [blame] | 59 | #ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA |
Paul Jakma | 457eb9a | 2006-07-27 19:59:58 +0000 | [diff] [blame] | 60 | #pragma weak if_get_metric = if_get_flags |
| 61 | #pragma weak if_get_mtu = if_get_flags |
Doug VanLeuven | 327c4cd | 2012-12-14 14:58:30 +0200 | [diff] [blame] | 62 | #else |
| 63 | /* void if_get_metric (struct interface *a) { return; } */ |
| 64 | /* void if_get_mtu (struct interface *a) { return; } */ |
| 65 | #endif |
Paul Jakma | 457eb9a | 2006-07-27 19:59:58 +0000 | [diff] [blame] | 66 | |
| 67 | #ifdef SOLARIS_IPV6 |
| 68 | #pragma weak if_ioctl_ipv6 = if_ioctl |
| 69 | struct connected *if_lookup_linklocal(struct interface *a) { return 0; } |
| 70 | |
| 71 | #define AF_IOCTL(af, request, buffer) \ |
| 72 | ((af) == AF_INET? if_ioctl(request, buffer) : \ |
| 73 | if_ioctl_ipv6(request, buffer)) |
| 74 | #else /* SOLARIS_IPV6 */ |
| 75 | |
| 76 | #define AF_IOCTL(af, request, buffer) if_ioctl(request, buffer) |
| 77 | |
| 78 | #endif /* SOLARIS_IPV6 */ |