From patchwork Mon Mar 5 05:24:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonatan Schlag X-Patchwork-Id: 1686 Return-Path: Received: from mail01.ipfire.org (unknown [172.28.1.200]) by web02.i.ipfire.org (Postfix) with ESMTP id A3B776095C for ; Sun, 4 Mar 2018 19:25:35 +0100 (CET) X-Virus-Scanned: ClamAV at mail01.ipfire.org X-Spam-Flag: NO X-Spam-Score: -0.599 X-Spam-Level: X-Spam-Status: No, score=-0.599 tagged_above=-999 required=5 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, KAM_NUMSUBJECT=0.5, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id E1D20111C4E7; Sun, 4 Mar 2018 18:25:34 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ipfire.org; s=201801; t=1520187934; x=1522779934; bh=po8phWDVZMCLFzer5IYi64rdxfQRdHzqClQgW2huh1o=; h=From:To:Subject:Date:Message-Id:In-Reply-To:Sender:From:To:Cc: Date:Content-Type:Message-ID:In-Reply-To:Subject:Reply-To:Sender; b=L8/naNOzSHao0Sow4m6KiCmBv+JPhZR3iNIxxCJK1bBL2omK8hKc6DYkOQ9+ijams 6mDSXWPNWOb2sdSVREYo7BeebVrz76iM3YK/Wdx38oSHmXH2MMi0wb9/U+c/hUdb6+ aL3s8wi8qPK0eHknIfuTgFWmRMm2E4Ecv8J2fgsgEzq4Y6bBIREpDmg4Ajv3pUNpFE WH6DtcasQR638YVEsh/jHSXAA65fuosj3oOZSEqdGnjF6+G0QdXbxCc8PaRxghU7Gx wCnSW9AoZM8B/uNtuYtiHr6yjJjK4vooeQENYLSVWKaqD/5+3PWiq+Dy8QWuaye1TK dbv8fLIBl41GQ== X-Virus-Scanned: ClamAV at mail01.ipfire.org Received: from localhost.localdomain (unknown [46.183.103.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 0AE74111C4E7; Sun, 4 Mar 2018 18:25:14 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ipfire.org; s=201801; t=1520187933; x=1522779933; bh=po8phWDVZMCLFzer5IYi64rdxfQRdHzqClQgW2huh1o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:From:To:Cc:Date: Content-Type:Message-ID:In-Reply-To:Subject:Reply-To:Sender; b=PD/fMa+5V8gnji3PZ9q+KJyz8jWiRmeZrRnNP2fBk9qmKek8JcC9y7qJbxspTMn3A luxrN+6MU/Kq6zV9QFLgZFENgVwLW4HTYO/KciM3HWbSc5BiBDUESvXciGFRomBwzz j9Nlk0mhj3JZFF+Br+B4LD2OdkDp4icc3jkUQkXzJdaYls0JoheLnlMRuPDsCZiFU2 MD4ik875MJ/8molH9I/oODEFxu4Acw7J+CKZmNrsMs1PvboLAIFQEfDAM4C424uPsj 5SdMVBx4l18rjLUtf/9TE5R6zKMKNIvckyPFQKoMA/TAX7nl+a1GdMZj7wCW48FosU 22sbQj6kidgNQ== From: Jonatan Schlag To: network@lists.ipfire.org Subject: [PATCH 2/5] device: add new function device_is_vti6 Date: Sun, 4 Mar 2018 18:24:56 +0000 Message-Id: <1520187899-5759-2-git-send-email-jonatan.schlag@ipfire.org> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1520187899-5759-1-git-send-email-jonatan.schlag@ipfire.org> References: <1520187899-5759-1-git-send-email-jonatan.schlag@ipfire.org> X-BeenThere: network@lists.ipfire.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List for the network package List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: network-bounces@lists.ipfire.org Sender: "network" This functions checks if a device is a vti6 device. Signed-off-by: Jonatan Schlag --- src/functions/functions.device | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/functions/functions.device b/src/functions/functions.device index 2de1ad9..a04111e 100644 --- a/src/functions/functions.device +++ b/src/functions/functions.device @@ -286,6 +286,14 @@ device_is_vti() { [ "${type}" = "768" ] && return ${EXIT_OK} || return ${EXIT_ERROR} } +device_is_vti6() { + local device=${1} + + local type=$(__device_get_file ${device} type) + + [ "${type}" = "769" ] && return ${EXIT_OK} || return ${EXIT_ERROR} +} + device_get_phy() { local device="${1}"