aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
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 /net/core
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>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/rtnetlink.c44
1 files changed, 0 insertions, 44 deletions
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);