-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IPv4]: FIB configuration using struct fib_config
Introduces struct fib_config replacing the ugly struct kern_rta prone to ordering issues. Avoids creating faked netlink messages for auto generated routes or requests via ioctl. A new interface net/nexthop.h is added to help navigate through nexthop configuration arrays. A new struct nl_info will be used to carry the necessary netlink information to be used for notifications later on. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Thomas Graf
authored and
David S. Miller
committed
Sep 22, 2006
1 parent
ab32ea5
commit 4e902c5
Showing
8 changed files
with
560 additions
and
468 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#ifndef __NET_NEXTHOP_H | ||
#define __NET_NEXTHOP_H | ||
|
||
#include <linux/rtnetlink.h> | ||
#include <net/netlink.h> | ||
|
||
static inline int rtnh_ok(const struct rtnexthop *rtnh, int remaining) | ||
{ | ||
return remaining >= sizeof(*rtnh) && | ||
rtnh->rtnh_len >= sizeof(*rtnh) && | ||
rtnh->rtnh_len <= remaining; | ||
} | ||
|
||
static inline struct rtnexthop *rtnh_next(const struct rtnexthop *rtnh, | ||
int *remaining) | ||
{ | ||
int totlen = NLA_ALIGN(rtnh->rtnh_len); | ||
|
||
*remaining -= totlen; | ||
return (struct rtnexthop *) ((char *) rtnh + totlen); | ||
} | ||
|
||
static inline struct nlattr *rtnh_attrs(const struct rtnexthop *rtnh) | ||
{ | ||
return (struct nlattr *) ((char *) rtnh + NLA_ALIGN(sizeof(*rtnh))); | ||
} | ||
|
||
static inline int rtnh_attrlen(const struct rtnexthop *rtnh) | ||
{ | ||
return rtnh->rtnh_len - NLA_ALIGN(sizeof(*rtnh)); | ||
} | ||
|
||
#endif |
Oops, something went wrong.