summaryrefslogtreecommitdiffstats
path: root/lib/prefix.h
diff options
context:
space:
mode:
authorChris Hall <GMCH@hestia.halldom.com>2010-01-24 18:46:20 +0000
committerChris Hall <GMCH@hestia.halldom.com>2010-01-24 18:46:20 +0000
commitc21f7fd3e23791cb6ea8a3b0b968af8892c75931 (patch)
tree0a9ee21a4feecec514223bdb7656c8b6ee2a2668 /lib/prefix.h
parent0341d5ce47c301b4a4d92b77a83930da4fdc8fb3 (diff)
downloadquagga-c21f7fd3e23791cb6ea8a3b0b968af8892c75931.tar.bz2
quagga-c21f7fd3e23791cb6ea8a3b0b968af8892c75931.tar.xz
Getting BGP Engine to start and removing warnings.
Finish the wiring required to get bgp_msg_read to process OPEN messages into the connection's open_state, and be able to check for correct peer AS, etc. Removed bugs preventing messages from being written. Added BGP Id check to collision detection logic. Removed as many warnings from comilation as possible. Replaced horrible FIFO kludge in the process. (Introduced the even more horrible miyagi kludge.) modified: bgpd/bgp_advertise.c modified: bgpd/bgp_advertise.h modified: bgpd/bgp_connection.c modified: bgpd/bgp_connection.h modified: bgpd/bgp_debug.c modified: bgpd/bgp_fsm.c modified: bgpd/bgp_msg_read.c modified: bgpd/bgp_msg_write.c modified: bgpd/bgp_network.c modified: bgpd/bgp_nexthop.c modified: bgpd/bgp_notification.c modified: bgpd/bgp_open.c modified: bgpd/bgp_packet.c modified: bgpd/bgp_session.c modified: bgpd/bgp_session.h modified: bgpd/bgpd.c modified: lib/Makefile.am modified: lib/distribute.c modified: lib/if_rmap.c new file: lib/miyagi.h modified: lib/prefix.h modified: lib/sockopt.c modified: lib/stream.c modified: lib/thread.c modified: lib/vty.c modified: lib/zebra.h modified: tests/bgp_capability_test.c modified: tests/bgp_mp_attr_test.c modified: tests/ecommunity_test.c modified: tests/heavy-thread.c modified: tests/heavy-wq.c modified: tests/heavy.c modified: tests/main.c modified: tests/test-checksum.c modified: tests/test-sig.c modified: watchquagga/watchquagga.c modified: zebra/if_netlink.c modified: zebra/ioctl.c modified: zebra/rt_netlink.c modified: zebra/rtread_netlink.c
Diffstat (limited to 'lib/prefix.h')
-rw-r--r--lib/prefix.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/prefix.h b/lib/prefix.h
index a7598b7e..1ccd4dd6 100644
--- a/lib/prefix.h
+++ b/lib/prefix.h
@@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with GNU Zebra; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * 02111-1307, USA.
*/
#ifndef _ZEBRA_PREFIX_H
@@ -25,6 +25,10 @@
#include "sockunion.h"
+#ifndef Inline
+#define Inline static inline
+#endif
+
/*
* A struct prefix contains an address family, a prefix length, and an
* address. This can represent either a 'network prefix' as defined
@@ -39,14 +43,14 @@ struct prefix
{
u_char family;
u_char prefixlen;
- union
+ union
{
u_char prefix;
struct in_addr prefix4;
#ifdef HAVE_IPV6
struct in6_addr prefix6;
#endif /* HAVE_IPV6 */
- struct
+ struct
{
struct in_addr id;
struct in_addr adv_router;
@@ -171,6 +175,12 @@ extern void apply_mask_ipv4 (struct prefix_ipv4 *);
#define PREFIX_COPY_IPV4(DST, SRC) \
*((struct prefix_ipv4 *)(DST)) = *((const struct prefix_ipv4 *)(SRC));
+Inline void
+prefix_copy_ipv4(struct prefix* dst, struct prefix* src)
+{
+ *dst = *src ;
+} ;
+
extern int prefix_ipv4_any (const struct prefix_ipv4 *);
extern void apply_classful_mask_ipv4 (struct prefix_ipv4 *);
@@ -193,7 +203,13 @@ extern int str2prefix_ipv6 (const char *, struct prefix_ipv6 *);
extern void apply_mask_ipv6 (struct prefix_ipv6 *);
#define PREFIX_COPY_IPV6(DST, SRC) \
- *((struct prefix_ipv6 *)(DST)) = *((const struct prefix_ipv6 *)(SRC));
+ *((struct prefix_ipv6 *)(DST)) = *((const struct prefix_ipv6 *)(SRC));
+
+Inline void
+prefix_copy_ipv6(struct prefix* dst, struct prefix* src)
+{
+ *dst = *src ;
+} ;
extern int ip6_masklen (struct in6_addr);
extern void masklen2ip6 (int, struct in6_addr *);