summaryrefslogtreecommitdiff
path: root/ipoe-util
diff options
context:
space:
mode:
Diffstat (limited to 'ipoe-util')
-rw-r--r--ipoe-util/CMakeLists.txt22
l---------ipoe-util/ipoe.h1
-rw-r--r--ipoe-util/ipses-add-net.c64
-rw-r--r--ipoe-util/ipses-create.c71
-rw-r--r--ipoe-util/ipses-delete.c58
5 files changed, 0 insertions, 216 deletions
diff --git a/ipoe-util/CMakeLists.txt b/ipoe-util/CMakeLists.txt
deleted file mode 100644
index 51a59d3..0000000
--- a/ipoe-util/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
-INCLUDE_DIRECTORIES(${CMAKE_HOME_DIRECTORY}/ipses)
-
-if (LIBNL2)
- ADD_DEFINITIONS("-DLIBNL2")
-endif (LIBNL2)
-
-ADD_EXECUTABLE(ipses-create ipses-create.c)
-ADD_EXECUTABLE(ipses-delete ipses-delete.c)
-ADD_EXECUTABLE(ipses-add-net ipses-add-net.c)
-
-if (LIBNL2)
- TARGET_LINK_LIBRARIES(ipses-create nl nl-genl m)
- TARGET_LINK_LIBRARIES(ipses-delete nl nl-genl m)
- TARGET_LINK_LIBRARIES(ipses-add-net nl nl-genl m)
-else (LIBNL2)
- TARGET_LINK_LIBRARIES(ipses-create nl)
- TARGET_LINK_LIBRARIES(ipses-delete nl)
- TARGET_LINK_LIBRARIES(ipses-add-net nl)
-endif (LIBNL2)
-
-
diff --git a/ipoe-util/ipoe.h b/ipoe-util/ipoe.h
deleted file mode 120000
index 7117b41..0000000
--- a/ipoe-util/ipoe.h
+++ /dev/null
@@ -1 +0,0 @@
-../drivers/ipoe/ipoe.h \ No newline at end of file
diff --git a/ipoe-util/ipses-add-net.c b/ipoe-util/ipses-add-net.c
deleted file mode 100644
index 3e9df23..0000000
--- a/ipoe-util/ipses-add-net.c
+++ /dev/null
@@ -1,64 +0,0 @@
-#include <net/ethernet.h>
-#include <netinet/in.h>
-#include <netinet/ether.h>
-#include <arpa/inet.h>
-#include <string.h>
-#include <errno.h>
-#include <stdio.h>
-
-#include <netlink/netlink.h>
-#include <netlink/genl/genl.h>
-#include <netlink/genl/ctrl.h>
-
-
-#include "ipoe.h"
-
-int main(int argc, char **argv)
-{
-#if LIBNL2
- struct nl_sock *h;
-#else
- struct nl_handle *h;
-#endif
- struct nl_msg *msg;
- int family;
- in_addr_t local, remote;
- int err;
- uint32_t addr;
- int m;
-
- if (argc != 3) {
- printf("usage: ipses-add-net <addr> <mask>\n");
- return 1;
- }
-
- addr = inet_addr(argv[1]);
- m = atoi(argv[2]);
-
-#if LIBNL2
- h = nl_socket_alloc();
-#else
- h = nl_handle_alloc();
-#endif
- genl_connect(h);
- family = genl_ctrl_resolve(h, IPOE_GENL_NAME);
-
- msg = nlmsg_alloc();
- genlmsg_put(msg, NL_AUTO_PID, NL_AUTO_SEQ, family, 0, NLM_F_REQUEST, IPOE_CMD_ADD_NET, IPOE_GENL_VERSION);
- nla_put_u32(msg, IPOE_ATTR_ADDR, addr);
- nla_put_u64(msg, IPOE_ATTR_MASK, (1 << m) - 1);
-
- nl_send_auto_complete(h, msg);
- err = nl_recvmsgs_default(h);
-#if LIBNL2
- printf("recv: %s\n", nl_geterror(err));
-#else
- nl_perror("recv");
-#endif
-
- nlmsg_free(msg);
- nl_close(h);
-
- return 0;
-}
-
diff --git a/ipoe-util/ipses-create.c b/ipoe-util/ipses-create.c
deleted file mode 100644
index 4c02cc6..0000000
--- a/ipoe-util/ipses-create.c
+++ /dev/null
@@ -1,71 +0,0 @@
-#include <net/ethernet.h>
-#include <netinet/in.h>
-#include <netinet/ether.h>
-#include <arpa/inet.h>
-#include <string.h>
-#include <errno.h>
-#include <stdio.h>
-
-#include <netlink/netlink.h>
-#include <netlink/genl/genl.h>
-#include <netlink/genl/ctrl.h>
-
-
-#include "ipoe.h"
-
-int main(int argc, char **argv)
-{
-#if LIBNL2
- struct nl_sock *h;
-#else
- struct nl_handle *h;
-#endif
- struct nl_msg *msg;
- int family;
- in_addr_t local, remote;
- int err;
- union {
- struct ether_addr a;
- uint64_t u64;
- } hwaddr;
-
- if (argc != 4 && argc != 5) {
- printf("usage: ipses-create <ifname> <hwaddr> <peer_addr> <addr>\n");
- return 1;
- }
-
- ether_aton_r(argv[2], &hwaddr.a);
- local = inet_addr(argv[3]);
- if (argc == 5)
- remote = inet_addr(argv[4]);
-
-#if LIBNL2
- h = nl_socket_alloc();
-#else
- h = nl_handle_alloc();
-#endif
- genl_connect(h);
- family = genl_ctrl_resolve(h, IPOE_GENL_NAME);
-
- msg = nlmsg_alloc();
- genlmsg_put(msg, NL_AUTO_PID, NL_AUTO_SEQ, family, 0, NLM_F_REQUEST, IPOE_CMD_CREATE, IPOE_GENL_VERSION);
- nla_put_u32(msg, IPOE_ATTR_PEER_ADDR, local);
- nla_put_string(msg, IPOE_ATTR_IFNAME, argv[1]);
- nla_put_u64(msg, IPOE_ATTR_HWADDR, hwaddr.u64);
- if (argc == 5)
- nla_put_u32(msg, IPOE_ATTR_ADDR, remote);
-
- nl_send_auto_complete(h, msg);
- err = nl_recvmsgs_default(h);
-#if LIBNL2
- printf("recv: %s\n", nl_geterror(err));
-#else
- nl_perror("recv");
-#endif
-
- nlmsg_free(msg);
- nl_close(h);
-
- return 0;
-}
-
diff --git a/ipoe-util/ipses-delete.c b/ipoe-util/ipses-delete.c
deleted file mode 100644
index 4e6a184..0000000
--- a/ipoe-util/ipses-delete.c
+++ /dev/null
@@ -1,58 +0,0 @@
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <string.h>
-#include <errno.h>
-#include <stdio.h>
-
-#include <netlink/netlink.h>
-#include <netlink/genl/genl.h>
-#include <netlink/genl/ctrl.h>
-
-
-#include "ipoe.h"
-
-int main(int argc, char **argv)
-{
-#if LIBNL2
- struct nl_sock *h;
-#else
- struct nl_handle *h;
-#endif
- struct nl_msg *msg;
- int family;
- in_addr_t local;
- int err;
-
- if (argc != 2) {
- printf("usage: ipses-delete <addr>\n");
- return 1;
- }
-
- local = inet_addr(argv[1]);
-
-#if LIBNL2
- h = nl_socket_alloc();
-#else
- h = nl_handle_alloc();
-#endif
- genl_connect(h);
- family = genl_ctrl_resolve(h, IPOE_GENL_NAME);
-
- msg = nlmsg_alloc();
- genlmsg_put(msg, NL_AUTO_PID, NL_AUTO_SEQ, family, 0, NLM_F_REQUEST, IPOE_CMD_DELETE, IPOE_GENL_VERSION);
- nla_put_u32(msg, IPOE_ATTR_PEER_ADDR, local);
-
- nl_send_auto_complete(h, msg);
- err = nl_recvmsgs_default(h);
-#if LIBNL2
- printf("recv: %s\n", nl_geterror(err));
-#else
- nl_perror("recv");
-#endif
-
- nlmsg_free(msg);
- nl_close(h);
-
- return 0;
-}
-