lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Wed, 29 Jul 2015 14:57:39 +0200
From:	"Jason A. Donenfeld" <Jason@...c4.com>
To:	netdev@...r.kernel.org
Subject: Simplified API over the FIB Trie

Hi folks,

In a module I'm working on, I need a data structure that's similar to
a routing table. I'm looking at net/ip_fib.h and net/ip6_fib.h as a
means for doing this, but it's wildly complex. What I'm looking for is
something with a basic API like this:

http://codepad.org/S36n9t7W

=-=-=-=-=-=BEGIN API-=-=-=-=-=-=
int routing_table_v4_insert(struct routing_table_v4 *table, const
struct in_addr *ip, uint8_t cidr, void *value);
void *routing_table_v4_lookup(struct routing_table_v4 *table, const
struct in_addr *ip);
void *routing_table_v4_lookup_exact(struct routing_table_v4 *table,
const struct in_addr *ip, uint8_t cidr);
int routing_table_v4_remove_by_key(struct routing_table_v4 *table,
const struct in_addr *ip, uint8_t cidr);
int routing_table_v4_remove_by_value(struct routing_table_v4 *table,
void *value);

int routing_table_v6_insert(struct routing_table_v6 *table, const
struct in6_addr *ip, uint8_t cidr, void *value);
void *routing_table_v6_lookup(struct routing_table_v6 *table, const
struct in6_addr *ip);
void *routing_table_v6_lookup_exact(struct routing_table_v6 *table,
const struct in6_addr *ip, uint8_t cidr);
int routing_table_v6_remove_by_key(struct routing_table_v6 *table,
const struct in6_addr *ip, uint8_t cidr);
int routing_table_v6_remove_by_value(struct routing_table_v6 *table,
void *value);
=-=-=-=-=-=END API-=-=-=-=-=-=-=

I'm wondering from those who know this code well if the structure in
net/ip_fib.h and net/ip6_fib.h is suitable for what I want. Or, if I
should look elsewhere. Or, if I should in fact roll my own.

Thanks,
Jason
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ