I want to use art routing tables with pf addrs and not sockaddrs.
Art itself does not care but the API requires sockaddr pointers in some
places. This changes those to void *.

OK? This is step 2 to a new pf_table backend.
-- 
:wq Claudio

Index: net/art.c
===================================================================
RCS file: /cvs/src/sys/net/art.c,v
retrieving revision 1.24
diff -u -p -r1.24 art.c
--- net/art.c   15 Sep 2016 02:00:18 -0000      1.24
+++ net/art.c   10 Oct 2016 18:16:36 -0000
@@ -247,7 +247,7 @@ art_findex(struct art_table *at, uint8_t
  * Return the best existing match for a destination.
  */
 struct art_node *
-art_match(struct art_root *ar, uint8_t *addr, struct srp_ref *nsr)
+art_match(struct art_root *ar, void *addr, struct srp_ref *nsr)
 {
        struct srp_ref          dsr, ndsr;
        void                    *entry;
@@ -310,7 +310,7 @@ done:
  * it does not exist.
  */
 struct art_node *
-art_lookup(struct art_root *ar, uint8_t *addr, int plen, struct srp_ref *nsr)
+art_lookup(struct art_root *ar, void *addr, int plen, struct srp_ref *nsr)
 {
        void                    *entry;
        struct art_table        *at;
@@ -368,7 +368,7 @@ done:
  * same destination/mask pair is already present.
  */
 struct art_node *
-art_insert(struct art_root *ar, struct art_node *an, uint8_t *addr, int plen)
+art_insert(struct art_root *ar, struct art_node *an, void *addr, int plen)
 {
        struct art_table        *at, *child;
        struct art_node         *node;
@@ -472,7 +472,7 @@ art_table_insert(struct art_root *ar, st
  * Deletion API function.
  */
 struct art_node *
-art_delete(struct art_root *ar, struct art_node *an, uint8_t *addr, int plen)
+art_delete(struct art_root *ar, struct art_node *an, void *addr, int plen)
 {
        struct art_table        *at;
        struct art_node         *node;
@@ -922,7 +922,7 @@ moveup:
 }
 
 struct art_node *
-art_get(struct sockaddr *dst, uint8_t plen)
+art_get(void *dst, uint8_t plen)
 {
        struct art_node         *an;
 
Index: net/art.h
===================================================================
RCS file: /cvs/src/sys/net/art.h,v
retrieving revision 1.15
diff -u -p -r1.15 art.h
--- net/art.h   30 Aug 2016 07:42:57 -0000      1.15
+++ net/art.h   10 Oct 2016 18:16:36 -0000
@@ -48,7 +48,7 @@ struct rtentry;
 struct art_node {
        SRPL_HEAD(, rtentry)     an_rtlist;     /* Route related to this node */
        union {
-               struct sockaddr *an__dst;       /* Destination address (key) */
+               void            *an__dst;       /* Destination address (key) */
                struct art_node *an__gc;        /* Entry on GC list */
        }                        an_pointer;
        uint8_t                  an_plen;       /* Prefix length */
@@ -58,17 +58,17 @@ struct art_node {
 
 void            art_init(void);
 struct art_root        *art_alloc(unsigned int, unsigned int, unsigned int);
-struct art_node *art_insert(struct art_root *, struct art_node *, uint8_t *,
+struct art_node *art_insert(struct art_root *, struct art_node *, void *,
                     int);
-struct art_node *art_delete(struct art_root *, struct art_node *, uint8_t *,
+struct art_node *art_delete(struct art_root *, struct art_node *, void *,
                     int);
-struct art_node        *art_match(struct art_root *, uint8_t *, struct srp_ref 
*);
-struct art_node *art_lookup(struct art_root *, uint8_t *, int,
+struct art_node        *art_match(struct art_root *, void *, struct srp_ref *);
+struct art_node *art_lookup(struct art_root *, void *, int,
                     struct srp_ref *);
 int             art_walk(struct art_root *,
                     int (*)(struct art_node *, void *), void *);
 
-struct art_node        *art_get(struct sockaddr *, uint8_t);
+struct art_node        *art_get(void *, uint8_t);
 void            art_put(struct art_node *);
 
 #endif /* _NET_ART_H_ */

Reply via email to