summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl/ipoe/ipoe_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd/ctrl/ipoe/ipoe_netlink.c')
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe_netlink.c139
1 files changed, 0 insertions, 139 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe_netlink.c b/accel-pppd/ctrl/ipoe/ipoe_netlink.c
index c061036..18542cd 100644
--- a/accel-pppd/ctrl/ipoe/ipoe_netlink.c
+++ b/accel-pppd/ctrl/ipoe/ipoe_netlink.c
@@ -448,106 +448,6 @@ void ipoe_nl_delete(int ifindex)
rtnl_close(&rth);
}
-int ipoe_nl_add_vlan_mon(int ifindex, long *mask, int len)
-{
- struct nlmsghdr *nlh;
- struct genlmsghdr *ghdr;
- struct {
- struct nlmsghdr n;
- char buf[1024];
- } req;
-
- if (rth.fd == -1)
- return -1;
-
- nlh = &req.n;
- nlh->nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
- nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
- nlh->nlmsg_type = ipoe_genl_id;
-
- ghdr = NLMSG_DATA(&req.n);
- ghdr->cmd = IPOE_CMD_ADD_VLAN_MON;
-
- addattr32(nlh, 1024, IPOE_ATTR_IFINDEX, ifindex);
- addattr_l(nlh, 1024, IPOE_ATTR_VLAN_MASK, mask, len);
-
- if (rtnl_talk(&rth, nlh, 0, 0, nlh, NULL, NULL, 0) < 0 ) {
- log_error("ipoe: nl_add_vlan_mon: error talking to kernel\n");
- return -1;
- }
-
- return 0;
-}
-
-int ipoe_nl_add_vlan_mon_vid(int ifindex, int vid)
-{
- struct rtnl_handle rth;
- struct nlmsghdr *nlh;
- struct genlmsghdr *ghdr;
- struct {
- struct nlmsghdr n;
- char buf[1024];
- } req;
- int r = 0;
-
- if (rtnl_open_byproto(&rth, 0, NETLINK_GENERIC)) {
- log_error("ipoe: cannot open generic netlink socket\n");
- return -1;
- }
-
- nlh = &req.n;
- nlh->nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
- nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
- nlh->nlmsg_type = ipoe_genl_id;
-
- ghdr = NLMSG_DATA(&req.n);
- ghdr->cmd = IPOE_CMD_ADD_VLAN_MON_VID;
-
- addattr32(nlh, 1024, IPOE_ATTR_IFINDEX, ifindex);
- addattr32(nlh, 1024, IPOE_ATTR_ADDR, vid);
-
- if (rtnl_talk(&rth, nlh, 0, 0, nlh, NULL, NULL, 0) < 0 ) {
- log_error("ipoe: nl_add_vlan_mon_vid: error talking to kernel\n");
- r = -1;
- }
-
- rtnl_close(&rth);
-
- return r;
-}
-
-
-int ipoe_nl_del_vlan_mon(int ifindex)
-{
- struct nlmsghdr *nlh;
- struct genlmsghdr *ghdr;
- struct {
- struct nlmsghdr n;
- char buf[1024];
- } req;
-
- if (rth.fd == -1)
- return -1;
-
- nlh = &req.n;
- nlh->nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
- nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
- nlh->nlmsg_type = ipoe_genl_id;
-
- ghdr = NLMSG_DATA(&req.n);
- ghdr->cmd = IPOE_CMD_DEL_VLAN_MON;
-
- addattr32(nlh, 1024, IPOE_ATTR_IFINDEX, ifindex);
-
- if (rtnl_talk(&rth, nlh, 0, 0, nlh, NULL, NULL, 0) < 0 ) {
- log_error("ipoe: nl_del_vlan_mon: error talking to kernel\n");
- return -1;
- }
-
- return 0;
-}
-
-
static void ipoe_up_handler(const struct sockaddr_nl *addr, struct nlmsghdr *h)
{
struct rtattr *tb[PKT_ATTR_MAX + 1];
@@ -587,43 +487,6 @@ static void ipoe_up_handler(const struct sockaddr_nl *addr, struct nlmsghdr *h)
}
}
-static void ipoe_vlan_mon_handler(const struct sockaddr_nl *addr, struct nlmsghdr *h)
-{
- struct rtattr *tb[PKT_ATTR_MAX + 1];
- struct rtattr *tb2[IPOE_ATTR_MAX + 1];
- struct genlmsghdr *ghdr = NLMSG_DATA(h);
- int len = h->nlmsg_len;
- struct rtattr *attrs;
- int i;
- int ifindex, vid;
-
- len -= NLMSG_LENGTH(GENL_HDRLEN);
-
- if (len < 0) {
- log_warn("ipoe: wrong controller message length %d\n", len);
- return;
- }
-
- attrs = (struct rtattr *)((char *)ghdr + GENL_HDRLEN);
- parse_rtattr(tb, PKT_ATTR_MAX, attrs, len);
-
- for (i = 1; i < PKT_ATTR_MAX; i++) {
- if (!tb[i])
- break;
-
- parse_rtattr_nested(tb2, IPOE_ATTR_MAX, tb[i]);
-
- if (!tb2[IPOE_ATTR_IFINDEX] || !tb2[IPOE_ATTR_ADDR])
- continue;
-
- ifindex = *(uint32_t *)(RTA_DATA(tb2[IPOE_ATTR_IFINDEX]));
- vid = *(uint32_t *)(RTA_DATA(tb2[IPOE_ATTR_ADDR]));
-
- ipoe_vlan_notify(ifindex, vid);
- }
-}
-
-
static int ipoe_mc_read(struct triton_md_handler_t *h)
{
int status;
@@ -685,8 +548,6 @@ static int ipoe_mc_read(struct triton_md_handler_t *h)
if (ghdr->cmd == IPOE_REP_PKT)
ipoe_up_handler(&nladdr, hdr);
- else if (ghdr->cmd == IPOE_VLAN_NOTIFY)
- ipoe_vlan_mon_handler(&nladdr, hdr);
status -= NLMSG_ALIGN(len);
hdr = (struct nlmsghdr*)((char*)hdr + NLMSG_ALIGN(len));