From 19ec5f8393de1e7481bde8eb7a2b05f04f419458 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 11 Jan 2016 08:31:46 -0800 Subject: [PATCH] Revert "tipc: add peer remove functionality" This reverts commit d4585a4bb120e2f60b088a7e934bf2ae4e6b5b68. This commit is meant for later kernel. --- include/linux/tipc_netlink.h | 1 - man/man8/tipc-bearer.8 | 1 - man/man8/tipc-link.8 | 1 - man/man8/tipc-media.8 | 1 - man/man8/tipc-nametable.8 | 1 - man/man8/tipc-node.8 | 1 - man/man8/tipc-peer.8 | 52 -------------------- man/man8/tipc.8 | 1 - tipc/Makefile | 2 +- tipc/peer.c | 93 ------------------------------------ tipc/peer.h | 21 -------- tipc/tipc.c | 3 -- 12 files changed, 1 insertion(+), 177 deletions(-) delete mode 100644 man/man8/tipc-peer.8 delete mode 100644 tipc/peer.c delete mode 100644 tipc/peer.h diff --git a/include/linux/tipc_netlink.h b/include/linux/tipc_netlink.h index 25eb645e..d4c8f142 100644 --- a/include/linux/tipc_netlink.h +++ b/include/linux/tipc_netlink.h @@ -56,7 +56,6 @@ enum { TIPC_NL_NET_GET, TIPC_NL_NET_SET, TIPC_NL_NAME_TABLE_GET, - TIPC_NL_PEER_REMOVE, __TIPC_NL_CMD_MAX, TIPC_NL_CMD_MAX = __TIPC_NL_CMD_MAX - 1 diff --git a/man/man8/tipc-bearer.8 b/man/man8/tipc-bearer.8 index 565ee01d..50a1ed24 100644 --- a/man/man8/tipc-bearer.8 +++ b/man/man8/tipc-bearer.8 @@ -218,7 +218,6 @@ Exit status is 0 if command was successful or a positive integer upon failure. .BR tipc-media (8), .BR tipc-nametable (8), .BR tipc-node (8), -.BR tipc-peer (8), .BR tipc-socket (8) .br .SH REPORTING BUGS diff --git a/man/man8/tipc-link.8 b/man/man8/tipc-link.8 index 2ee03a0b..3be8c9ad 100644 --- a/man/man8/tipc-link.8 +++ b/man/man8/tipc-link.8 @@ -213,7 +213,6 @@ Exit status is 0 if command was successful or a positive integer upon failure. .BR tipc-bearer (8), .BR tipc-nametable (8), .BR tipc-node (8), -.BR tipc-peer (8), .BR tipc-socket (8) .br .SH REPORTING BUGS diff --git a/man/man8/tipc-media.8 b/man/man8/tipc-media.8 index 4689cb3f..6c6e2b15 100644 --- a/man/man8/tipc-media.8 +++ b/man/man8/tipc-media.8 @@ -74,7 +74,6 @@ Exit status is 0 if command was successful or a positive integer upon failure. .BR tipc-link (8), .BR tipc-nametable (8), .BR tipc-node (8), -.BR tipc-peer (8), .BR tipc-socket (8) .br .SH REPORTING BUGS diff --git a/man/man8/tipc-nametable.8 b/man/man8/tipc-nametable.8 index 4bcefe47..d3397f97 100644 --- a/man/man8/tipc-nametable.8 +++ b/man/man8/tipc-nametable.8 @@ -87,7 +87,6 @@ Exit status is 0 if command was successful or a positive integer upon failure. .BR tipc-link (8), .BR tipc-media (8), .BR tipc-node (8), -.BR tipc-peer (8), .BR tipc-socket (8) .br .SH REPORTING BUGS diff --git a/man/man8/tipc-node.8 b/man/man8/tipc-node.8 index a72a4099..ef32ec7c 100644 --- a/man/man8/tipc-node.8 +++ b/man/man8/tipc-node.8 @@ -59,7 +59,6 @@ Exit status is 0 if command was successful or a positive integer upon failure. .BR tipc-link (8), .BR tipc-media (8), .BR tipc-nametable (8), -.BR tipc-peer (8), .BR tipc-socket (8) .br .SH REPORTING BUGS diff --git a/man/man8/tipc-peer.8 b/man/man8/tipc-peer.8 deleted file mode 100644 index 430651f7..00000000 --- a/man/man8/tipc-peer.8 +++ /dev/null @@ -1,52 +0,0 @@ -.TH TIPC-PEER 8 "04 Dec 2015" "iproute2" "Linux" - -.\" For consistency, please keep padding right aligned. -.\" For example '.B "foo " bar' and not '.B foo " bar"' - -.SH NAME -tipc-peer \- modify peer information - -.SH SYNOPSIS -.ad l -.in +8 - -.ti -8 -.B tipc peer remove address -.IR ADDRESS - -.SH OPTIONS -Options (flags) that can be passed anywhere in the command chain. -.TP -.BR "\-h" , " --help" -Show help about last valid command. For example -.B tipc peer --help -will show peer help and -.B tipc --help -will show general help. The position of the option in the string is irrelevant. -.SH DESCRIPTION - -.SS Peer remove -Remove an offline peer node from the local data structures. The peer is -identified by its -.B address - -.SH EXIT STATUS -Exit status is 0 if command was successful or a positive integer upon failure. - -.SH SEE ALSO -.BR tipc (8), -.BR tipc-bearer (8), -.BR tipc-link (8), -.BR tipc-media (8), -.BR tipc-nametable (8), -.BR tipc-node (8), -.BR tipc-socket (8) -.br -.SH REPORTING BUGS -Report any bugs to the Network Developers mailing list -.B -where the development and maintenance is primarily done. -You do not have to be subscribed to the list to send a message there. - -.SH AUTHOR -Richard Alpe diff --git a/man/man8/tipc.8 b/man/man8/tipc.8 index 32943fa5..c1165523 100644 --- a/man/man8/tipc.8 +++ b/man/man8/tipc.8 @@ -87,7 +87,6 @@ Exit status is 0 if command was successful or a positive integer upon failure. .BR tipc-media (8), .BR tipc-nametable (8), .BR tipc-node (8), -.BR tipc-peer (8), .BR tipc-socket (8) .br .SH REPORTING BUGS 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 - */ - -#include -#include -#include -#include - -#include -#include -#include -#include - -#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 - */ - -#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 } }; -- 2.39.2