From: claudio Date: Wed, 14 Dec 2022 12:37:15 +0000 (+0000) Subject: Move some basic accessors of aspath to rde.h and make them static inline. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3fad667eb0a5828371d472abc235a42511fc7f6d;p=openbsd Move some basic accessors of aspath to rde.h and make them static inline. OK tb@ --- diff --git a/usr.sbin/bgpd/rde.h b/usr.sbin/bgpd/rde.h index 57424e5deef..35017f58190 100644 --- a/usr.sbin/bgpd/rde.h +++ b/usr.sbin/bgpd/rde.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.h,v 1.273 2022/09/23 15:49:20 claudio Exp $ */ +/* $OpenBSD: rde.h,v 1.274 2022/12/14 12:37:15 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker and @@ -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); @@ -456,6 +453,25 @@ 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 *, struct rde_peer *); diff --git a/usr.sbin/bgpd/rde_attr.c b/usr.sbin/bgpd/rde_attr.c index 56f65231b43..f6e24baffdb 100644 --- a/usr.sbin/bgpd/rde_attr.c +++ b/usr.sbin/bgpd/rde_attr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_attr.c,v 1.131 2022/09/01 13:19:11 claudio Exp $ */ +/* $OpenBSD: rde_attr.c,v 1.132 2022/12/14 12:37:15 claudio Exp $ */ /* * Copyright (c) 2004 Claudio Jeker @@ -516,18 +516,6 @@ aspath_merge(struct rde_aspath *a, struct attr *attr) 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) { @@ -542,12 +530,6 @@ aspath_neighbor(struct aspath *aspath) return (aspath_extract(aspath->data, 0)); } -uint32_t -aspath_origin(struct aspath *aspath) -{ - return aspath->source_as; -} - static uint16_t aspath_count(const void *data, uint16_t len) {