This helps me in regress for the new ASAP unittest.
I think making these accessors static inline makes sense here.
--
:wq Claudio
Index: rde.h
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/rde.h,v
retrieving revision 1.273
diff -u -p -r1.273 rde.h
--- rde.h 23 Sep 2022 15:49:20 -0000 1.273
+++ rde.h 14 Dec 2022 11:41:19 -0000
@@ -444,10 +444,7 @@ struct aspath *aspath_copy(struct aspath
void aspath_put(struct aspath *);
u_char *aspath_deflate(u_char *, uint16_t *, int *);
void aspath_merge(struct rde_aspath *, struct attr *);
-u_char *aspath_dump(struct aspath *);
-uint16_t aspath_length(struct aspath *);
uint32_t aspath_neighbor(struct aspath *);
-uint32_t aspath_origin(struct aspath *);
int aspath_loopfree(struct aspath *, uint32_t);
int aspath_compare(struct aspath *, struct aspath *);
int aspath_match(struct aspath *, struct filter_as *, uint32_t);
@@ -455,6 +452,25 @@ u_char *aspath_prepend(struct aspath *,
u_char *aspath_override(struct aspath *, uint32_t, uint32_t,
uint16_t *);
int aspath_lenmatch(struct aspath *, enum aslen_spec, u_int);
+
+static inline u_char *
+aspath_dump(struct aspath *aspath)
+{
+ return (aspath->data);
+}
+
+static inline uint16_t
+aspath_length(struct aspath *aspath)
+{
+ return (aspath->len);
+}
+
+static inline uint32_t
+aspath_origin(struct aspath *aspath)
+{
+ return aspath->source_as;
+}
+
/* rde_community.c */
int community_match(struct rde_community *, struct community *,
Index: rde_attr.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/rde_attr.c,v
retrieving revision 1.131
diff -u -p -r1.131 rde_attr.c
--- rde_attr.c 1 Sep 2022 13:19:11 -0000 1.131
+++ rde_attr.c 14 Dec 2022 11:41:19 -0000
@@ -516,18 +516,6 @@ aspath_merge(struct rde_aspath *a, struc
attr_free(a, attr);
}
-u_char *
-aspath_dump(struct aspath *aspath)
-{
- return (aspath->data);
-}
-
-uint16_t
-aspath_length(struct aspath *aspath)
-{
- return (aspath->len);
-}
-
uint32_t
aspath_neighbor(struct aspath *aspath)
{
@@ -540,12 +528,6 @@ aspath_neighbor(struct aspath *aspath)
aspath->data[0] != AS_SEQUENCE)
return (rde_local_as());
return (aspath_extract(aspath->data, 0));
-}
-
-uint32_t
-aspath_origin(struct aspath *aspath)
-{
- return aspath->source_as;
}
static uint16_t