summaryrefslogtreecommitdiffstats
path: root/tipc
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2016-02-09 10:51:32 -0800
committerStephen Hemminger <stephen@networkplumber.org>2016-02-09 10:51:32 -0800
commit385caeb13b4be08a2a142f28a836e0d535a3d8b9 (patch)
treec5103049bf3344873e1e0506a01759a99ec93edd /tipc
parentecc509f9a36be953bc41d926be061b5c34a74e94 (diff)
Revert "tipc: add peer remove functionality"
This reverts commit f9dec657e4578d50a2432e5842d97c857faa6c2c. Since this code is not in upstream kernel, it shouldn't be in iproute2
Diffstat (limited to 'tipc')
-rw-r--r--tipc/Makefile2
-rw-r--r--tipc/peer.c93
-rw-r--r--tipc/peer.h21
-rw-r--r--tipc/tipc.c3
4 files changed, 1 insertions, 118 deletions
diff --git a/tipc/Makefile b/tipc/Makefile
index f06dcb11..bc5ecfd3 100644
--- a/tipc/Makefile
+++ b/tipc/Makefile
@@ -6,7 +6,7 @@ TIPCOBJ=bearer.o \
media.o misc.o \
msg.o nametable.o \
node.o socket.o \
- peer.o tipc.o
+ tipc.o
include ../Config
diff --git a/tipc/peer.c b/tipc/peer.c
deleted file mode 100644
index de0c73c3..00000000
--- a/tipc/peer.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * peer.c TIPC peer functionality.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * Authors: Richard Alpe <richard.alpe@ericsson.com>
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include <linux/tipc_netlink.h>
-#include <linux/tipc.h>
-#include <linux/genetlink.h>
-#include <libmnl/libmnl.h>
-
-#include "cmdl.h"
-#include "msg.h"
-#include "misc.h"
-#include "peer.h"
-
-static int cmd_peer_rm_addr(struct nlmsghdr *nlh, const struct cmd *cmd,
- struct cmdl *cmdl, void *data)
-{
- char *str;
- uint32_t addr;
- struct nlattr *nest;
- char buf[MNL_SOCKET_BUFFER_SIZE];
-
- if ((cmdl->argc != cmdl->optind + 1) || help_flag) {
- fprintf(stderr, "Usage: %s peer remove address ADDRESS\n",
- cmdl->argv[0]);
- return -EINVAL;
- }
-
- str = shift_cmdl(cmdl);
- addr = str2addr(str);
- if (!addr)
- return -1;
-
- if (!(nlh = msg_init(buf, TIPC_NL_PEER_REMOVE))) {
- fprintf(stderr, "error, message initialisation failed\n");
- return -1;
- }
-
- nest = mnl_attr_nest_start(nlh, TIPC_NLA_NET);
- mnl_attr_put_u32(nlh, TIPC_NLA_NET_ADDR, addr);
- mnl_attr_nest_end(nlh, nest);
-
- return msg_doit(nlh, NULL, NULL);
-}
-
-static void cmd_peer_rm_help(struct cmdl *cmdl)
-{
- fprintf(stderr, "Usage: %s peer remove address ADDRESS\n",
- cmdl->argv[0]);
-}
-
-static int cmd_peer_rm(struct nlmsghdr *nlh, const struct cmd *cmd,
- struct cmdl *cmdl, void *data)
-{
- const struct cmd cmds[] = {
- { "address", cmd_peer_rm_addr, cmd_peer_rm_help },
- { NULL }
- };
-
- return run_cmd(nlh, cmd, cmds, cmdl, NULL);
-}
-
-void cmd_peer_help(struct cmdl *cmdl)
-{
- fprintf(stderr,
- "Usage: %s peer COMMAND [ARGS] ...\n\n"
- "COMMANDS\n"
- " remove - Remove an offline peer node\n",
- cmdl->argv[0]);
-}
-
-int cmd_peer(struct nlmsghdr *nlh, const struct cmd *cmd, struct cmdl *cmdl,
- void *data)
-{
- const struct cmd cmds[] = {
- { "remove", cmd_peer_rm, cmd_peer_rm_help },
- { NULL }
- };
-
- return run_cmd(nlh, cmd, cmds, cmdl, NULL);
-}
diff --git a/tipc/peer.h b/tipc/peer.h
deleted file mode 100644
index 89722616..00000000
--- a/tipc/peer.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * peer.h TIPC peer functionality.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * Authors: Richard Alpe <richard.alpe@ericsson.com>
- */
-
-#ifndef _TIPC_PEER_H
-#define _TIPC_PEER_H
-
-extern int help_flag;
-
-int cmd_peer(struct nlmsghdr *nlh, const struct cmd *cmd, struct cmdl *cmdl,
- void *data);
-void cmd_peer_help(struct cmdl *cmdl);
-
-#endif
diff --git a/tipc/tipc.c b/tipc/tipc.c
index 600d5e2a..44398052 100644
--- a/tipc/tipc.c
+++ b/tipc/tipc.c
@@ -20,7 +20,6 @@
#include "socket.h"
#include "media.h"
#include "node.h"
-#include "peer.h"
#include "cmdl.h"
int help_flag;
@@ -40,7 +39,6 @@ static void about(struct cmdl *cmdl)
" media - Show or modify media\n"
" nametable - Show nametable\n"
" node - Show or modify node related parameters\n"
- " peer - Peer related operations\n"
" socket - Show sockets\n",
cmdl->argv[0]);
}
@@ -61,7 +59,6 @@ int main(int argc, char *argv[])
{ "media", cmd_media, cmd_media_help},
{ "nametable", cmd_nametable, cmd_nametable_help},
{ "node", cmd_node, cmd_node_help},
- { "peer", cmd_peer, cmd_peer_help},
{ "socket", cmd_socket, cmd_socket_help},
{ NULL }
};