by that make them private. Remove no longer used AID_PTSIZE define.
OK tb@
-/* $OpenBSD: bgpd.h,v 1.467 2023/03/28 12:15:23 claudio Exp $ */
+/* $OpenBSD: bgpd.h,v 1.468 2023/03/28 13:30:31 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
{ AFI_IPv6, AF_INET6, SAFI_MPLSVPN, "IPv6 vpn" } \
}
-#define AID_PTSIZE { \
- 0, \
- sizeof(struct pt_entry4), \
- sizeof(struct pt_entry6), \
- sizeof(struct pt_entry_vpn4), \
- sizeof(struct pt_entry_vpn6) \
-}
-
-
#define BGP_MPLS_BOS 0x01
struct bgpd_addr {
-/* $OpenBSD: rde.h,v 1.286 2023/03/13 16:52:42 claudio Exp $ */
+/* $OpenBSD: rde.h,v 1.287 2023/03/28 13:30:31 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> and
uint8_t aid;
uint8_t prefixlen;
uint16_t refcnt;
-};
-
-struct pt_entry4 {
- RB_ENTRY(pt_entry) pt_e;
- uint8_t aid;
- uint8_t prefixlen;
- uint16_t refcnt;
- struct in_addr prefix4;
-};
-
-struct pt_entry6 {
- RB_ENTRY(pt_entry) pt_e;
- uint8_t aid;
- uint8_t prefixlen;
- uint16_t refcnt;
- struct in6_addr prefix6;
-};
-
-struct pt_entry_vpn4 {
- RB_ENTRY(pt_entry) pt_e;
- uint8_t aid;
- uint8_t prefixlen;
- uint16_t refcnt;
- struct in_addr prefix4;
- uint64_t rd;
- uint8_t labelstack[21];
- uint8_t labellen;
- uint8_t pad1;
- uint8_t pad2;
-};
-
-struct pt_entry_vpn6 {
- RB_ENTRY(pt_entry) pt_e;
- uint8_t aid;
- uint8_t prefixlen;
- uint16_t refcnt;
- struct in6_addr prefix6;
- uint64_t rd;
- uint8_t labelstack[21];
- uint8_t labellen;
- uint8_t pad1;
- uint8_t pad2;
+ uint8_t data[4]; /* data depending on aid */
};
struct prefix {
-/* $OpenBSD: rde_prefix.c,v 1.43 2023/03/28 12:06:15 claudio Exp $ */
+/* $OpenBSD: rde_prefix.c,v 1.44 2023/03/28 13:30:31 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org>
static struct pt_entry *pt_alloc(struct pt_entry *);
static void pt_free(struct pt_entry *);
-size_t pt_sizes[AID_MAX] = AID_PTSIZE;
+struct pt_entry4 {
+ RB_ENTRY(pt_entry) pt_e;
+ uint8_t aid;
+ uint8_t prefixlen;
+ uint16_t refcnt;
+ struct in_addr prefix4;
+};
+
+struct pt_entry6 {
+ RB_ENTRY(pt_entry) pt_e;
+ uint8_t aid;
+ uint8_t prefixlen;
+ uint16_t refcnt;
+ struct in6_addr prefix6;
+};
+
+struct pt_entry_vpn4 {
+ RB_ENTRY(pt_entry) pt_e;
+ uint8_t aid;
+ uint8_t prefixlen;
+ uint16_t refcnt;
+ struct in_addr prefix4;
+ uint64_t rd;
+ uint8_t labelstack[21];
+ uint8_t labellen;
+ uint8_t pad1;
+ uint8_t pad2;
+};
+
+struct pt_entry_vpn6 {
+ RB_ENTRY(pt_entry) pt_e;
+ uint8_t aid;
+ uint8_t prefixlen;
+ uint16_t refcnt;
+ struct in6_addr prefix6;
+ uint64_t rd;
+ uint8_t labelstack[21];
+ uint8_t labellen;
+ uint8_t pad1;
+ uint8_t pad2;
+};
+
+size_t pt_sizes[AID_MAX] = {
+ 0,
+ sizeof(struct pt_entry4),
+ sizeof(struct pt_entry6),
+ sizeof(struct pt_entry_vpn4),
+ sizeof(struct pt_entry_vpn6)
+};
RB_HEAD(pt_tree, pt_entry);
RB_PROTOTYPE(pt_tree, pt_entry, pt_e, pt_prefix_cmp);