aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@kernel.org>2008-02-05 06:17:22 -0500
committerDavid S. Miller <davem@davemloft.net>2008-02-05 06:17:22 -0500
commit03245ce2f03228d681580c30c435225efadca602 (patch)
tree0126ae58202d2b8152992eb39b99a85b5b5806c0
parent8cf229437fd826c32a44546899412b1eb3e1db6f (diff)
[NET] rtnetlink.c: remove no longer used functions
This patch removes the following no longer used functions: - rtattr_parse() - rtattr_strlcpy() - __rtattr_parse_nested_compat() Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/rtnetlink.h12
-rw-r--r--net/core/rtnetlink.c44
2 files changed, 0 insertions, 56 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index b014f6b7fe29..b9e174079002 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -602,24 +602,12 @@ struct tcamsg
602 602
603#include <linux/mutex.h> 603#include <linux/mutex.h>
604 604
605extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size);
606static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) 605static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str)
607{ 606{
608 int len = strlen(str) + 1; 607 int len = strlen(str) + 1;
609 return len > rta->rta_len || memcmp(RTA_DATA(rta), str, len); 608 return len > rta->rta_len || memcmp(RTA_DATA(rta), str, len);
610} 609}
611 610
612extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len);
613extern int __rtattr_parse_nested_compat(struct rtattr *tb[], int maxattr,
614 struct rtattr *rta, int len);
615
616#define rtattr_parse_nested(tb, max, rta) \
617 rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta)))
618
619#define rtattr_parse_nested_compat(tb, max, rta, data, len) \
620({ data = RTA_PAYLOAD(rta) >= len ? RTA_DATA(rta) : NULL; \
621 __rtattr_parse_nested_compat(tb, max, rta, len); })
622
623extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo); 611extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo);
624extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid); 612extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid);
625extern int rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group, 613extern int rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group,
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index ddbdde82a700..61ac8d06292c 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -82,32 +82,6 @@ int rtnl_trylock(void)
82 return mutex_trylock(&rtnl_mutex); 82 return mutex_trylock(&rtnl_mutex);
83} 83}
84 84
85int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len)
86{
87 memset(tb, 0, sizeof(struct rtattr*)*maxattr);
88
89 while (RTA_OK(rta, len)) {
90 unsigned flavor = rta->rta_type;
91 if (flavor && flavor <= maxattr)
92 tb[flavor-1] = rta;
93 rta = RTA_NEXT(rta, len);
94 }
95 return 0;
96}
97
98int __rtattr_parse_nested_compat(struct rtattr *tb[], int maxattr,
99 struct rtattr *rta, int len)
100{
101 if (RTA_PAYLOAD(rta) < len)
102 return -1;
103 if (RTA_PAYLOAD(rta) >= RTA_ALIGN(len) + sizeof(struct rtattr)) {
104 rta = RTA_DATA(rta) + RTA_ALIGN(len);
105 return rtattr_parse_nested(tb, maxattr, rta);
106 }
107 memset(tb, 0, sizeof(struct rtattr *) * maxattr);
108 return 0;
109}
110
111static struct rtnl_link *rtnl_msg_handlers[NPROTO]; 85static struct rtnl_link *rtnl_msg_handlers[NPROTO];
112 86
113static inline int rtm_msgindex(int msgtype) 87static inline int rtm_msgindex(int msgtype)
@@ -442,21 +416,6 @@ void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data
442 memset(RTA_DATA(rta) + attrlen, 0, RTA_ALIGN(size) - size); 416 memset(RTA_DATA(rta) + attrlen, 0, RTA_ALIGN(size) - size);
443} 417}
444 418
445size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size)
446{
447 size_t ret = RTA_PAYLOAD(rta);
448 char *src = RTA_DATA(rta);
449
450 if (ret > 0 && src[ret - 1] == '\0')
451 ret--;
452 if (size > 0) {
453 size_t len = (ret >= size) ? size - 1 : ret;
454 memset(dest, 0, size);
455 memcpy(dest, src, len);
456 }
457 return ret;
458}
459
460int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigned group, int echo) 419int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigned group, int echo)
461{ 420{
462 struct sock *rtnl = net->rtnl; 421 struct sock *rtnl = net->rtnl;
@@ -1411,9 +1370,6 @@ void __init rtnetlink_init(void)
1411} 1370}
1412 1371
1413EXPORT_SYMBOL(__rta_fill); 1372EXPORT_SYMBOL(__rta_fill);
1414EXPORT_SYMBOL(rtattr_strlcpy);
1415EXPORT_SYMBOL(rtattr_parse);
1416EXPORT_SYMBOL(__rtattr_parse_nested_compat);
1417EXPORT_SYMBOL(rtnetlink_put_metrics); 1373EXPORT_SYMBOL(rtnetlink_put_metrics);
1418EXPORT_SYMBOL(rtnl_lock); 1374EXPORT_SYMBOL(rtnl_lock);
1419EXPORT_SYMBOL(rtnl_trylock); 1375EXPORT_SYMBOL(rtnl_trylock);