From patchwork Thu Jan 18 14:04:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serhey Popovych X-Patchwork-Id: 862918 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TmyhvNN5"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zMm2c2ttwz9sDB for ; Fri, 19 Jan 2018 01:06:00 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932411AbeAROFt (ORCPT ); Thu, 18 Jan 2018 09:05:49 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:33284 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932326AbeAROFr (ORCPT ); Thu, 18 Jan 2018 09:05:47 -0500 Received: by mail-lf0-f66.google.com with SMTP id t139so12029679lff.0 for ; Thu, 18 Jan 2018 06:05:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=Atf2T5ofRL6bJM6b/8mKvXEmADxgKuBrkSdG4xc8pJU=; b=TmyhvNN5qD2fLZ89v48gwZ54NTrhTYM0rAZB3Thl0SCsJfg+0EBbv8TYXIoyboYekL D1n3j2zsPXXjBRu8GmkuX9ruMUqfjTcgLpkFsqtXPC01f8D6k6f7VBmMvLgpNjKPeQ7e 1UThjqwrqh35P02b6278M794m2lyfx6bHUbu3s8tBwjSN6NVngYN+uCZcobnYHpfmgUk JhjLDqCbXiFxAu5Bm3CB8ibfr4fpEckZzcSlS9qfEaoRdY6MiWCq8uLe+xau8CphP8hE C8eB2lGXbgwhbteD6APqJccycpt180MLL5mgKTg+c2GtUhmzKYi9sl8vhm/Pbjblcy80 Nt8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=Atf2T5ofRL6bJM6b/8mKvXEmADxgKuBrkSdG4xc8pJU=; b=rvbQ3FXyE+KpbnrpavEQbeb/XMc1i5551a4CIFgJcK1ODMI1SqbUzfFVqsJ4rMDT2i X0er7uGCpNpU2h8dPFeYJewnITE2OSNQVkGDK7BfMsuMxfDRxYHI67YJjcQLvOtCHGD7 8n4w0uudCSG1nl7jQ6jbfXNzIRqPyfO5BU/Fl1Hniy8M5uxaSI/bfheDzgQxgFAw8zUq zz2OobKrFzI522gbdP074JhAM8eKU0J1DhRYJ+viuLYEEhchQlY05MP4SkVGWc5maD9X fRxl4akrWe+n+9Rilvfs3ZDiOa8FJz49Dxp4KKm42r8c4Xkdw6kUdZiDiHXxMy/Fkh9l zKwA== X-Gm-Message-State: AKwxyteZBQ1Ap5Z5D61Uq0l3dbSlET7zWxh5MctYU3FQsGe55UDVQQQa CiODLAKqgPY9c3illT681Mg/9A== X-Google-Smtp-Source: ACJfBoupyn3ovn0poIjFouWOANZFwQE2Hlv0TZZ2EjeSbTrJWLhR6zu1j8YLAkFPZEdzwd0c1jiAYA== X-Received: by 10.46.17.135 with SMTP id 7mr11782448ljr.87.1516284345709; Thu, 18 Jan 2018 06:05:45 -0800 (PST) Received: from tuxracer.localdomain ([2a01:6d80::195:20:96:53]) by smtp.gmail.com with ESMTPSA id r21sm1344748lja.8.2018.01.18.06.05.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 06:05:44 -0800 (PST) From: Serhey Popovych To: netdev@vger.kernel.org Subject: [PATCH iproute2 v2 8/9] vti6/tunnel: Unify and simplify link type help functions Date: Thu, 18 Jan 2018 16:04:35 +0200 Message-Id: <1516284276-10942-9-git-send-email-serhe.popovych@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1516284276-10942-1-git-send-email-serhe.popovych@gmail.com> References: <1516284276-10942-1-git-send-email-serhe.popovych@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Both of these two changes are missing for link_vti6.c: commit 8b47135474cd ("ip: link: Unify link type help functions a bit") commit 561e650eff67 ("ip link: Shortify printing the usage of link type") Replay them on link_vti6.c to bring link type help functions inline with other tunneling code. Signed-off-by: Serhey Popovych --- ip/link_vti6.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/ip/link_vti6.c b/ip/link_vti6.c index 6b61e3d..2a86d59 100644 --- a/ip/link_vti6.c +++ b/ip/link_vti6.c @@ -24,20 +24,25 @@ #include "ip_common.h" #include "tunnel.h" +static void print_usage(FILE *f) +{ + fprintf(f, + "Usage: ... vti6 [ remote ADDR ]\n" + " [ local ADDR ]\n" + " [ [i|o]key KEY ]\n" + " [ dev PHYS_DEV ]\n" + " [ fwmark MARK ]\n" + "\n" + "Where: ADDR := { IPV6_ADDRESS }\n" + " KEY := { DOTTED_QUAD | NUMBER }\n" + " MARK := { 0x0..0xffffffff }\n" + ); +} static void usage(void) __attribute__((noreturn)); static void usage(void) { - fprintf(stderr, "Usage: ip link { add | set | change | replace | del } NAME\n"); - fprintf(stderr, " type { vti6 } [ remote ADDR ] [ local ADDR ]\n"); - fprintf(stderr, " [ [i|o]key KEY ]\n"); - fprintf(stderr, " [ dev PHYS_DEV ]\n"); - fprintf(stderr, " [ fwmark MARK ]\n"); - fprintf(stderr, "\n"); - fprintf(stderr, "Where: NAME := STRING\n"); - fprintf(stderr, " ADDR := { IPV6_ADDRESS }\n"); - fprintf(stderr, " KEY := { DOTTED_QUAD | NUMBER }\n"); - fprintf(stderr, " MARK := { 0x0..0xffffffff }\n"); + print_usage(stderr); exit(-1); } @@ -224,9 +229,16 @@ static void vti6_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]) } } +static void vti6_print_help(struct link_util *lu, int argc, char **argv, + FILE *f) +{ + print_usage(f); +} + struct link_util vti6_link_util = { .id = "vti6", .maxattr = IFLA_VTI_MAX, .parse_opt = vti6_parse_opt, .print_opt = vti6_print_opt, + .print_help = vti6_print_help, };