From patchwork Sat Sep 22 21:24:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 973619 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@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; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="D/qe5Kub"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42Hk5R3wpPz9sBn for ; Sun, 23 Sep 2018 07:25:15 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728183AbeIWDUD (ORCPT ); Sat, 22 Sep 2018 23:20:03 -0400 Received: from mail-wm1-f41.google.com ([209.85.128.41]:36632 "EHLO mail-wm1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728020AbeIWDUD (ORCPT ); Sat, 22 Sep 2018 23:20:03 -0400 Received: by mail-wm1-f41.google.com with SMTP id y13-v6so1760032wmi.1 for ; Sat, 22 Sep 2018 14:25:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TpiNyssZn79l/kuNyDn1UXn/RnZL/pLPDM4OCT78TIE=; b=D/qe5KubtgIN3QaKzm77wqA2NHF12ootrzgLrXAPwgnQHxNAXPqu4w/6LZqCWKaaAc JlVn9WdaS6IqSZ4CGTkEAr2ZsS9oCdhaFkifUT0n3mMb75/wISs6cuxYqs36vd6eCuIT tAEFXr+smQlQaE+MMxCM5teKAyT0D5qi4RfRMsYkxiI4NWsiFDZBLusj0WTsNs9c0l0T +botRBjnPBhWMbNs2GQgIYYrMswbBBnY/Gacb4Ojq4jMbQrnyuQECzSUbImFucII5EZy 9FBb5BspYDisMrDpKekPRP7GyvdKQJ3JIFDOfM4BWrFHJrEFfOvoebsLo66HlpnARwvs Citw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TpiNyssZn79l/kuNyDn1UXn/RnZL/pLPDM4OCT78TIE=; b=VIMqU/pjVrRvNsPaZ2bp6odVAboZnh90mQcxI5QZHPif0oUgEkFd6OWatAiRtfqgFF LMcs8ijejuv4KU8YV+V0NXSI2ebpCWoIslnbKimLKWLQYvOgNgqvfzDy8sbgROji1gTi yc5XNdMuTaSmiAq0dN8A1gnYnXe2+ijvR+AkoirC2dsw3ppZzUz9b33wTJpR0NQGFOCb 5KG5vU19u5TkAgixQP80QEOQaou8nTiJm5JXR1q2LDfQlHnxoaPdqKSVcDIX6SWhA49M flKw9GWlx0CXrGjlNnjQzubSDR3NiVC3J64/OMSNpn897BVuIen1CMTE64h16ejyPAtl QmZA== X-Gm-Message-State: APzg51CmQC5u30aEF+axPJWxJGYIvPnmyLKdMWLXabtlomZvc1/3O4G5 jK+cJywYi1P9fL42NvPDmnN2i5uW X-Google-Smtp-Source: ACcGV60LrNz1f4LWz9xaRkdy2Sl2x8gY/V9wDHTP9VdPK7cao0TPZw5Qvc6wgVicXuGTjSeurq9aRw== X-Received: by 2002:a1c:c7c1:: with SMTP id x184-v6mr2626464wmf.134.1537651501657; Sat, 22 Sep 2018 14:25:01 -0700 (PDT) Received: from localhost.localdomain ([85.119.94.113]) by smtp.gmail.com with ESMTPSA id 75-v6sm16110032wml.21.2018.09.22.14.25.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Sep 2018 14:25:00 -0700 (PDT) From: Petr Vorel To: netdev@vger.kernel.org Cc: Petr Vorel , Stephen Hemminger Subject: [PATCH iproute2 1/7] man: rtpr: Rename s/bash/shell/ Date: Sat, 22 Sep 2018 23:24:45 +0200 Message-Id: <20180922212451.327-2-petr.vorel@gmail.com> X-Mailer: git-send-email 2.19.0.rc2 In-Reply-To: <20180922212451.327-1-petr.vorel@gmail.com> References: <20180922212451.327-1-petr.vorel@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org ip/rtpr mentioned in man as bash script is actually posix shell script (doesn't require to use bash). Signed-off-by: Petr Vorel --- man/man8/rtpr.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/man8/rtpr.8 b/man/man8/rtpr.8 index 1b04a821..87f291ab 100644 --- a/man/man8/rtpr.8 +++ b/man/man8/rtpr.8 @@ -5,7 +5,7 @@ rtpr \- replace backslashes with newlines. .SH DESCRIPTION .B rtpr -is a trivial bash script which converts backslashes in standard input to newlines. It's sole purpose is to be fed with input from +is a trivial shell script which converts backslashes in standard input to newlines. It's sole purpose is to be fed with input from .B ip when executed with it's .B --oneline From patchwork Sat Sep 22 21:24:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 973620 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@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; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qu77eXOe"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42Hk5S23pnz9sBq for ; Sun, 23 Sep 2018 07:25:16 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728244AbeIWDUF (ORCPT ); Sat, 22 Sep 2018 23:20:05 -0400 Received: from mail-wr1-f46.google.com ([209.85.221.46]:39054 "EHLO mail-wr1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728020AbeIWDUF (ORCPT ); Sat, 22 Sep 2018 23:20:05 -0400 Received: by mail-wr1-f46.google.com with SMTP id s14-v6so16019243wrw.6 for ; Sat, 22 Sep 2018 14:25:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cuBqYLfzDEqT14ozMFqZrWx2MT3ZQGgpwJ5rtfdOuEE=; b=qu77eXOetlFhVl2zlWGi8c6Cf6awqHF754DGZJeLfUtssTuSJxd/qwylqhlS3vSYEi +WbQ2OIoAMufkp7bStHVMufqMHmcIjVkm2Im8HVd7toaqspFmLmQMMyYfBzB9LRg/Pd/ hG9b8Xv7Bvpf++HszFDwG2czDxz/jdocTpjcfErxzgkBsjddKd9R+NHrgLUtc+tYz0lz 3wTILjRs1X1EsgJoRbnDCqeqqeB1xbI7DRC4uTgaJ/bCMzgsdaXc90EhiWa6m2dY3FoL Qr6zRtHe5BB/GcR8LRdFECy1SURqQLt9guBqvW2czozahrErWTgjC6XDab64cOK0He7N TOjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cuBqYLfzDEqT14ozMFqZrWx2MT3ZQGgpwJ5rtfdOuEE=; b=ZYW3VfGVFBSrweVzWSp3pRI5Qxk5eKIkNRNCwO0YU9A5h/rlB0v2Cmkl4UGigBAGn8 1VCbXLSuts2STjs0fDQbnqV4+3h83whPfgSq8zyprjBZg11TAFpIY4o5GlK5nnuFL4Zr Yzg+Llj+n8+6EEb7eUw4Kx6V3DSFyAlK34QAP4pTji77eSS5emBPTDNt2yNydq7u5oiR jiMbDm3OHTNq4TRLDXTxNpEfrEcIo6Rkiq9O1jS0nWKyg6+Vt3qI6kiV/sCy5VD9S3Ad K4g6QSdTQyD83ZUUOusOjXnJZomOJ/gLXM0HxGDaOVzQWc1vEbemgBwV2+BPibTE2Qir TbVA== X-Gm-Message-State: ABuFfojJwrMpNDfbqGtrQTaAzsfWUR9ZT3c0xzrf1aNWXwlkQhewc00b Uw8OGGwxayoGPTaFhT1IpE/pyHb1 X-Google-Smtp-Source: ACcGV60hP5re7vIesKaYmus3SRmHQy0QE17gkne+GinTr2aHDyPcKwnDxIQg0ELDoVe5o+h+vca11A== X-Received: by 2002:adf:8385:: with SMTP id 5-v6mr2947618wre.13.1537651503586; Sat, 22 Sep 2018 14:25:03 -0700 (PDT) Received: from localhost.localdomain ([85.119.94.113]) by smtp.gmail.com with ESMTPSA id 75-v6sm16110032wml.21.2018.09.22.14.25.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Sep 2018 14:25:02 -0700 (PDT) From: Petr Vorel To: netdev@vger.kernel.org Cc: Petr Vorel , Stephen Hemminger Subject: [PATCH iproute2 2/7] tests: Use /bin/sh shebang Date: Sat, 22 Sep 2018 23:24:46 +0200 Message-Id: <20180922212451.327-3-petr.vorel@gmail.com> X-Mailer: git-send-email 2.19.0.rc2 In-Reply-To: <20180922212451.327-1-petr.vorel@gmail.com> References: <20180922212451.327-1-petr.vorel@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Bashisms for both tests were removed in ecd44e68 ("tests: Remove bashisms (s/source/.)"), so no need to use bash shebang. + remove trailing whitespace. Signed-off-by: Petr Vorel --- testsuite/tests/tc/cls-testbed.t | 4 ++-- testsuite/tests/tc/dsmark.t | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testsuite/tests/tc/cls-testbed.t b/testsuite/tests/tc/cls-testbed.t index d5c21e5c..cf34dd63 100755 --- a/testsuite/tests/tc/cls-testbed.t +++ b/testsuite/tests/tc/cls-testbed.t @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # vim: ft=sh . lib/generic.sh @@ -61,7 +61,7 @@ for q in ${QDISCS}; do ts_tc "cls-testbed" "tree listing" qdisc list dev eth0 ts_tc "cls-testbed" "tree class listing" class list dev eth0 ts_log "cls-testbed: starting classifier test $c" - $c + $c case "$q" in *) diff --git a/testsuite/tests/tc/dsmark.t b/testsuite/tests/tc/dsmark.t index 177585e6..3f1d5ef2 100755 --- a/testsuite/tests/tc/dsmark.t +++ b/testsuite/tests/tc/dsmark.t @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # vim: ft=sh . lib/generic.sh From patchwork Sat Sep 22 21:24:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 973621 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@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; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mqck7VLi"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42Hk5S71XSz9sBn for ; Sun, 23 Sep 2018 07:25:16 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728265AbeIWDUG (ORCPT ); Sat, 22 Sep 2018 23:20:06 -0400 Received: from mail-wr1-f46.google.com ([209.85.221.46]:35857 "EHLO mail-wr1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728189AbeIWDUG (ORCPT ); Sat, 22 Sep 2018 23:20:06 -0400 Received: by mail-wr1-f46.google.com with SMTP id e1-v6so16050425wrt.3 for ; Sat, 22 Sep 2018 14:25:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Db+tDz9UjuZxDDKKS6l8bWQ0DypJpJceollnYPpjx04=; b=mqck7VLiQx2JR3JUZSp9wYJPujCNhcbg0BjdF1acl4uwWl9524eceU9CwxxDkHucY9 CgDY4y8L0W/3DelWriXhOrUlt8B0NwGdHWvUGDhkoclbBeJKUADujEJHtk0ezwUQaF6K B8WLnHNb8zi2cn6xswBrGDDIA8XP9I75Gpb0SH0eg8sDHK9LViI1vs1tVHLuucX5FBoH wFLjEOh4RHhynEK4z8Yp4VQ3hNlHMsmz8ZHMLmhw0igsoPkvuxExkkmXZZ1vK417wbaQ DuPEESfWmiL7HxlXtxd3UaroLphWedPCGQFTGwkO57sBuoIj3jOAqtYM9+R25pH6At3k z48A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Db+tDz9UjuZxDDKKS6l8bWQ0DypJpJceollnYPpjx04=; b=R43Kafq6wV4OvlYiEmYGQzerSzOKR1+Vxsc5acRLptYfd9k7qrTgFsZFemuPivAvcX HgXDJgAjK77HebD5yiqF+6qLMQzzy9tWia/sVySwb5gYzFWHSrWAly8Ga17RJth6IQlg D65mTb0u1LIqLQqd/wKD/ySD4tZgFcybw7PeBO6o78ZXYaA110OrC/8+R2FzA/Yn99Q1 uufRQLGjKVt43C1JlOlFwcmZX15KhHsqN9LV4JQvv4ezzVjlttZUW/w5S6W+PY3oTm6I suI15HSEdUYn0ayX+RxhLoWkhyF+JRItlJJOe5EXdm4/tbVFnTEEshcC8BZ/TfQ9XBzl 55qg== X-Gm-Message-State: ABuFfoga5ZyGbXBjeMqk5Bdw4BmoCYbWiaID/7J+PfuTgWbY9ebImj9R jVrJjbuddrs1F7xRr5eKJpn7TGj6 X-Google-Smtp-Source: ACcGV61+n0ZpoAVHrqX1G5jWVmRxzSkudD9E4lnP2uf9Q78zh0NAYw01S0Wmt90BirigTXueFgl65Q== X-Received: by 2002:adf:9a62:: with SMTP id z89-v6mr3140105wrb.53.1537651504741; Sat, 22 Sep 2018 14:25:04 -0700 (PDT) Received: from localhost.localdomain ([85.119.94.113]) by smtp.gmail.com with ESMTPSA id 75-v6sm16110032wml.21.2018.09.22.14.25.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Sep 2018 14:25:03 -0700 (PDT) From: Petr Vorel To: netdev@vger.kernel.org Cc: Petr Vorel , Stephen Hemminger Subject: [PATCH iproute2 3/7] configure: Remove unused function check_prog() Date: Sat, 22 Sep 2018 23:24:47 +0200 Message-Id: <20180922212451.327-4-petr.vorel@gmail.com> X-Mailer: git-send-email 2.19.0.rc2 In-Reply-To: <20180922212451.327-1-petr.vorel@gmail.com> References: <20180922212451.327-1-petr.vorel@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Petr Vorel --- configure | 6 ------ 1 file changed, 6 deletions(-) diff --git a/configure b/configure index 5ef5cd4c..34325f99 100755 --- a/configure +++ b/configure @@ -11,12 +11,6 @@ CONFIG=config.mk TMPDIR=$(mktemp -d config.XXXXXX) trap 'status=$?; rm -rf $TMPDIR; exit $status' EXIT HUP INT QUIT TERM -check_prog() -{ - echo -n "$2" - command -v $1 >/dev/null 2>&1 && (echo "$3:=y" >> $CONFIG; echo "yes") || (echo "no"; return 1) -} - check_toolchain() { : ${PKG_CONFIG:=pkg-config} From patchwork Sat Sep 22 21:24:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 973622 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@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; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fVfb326V"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42Hk5T5T2Jz9s8T for ; Sun, 23 Sep 2018 07:25:17 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728286AbeIWDUI (ORCPT ); Sat, 22 Sep 2018 23:20:08 -0400 Received: from mail-wr1-f48.google.com ([209.85.221.48]:36941 "EHLO mail-wr1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728020AbeIWDUH (ORCPT ); Sat, 22 Sep 2018 23:20:07 -0400 Received: by mail-wr1-f48.google.com with SMTP id u12-v6so16016489wrr.4 for ; Sat, 22 Sep 2018 14:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=n1T8V+wF2oo5PppaOmDnTnp964aQGdTmN/P6u20Yf2I=; b=fVfb326VL1qEw4p8iH1zYFbRpSF/g69/Wcse70Fsi5gu97TjAZM5XOQHxA/q+C/4UV Cdlo5sEq+8jaK93+GmbmEHdSU9hWni8R85xfBQR5FOgE21CURqUVEJDdGb+YJQHNNpSP BsICnvtL2vy02zy8MW8PUKIc5flkzx+en1nGZRMcvYdanW2tEmiS0skbSDYtv1yAS9pC 7henZX2sw2k/ZMxQhxxsWf+iATnnFWeyY2jS2tazhNjLZQcE5LoO/44qysBYUBCPksbV 8P++IebtK6I1Ni/3xBnHkasjSF4Vjxs5GifvIkhP5uG71v0t6J+MHGupkOUbIBoANmR2 IqWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=n1T8V+wF2oo5PppaOmDnTnp964aQGdTmN/P6u20Yf2I=; b=loDDuiMbmNz4vx3a6b1Z9x3uPxVeHmGzIGyGPJh5Su2I+rFhDAuae5HaZp35zvtKNe SKuA66Lk49E+Mrfbgieb+Uy750Gc83AVUItAiDt4z/dPGGoMSUmoBMNQoq/TciyzBk6Z 7yUjaBV+E0WAfW2U6v3URbS9SY3MyikVSud5ca7TGZdJjeNcyeNej3A72rinhrX5YU7H Idq25WCd4vnHpFwwQMGfoDpoI5WWmAy3fUCYgT4xkGi5S3J4nfA70x7hH9EPxRT8pSVA AOGci5WHdR3O6U5eUVHQ7Ake5FRE1ifPfkA/EDuVYhb/JBje3Qm7OxLFBhLFJHyvIf7f MP3w== X-Gm-Message-State: ABuFfojTKWddTnEkTG/8Sh92mfKuF5uqy5Rq1JROXtJoTkV4LmU3llpo +lkrnRjf0rI2fiJYlgg70oAvcCnd X-Google-Smtp-Source: ACcGV61bqiP6qfjLZP9wQnIgEmHCl5p8pkKBRXLXUeouhyYFdjg5nEhZ8yerRJzAE5R1h8lWBXH+nw== X-Received: by 2002:adf:9227:: with SMTP id 36-v6mr3103216wrj.275.1537651505953; Sat, 22 Sep 2018 14:25:05 -0700 (PDT) Received: from localhost.localdomain ([85.119.94.113]) by smtp.gmail.com with ESMTPSA id 75-v6sm16110032wml.21.2018.09.22.14.25.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Sep 2018 14:25:05 -0700 (PDT) From: Petr Vorel To: netdev@vger.kernel.org Cc: Petr Vorel , Stephen Hemminger Subject: [PATCH iproute2 4/7] configure: Remove non-posix shell expansion Date: Sat, 22 Sep 2018 23:24:48 +0200 Message-Id: <20180922212451.327-5-petr.vorel@gmail.com> X-Mailer: git-send-email 2.19.0.rc2 In-Reply-To: <20180922212451.327-1-petr.vorel@gmail.com> References: <20180922212451.327-1-petr.vorel@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org + change shebang to /bin/sh Signed-off-by: Petr Vorel --- configure | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 34325f99..8f4a7f1e 100755 --- a/configure +++ b/configure @@ -1,4 +1,4 @@ -#! /bin/bash +#!/bin/sh # SPDX-License-Identifier: GPL-2.0 # This is not an autoconf generated configure # @@ -180,7 +180,8 @@ check_ipt_lib_dir() for dir in /lib /usr/lib /usr/local/lib do - for file in $dir/{xtables,iptables}/lib*t_*so ; do + for file in "xtables" "iptables"; do + file="$dir/$file/lib*t_*so" if [ -f $file ]; then echo ${file%/*} echo "IPT_LIB_DIR:=${file%/*}" >> $CONFIG From patchwork Sat Sep 22 21:24:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 973623 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@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; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ijQG8KHL"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42Hk5V3rhrz9sBn for ; Sun, 23 Sep 2018 07:25:18 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728304AbeIWDUK (ORCPT ); Sat, 22 Sep 2018 23:20:10 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:36800 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728189AbeIWDUK (ORCPT ); Sat, 22 Sep 2018 23:20:10 -0400 Received: by mail-wr1-f68.google.com with SMTP id e1-v6so16050489wrt.3 for ; Sat, 22 Sep 2018 14:25:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lEB6wF7tPWN68KdK6KatxykV0btD2HTOJgl7jvQH6MM=; b=ijQG8KHLwjWOjXHMmSIcwHXDntvWEoQKN7fnRn1BfRjowOaNUf/J57nPEhngPgMCkt lucNF2MM0cmKFlwPZWhea0vbNTlLbWM6qKUbpYkdKE3EUaHHl6q2v36RpkvBA+2IQwLC 5qzD1i0maFAj8GVghicNJIeMLOW38goctn2bm4yg20Wt1xmp62g0bflod7pUXXhY0OJE V242aA9ysgQpZPcxoWhodDZN3R5/SjuisEPjgthkX4TinQBgHMD5MbBpyalkojY28RBj O0pzZd6eMOTii4N4WoQCvzx7upGBm6upNFmKGGaK9LYCg2KB8ASYiyNhShCmYi1dIikU n5cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lEB6wF7tPWN68KdK6KatxykV0btD2HTOJgl7jvQH6MM=; b=osTK/SEwA5xfNdcqZHCBMAwK//FbrIWTBD/vxWsxRlfh+qx4EVHprgp4mtD+t0d2sH oTHIe51WbqbOc/+cSADi09IQLjF4ZcgyeTVAUSj32Oq/IOYoIqXl5JrspkXGDLTuZc7Q lQaPfi3TtvcMKjvb0kB6Upp0rGBoECjaPBGnZkV1cl2bpSHkB/neqWYq+rVvyoXOg8p1 n0WrDQJhRYqG/bE+6ZlDnMe+wYlZ66YoIFT9dX2IWxS1CRmsZAil02CE+jXRYsh2Y2Z9 2Oqhr86nLVxwvHBf+KomGzpYPj01U1GByR2g7/c3id+KkF52KwGY3xCdINZ1XzYu4yGk /Fsw== X-Gm-Message-State: ABuFfohIscS8AJ6O6jfUXhBFNtbyghmlI/EbKKMdRgEytkYxkGtOO3M/ 4mKHuubxJAb+yBhkoN2MYhUCrNMv X-Google-Smtp-Source: ACcGV62lx1p47JzVpOkScQ0Fsul0LeJsE1arNd0NQMj/djNOxGyYW+uaNmQ1d/zPNrWgoSW3+d8CTQ== X-Received: by 2002:adf:df0f:: with SMTP id y15-v6mr2789274wrl.26.1537651507560; Sat, 22 Sep 2018 14:25:07 -0700 (PDT) Received: from localhost.localdomain ([85.119.94.113]) by smtp.gmail.com with ESMTPSA id 75-v6sm16110032wml.21.2018.09.22.14.25.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Sep 2018 14:25:06 -0700 (PDT) From: Petr Vorel To: netdev@vger.kernel.org Cc: Petr Vorel , Stephen Hemminger Subject: [PATCH iproute2 5/7] configure: Code cleanup Date: Sat, 22 Sep 2018 23:24:49 +0200 Message-Id: <20180922212451.327-6-petr.vorel@gmail.com> X-Mailer: git-send-email 2.19.0.rc2 In-Reply-To: <20180922212451.327-1-petr.vorel@gmail.com> References: <20180922212451.327-1-petr.vorel@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Petr Vorel --- configure | 65 +++++++++++++++---------------------------------------- 1 file changed, 18 insertions(+), 47 deletions(-) diff --git a/configure b/configure index 8f4a7f1e..86c4cf58 100755 --- a/configure +++ b/configure @@ -32,9 +32,7 @@ int main(int argc, char **argv) { } EOF - $CC -I$INCLUDE -o $TMPDIR/atmtest $TMPDIR/atmtest.c -latm >/dev/null 2>&1 - if [ $? -eq 0 ] - then + if $CC -I$INCLUDE -o $TMPDIR/atmtest $TMPDIR/atmtest.c -latm >/dev/null 2>&1; then echo "TC_CONFIG_ATM:=y" >>$CONFIG echo yes else @@ -45,8 +43,7 @@ EOF check_xtables() { - if ! ${PKG_CONFIG} xtables --exists - then + if ! ${PKG_CONFIG} xtables --exists; then echo "TC_CONFIG_NO_XT:=y" >>$CONFIG fi } @@ -85,10 +82,7 @@ EOF check_xt_old() { # bail if previous XT checks has already succeded. - if grep -q TC_CONFIG_XT $CONFIG - then - return - fi + grep -q TC_CONFIG_XT $CONFIG && return #check if we dont need our internal header .. cat >$TMPDIR/ipttest.c </dev/null 2>&1 - if [ $? -eq 0 ] - then + if $CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL -ldl >/dev/null 2>&1; then echo "TC_CONFIG_XT_OLD:=y" >>$CONFIG echo "using old xtables (no need for xt-internal.h)" fi @@ -124,10 +116,7 @@ EOF check_xt_old_internal_h() { # bail if previous XT checks has already succeded. - if grep -q TC_CONFIG_XT $CONFIG - then - return - fi + grep -q TC_CONFIG_XT $CONFIG && return #check if we need our own internal.h cat >$TMPDIR/ipttest.c </dev/null 2>&1 - - if [ $? -eq 0 ] - then + if $CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL -ldl >/dev/null 2>&1; then echo "using old xtables with xt-internal.h" echo "TC_CONFIG_XT_OLD_H:=y" >>$CONFIG fi @@ -163,8 +149,7 @@ EOF check_ipt() { - if ! grep TC_CONFIG_XT $CONFIG > /dev/null - then + if ! grep TC_CONFIG_XT $CONFIG > /dev/null; then echo "using iptables" fi } @@ -178,8 +163,7 @@ check_ipt_lib_dir() return fi - for dir in /lib /usr/lib /usr/local/lib - do + for dir in /lib /usr/lib /usr/local/lib; do for file in "xtables" "iptables"; do file="$dir/$file/lib*t_*so" if [ -f $file ]; then @@ -202,9 +186,7 @@ int main(int argc, char **argv) return 0; } EOF - $CC -I$INCLUDE -o $TMPDIR/setnstest $TMPDIR/setnstest.c >/dev/null 2>&1 - if [ $? -eq 0 ] - then + if $CC -I$INCLUDE -o $TMPDIR/setnstest $TMPDIR/setnstest.c >/dev/null 2>&1; then echo "IP_CONFIG_SETNS:=y" >>$CONFIG echo "yes" echo "CFLAGS += -DHAVE_SETNS" >>$CONFIG @@ -235,8 +217,7 @@ int main(void) #endif EOF - if $CC -I$INCLUDE -o $TMPDIR/ipsettest $TMPDIR/ipsettest.c >/dev/null 2>&1 - then + if $CC -I$INCLUDE -o $TMPDIR/ipsettest $TMPDIR/ipsettest.c >/dev/null 2>&1; then echo "TC_CONFIG_IPSET:=y" >>$CONFIG echo "yes" else @@ -247,8 +228,7 @@ EOF check_elf() { - if ${PKG_CONFIG} libelf --exists - then + if ${PKG_CONFIG} libelf --exists; then echo "HAVE_ELF:=y" >>$CONFIG echo "yes" @@ -262,8 +242,7 @@ check_elf() check_selinux() # SELinux is a compile time option in the ss utility { - if ${PKG_CONFIG} libselinux --exists - then + if ${PKG_CONFIG} libselinux --exists; then echo "HAVE_SELINUX:=y" >>$CONFIG echo "yes" @@ -276,8 +255,7 @@ check_selinux() check_mnl() { - if ${PKG_CONFIG} libmnl --exists - then + if ${PKG_CONFIG} libmnl --exists; then echo "HAVE_MNL:=y" >>$CONFIG echo "yes" @@ -299,9 +277,7 @@ int main(int argc, char **argv) { return 0; } EOF - $CC -I$INCLUDE -o $TMPDIR/dbtest $TMPDIR/dbtest.c -ldb >/dev/null 2>&1 - if [ $? -eq 0 ] - then + if $CC -I$INCLUDE -o $TMPDIR/dbtest $TMPDIR/dbtest.c -ldb >/dev/null 2>&1; then echo "HAVE_BERKELEY_DB:=y" >>$CONFIG echo "yes" else @@ -320,9 +296,7 @@ int main(int argc, char **argv) { return 0; } EOF - $CC -I$INCLUDE -o $TMPDIR/strtest $TMPDIR/strtest.c >/dev/null 2>&1 - if [ $? -eq 0 ] - then + if $CC -I$INCLUDE -o $TMPDIR/strtest $TMPDIR/strtest.c >/dev/null 2>&1; then echo "no" else echo 'CFLAGS += -DNEED_STRLCPY' >>$CONFIG @@ -333,8 +307,7 @@ EOF check_cap() { - if ${PKG_CONFIG} libcap --exists - then + if ${PKG_CONFIG} libcap --exists; then echo "HAVE_CAP:=y" >>$CONFIG echo "yes" @@ -382,8 +355,7 @@ echo -n " ATM " check_atm check_xtables -if ! grep -q TC_CONFIG_NO_XT $CONFIG -then +if ! grep -q TC_CONFIG_NO_XT $CONFIG; then echo -n " IPT " check_xt check_xt_old @@ -395,8 +367,7 @@ then fi echo -if ! grep -q TC_CONFIG_NO_XT $CONFIG -then +if ! grep -q TC_CONFIG_NO_XT $CONFIG; then echo -n "iptables modules directory: " check_ipt_lib_dir fi From patchwork Sat Sep 22 21:24:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 973624 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@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; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kWx8jBEo"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42Hk5W2WZ2z9s8T for ; Sun, 23 Sep 2018 07:25:19 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728315AbeIWDUM (ORCPT ); Sat, 22 Sep 2018 23:20:12 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:33450 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728020AbeIWDUL (ORCPT ); Sat, 22 Sep 2018 23:20:11 -0400 Received: by mail-wr1-f65.google.com with SMTP id n11-v6so4820923wro.0 for ; Sat, 22 Sep 2018 14:25:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8qQJrqJZVkxWMGnr5YltZ1LSH9YPEMrIWgQWAX9Hp1M=; b=kWx8jBEoCeT5R1k/lEjhK7EBDWE3aKmfiZd315mbRq52ZoUKM+tK0LDnv7nhsturqI N7XKNFl4uq1gEVl7VN7UjDuyM7xU6kO6EOidps0jGyhZJ2CEtMICjw70G6ILWQD/vRrj 02NQQmzgJ3Rfem0wd+wmL+nSw2CSnsdsfef/ppZ7Tj2gtniSXPqZCFQpFMlwujugEYHd KyvTdyl6U+nMMm5WymxRuigM64vNlV+o8Qsyt0p4JzlddcuKSYJFufrLuDriLc652lyY TLXKKeVOvnlzfvWKQiCmZwrvF/9FY0N8+7MEcHk2bIgyMQIAYbbCJlZ0Wp0shDIqlQdt RAmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8qQJrqJZVkxWMGnr5YltZ1LSH9YPEMrIWgQWAX9Hp1M=; b=JdQlcutcDtcYs1Ysa7itehL+n2hE3NfUDJb4ZyYdyw9CvRqUqGWgwbKwL7sZ3Xhv9i 1voS4X7WSfRP3FrJFGtUHsXeVR1S71VIAFbejxZrlTp8df92Nvmb26zyhH02avMtY4lQ ckRdYrEVS0dVzXnONvTwpZSFPw30IIUWf9ahXB7Ju8pZiSdHKk4qgSfcNxVlwwMsRoZt cOm3qtrKRK3Q9hCBWf7pOlewWk2MpwssZfDDePYiqiJC9fpLOdjfh7w1AGD4lpvH/pM1 8vevLUYIstrdqVFy4IU2X792Iy+M4GlTsWwM4R72VdSA7A4hCNKjKLJlA1ODGcjY7Jzs v9pw== X-Gm-Message-State: ABuFfogcaFhP0SwsoFr6To95LAOZXpLQx5073QD9lPXjMcKz60csc77X cDfIluFANi+fuirEj7H+pducEhTf X-Google-Smtp-Source: ACcGV61rH7SpwTNoz/WMkeC26JX/KfqCN3bG7SEbM9Tl+piqTaJta9kdRpHXlsfT/koqyzLqsVJSBw== X-Received: by 2002:adf:9142:: with SMTP id j60-v6mr3139617wrj.180.1537651508970; Sat, 22 Sep 2018 14:25:08 -0700 (PDT) Received: from localhost.localdomain ([85.119.94.113]) by smtp.gmail.com with ESMTPSA id 75-v6sm16110032wml.21.2018.09.22.14.25.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Sep 2018 14:25:08 -0700 (PDT) From: Petr Vorel To: netdev@vger.kernel.org Cc: Petr Vorel , Stephen Hemminger Subject: [PATCH iproute2 6/7] examples: Remove dhcp-client-script Date: Sat, 22 Sep 2018 23:24:50 +0200 Message-Id: <20180922212451.327-7-petr.vorel@gmail.com> X-Mailer: git-send-email 2.19.0.rc2 In-Reply-To: <20180922212451.327-1-petr.vorel@gmail.com> References: <20180922212451.327-1-petr.vorel@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This script is obsolete. Signed-off-by: Petr Vorel --- examples/dhcp-client-script | 446 ------------------------------------ 1 file changed, 446 deletions(-) delete mode 100644 examples/dhcp-client-script diff --git a/examples/dhcp-client-script b/examples/dhcp-client-script deleted file mode 100644 index f39bc109..00000000 --- a/examples/dhcp-client-script +++ /dev/null @@ -1,446 +0,0 @@ -#!/bin/bash -# -# dhclient-script for Linux. -# -# 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: Alexey Kuznetsov, -# -# Probably, I did not understand, what this funny feature as "alias" -# means exactly. For now I suppose, that it is a static address, which -# we should install and preserve. -# - -exec >> /var/log/DHS.log 2>&1 - -echo dhc-script $* reason=$reason -set | grep "^\(old_\|new_\|check_\)" - -LOG () { - echo LOG $* ; -} - -# convert 8bit mask to length -# arg: $1 = mask -# -Mask8ToLen() { - local l=0; - - while [ $l -le 7 ]; do - if [ $[ ( 1 << $l ) + $1 ] -eq 256 ]; then - return $[ 8 - $l ] - fi - l=$[ $l + 1 ] - done - return 0; -} - -# convert inet dotted quad mask to length -# arg: $1 = dotquad mask -# -MaskToLen() { - local masklen=0 - local mask8=$1 - - case $1 in - 0.0.0.0) - return 0; - ;; - 255.*.0.0) - masklen=8 - mask8=${mask8#255.} - mask8=${mask8%.0.0} - ;; - 255.255.*.0) - masklen=16 - mask8=${mask8#255.255.} - mask8=${mask8%.0} - ;; - 255.255.255.*) - masklen=24 - mask8=${mask8#255.255.255.} - ;; - *) - return 255 - ;; - esac - Mask8ToLen $mask8 - return $[ $? + $masklen ] -} - -# calculate ABC "natural" mask -# arg: $1 = dotquad address -# -ABCMask () { - local class; - - class=${1%%.*} - - if [ "$1" = "255.255.255.255" ]; then - echo $1 - elif [ "$1" = "0.0.0.0" ]; then - echo $1 - elif [ $class -ge 224 ]; then - echo 240.0.0.0 - elif [ $class -ge 192 ]; then - echo 255.255.255.0 - elif [ $class -ge 128 ]; then - echo 255.255.0.0 - else - echo 255.0.0.0 - fi -} - -# calculate ABC "natural" mask length -# arg: $1 = dotquad address -# -ABCMaskLen () { - local class; - - class=${1%%.*} - - if [ "$1" = "255.255.255.255" ]; then - return 32 - elif [ "$1" = "0.0.0.0" ]; then - return 0 - elif [ $class -ge 224 ]; then - return 4; - elif [ $class -ge 192 ]; then - return 24; - elif [ $class -ge 128 ]; then - return 16; - else - return 8; - fi -} - -# Delete IP address -# args: $1 = interface -# $2 = address -# $3 = mask -# $4 = broadcast -# $5 = label -# -DelINETAddr () { - local masklen=32 - local addrid=$1 - - LOG DelINETAddr $* - - if [ "$5" ]; then - addrid=$addrid:$5 - fi - LOG ifconfig $addrid down - ifconfig $addrid down -} - -# Add IP address -# args: $1 = interface -# $2 = address -# $3 = mask -# $4 = broadcast -# $5 = label -# -AddINETAddr () { - local mask_arg - local brd_arg - local addrid=$1 - - LOG AddINETAddr $* - - if [ "$5" ]; then - addrid=$addrid:$5 - fi - if [ "$3" ]; then - mask_arg="netmask $3" - fi - if [ "$4" ]; then - brd_arg="broadcast $4" - fi - - LOG ifconfig $addrid $2 $mask_arg $brd_arg up - ifconfig $addrid $2 $mask_arg $brd_arg up -} - -# Add default routes -# args: $1 = routers list -# -AddDefaultRoutes() { - local router - - if [ "$1" ]; then - LOG AddDefaultRoutes $* - for router in $1; do - LOG route add default gw $router - route add default gw $router - done ; - fi -} - -# Delete default routes -# args: $1 = routers list -# -DelDefaultRoutes() { - local router - - if [ "$1" ]; then - LOG DelDefaultRoutes $* - - for router in $1; do - LOG route del default gw $router - route del default gw $router - done - fi -} - -# ping a host -# args: $1 = dotquad address of the host -# -PingNode() { - LOG PingNode $* - if ping -q -c 1 -w 2 $1 ; then - return 0; - fi - return 1; -} - -# Check (and add route, if alive) default routers -# args: $1 = routers list -# returns: 0 if at least one router is alive. -# -CheckRouterList() { - local router - local succeed=1 - - LOG CheckRouterList $* - - for router in $1; do - if PingNode $router ; then - succeed=0 - route add default gw $router - fi - done - return $succeed -} - -# Delete/create static routes. -# args: $1 = operation (del/add) -# $2 = routes list in format "dst1 nexthop1 dst2 ..." -# -# BEWARE: this feature of DHCP is obsolete, because does not -# support subnetting. -# -X-StaticRouteList() { - local op=$1 - local lst="$2" - local masklen - - LOG X-StaticRouteList $* - - if [ "$lst" ]; then - set $lst - while [ $# -gt 1 ]; do - route $op -net $1 netmask `ABCMask "$1"` gw $2 - shift; shift; - done - fi -} - -# Create static routes. -# arg: $1 = routes list in format "dst1 nexthop1 dst2 ..." -# -AddStaticRouteList() { - LOG AddStaticRouteList $* - X-StaticRouteList add "$1" -} - -# Delete static routes. -# arg: $1 = routes list in format "dst1 nexthop1 dst2 ..." -# -DelStaticRouteList() { - LOG DelStaticRouteList $* - X-StaticRouteList del "$1" -} - -# Broadcast unsolicited ARP to update neighbours' caches. -# args: $1 = interface -# $2 = address -# -UnsolicitedARP() { - if [ -f /sbin/arping ]; then - /sbin/arping -A -c 1 -I "$1" "$2" & - (sleep 2 ; /sbin/arping -U -c 1 -I "$1" "$2" ) & - fi -} - -# Duplicate address detection. -# args: $1 = interface -# $2 = test address -# returns: 0, if DAD succeeded. -DAD() { - if [ -f /sbin/arping ]; then - /sbin/arping -c 2 -w 3 -D -I "$1" "$2" - return $? - fi - return 0 -} - - -# Setup resolver. -# args: NO -# domain and nameserver list are passed in global variables. -# -# NOTE: we try to be careful and not to break user supplied resolv.conf. -# The script mangles it, only if it has dhcp magic signature. -# -UpdateDNS() { - local nameserver - local idstring="#### Generated by DHCPCD" - - LOG UpdateDNS $* - - if [ "$new_domain_name" = "" -a "$new_domain_name_servers" = "" ]; then - return 0; - fi - - echo $idstring > /etc/resolv.conf.dhcp - if [ "$new_domain_name" ]; then - echo search $new_domain_name >> /etc/resolv.conf.dhcp - fi - echo options ndots:1 >> /etc/resolv.conf.dhcp - - if [ "$new_domain_name_servers" ]; then - for nameserver in $new_domain_name_servers; do - echo nameserver $nameserver >> /etc/resolv.conf.dhcp - done - else - echo nameserver 127.0.0.1 >> /etc/resolv.conf.dhcp - fi - - if [ -f /etc/resolv.conf ]; then - if [ "`head -1 /etc/resolv.conf`" != "$idstring" ]; then - return 0 - fi - if [ "$old_domain_name" = "$new_domain_name" -a - "$new_domain_name_servers" = "$old_domain_name_servers" ]; then - return 0 - fi - fi - mv /etc/resolv.conf.dhcp /etc/resolv.conf -} - -case $reason in -NBI) - exit 1 - ;; - -MEDIUM) - exit 0 - ;; - -PREINIT) - ifconfig $interface:dhcp down - ifconfig $interface:dhcp1 down - if [ -d /proc/sys/net/ipv4/conf/$interface ]; then - ifconfig $interface:dhcp 10.10.10.10 netmask 255.255.255.255 - ifconfig $interface:dhcp down - if [ -d /proc/sys/net/ipv4/conf/$interface ]; then - LOG The interface $interface already configured. - fi - fi - ifconfig $interface:dhcp up - exit 0 - ;; - -ARPSEND) - exit 0 - ;; - -ARPCHECK) - if DAD "$interface" "$check_ip_address" ; then - exit 0 - fi - exit 1 - ;; - -BOUND|RENEW|REBIND|REBOOT) - if [ "$old_ip_address" -a "$alias_ip_address" -a \ - "$alias_ip_address" != "$old_ip_address" ]; then - DelINETAddr "$interface" "$alias_ip_address" "$alias_subnet_mask" "$alias_broadcast_address" dhcp1 - fi - if [ "$old_ip_address" -a "$old_ip_address" != "$new_ip_address" ]; then - DelINETAddr "$interface" "$old_ip_address" "$old_subnet_mask" "$old_broadcast_address" dhcp - DelDefaultRoutes "$old_routers" - DelStaticRouteList "$old_static_routes" - fi - if [ "$old_ip_address" = "" -o "$old_ip_address" != "$new_ip_address" -o \ - "$reason" = "BOUND" -o "$reason" = "REBOOT" ]; then - AddINETAddr "$interface" "$new_ip_address" "$new_subnet_mask" "$new_broadcast_address" dhcp - AddStaticRouteList "$new_static_routes" - AddDefaultRoutes "$new_routers" - UnsolicitedARP "$interface" "$new_ip_address" - fi - if [ "$new_ip_address" != "$alias_ip_address" -a "$alias_ip_address" ]; then - AddINETAddr "$interface" "$alias_ip_address" "$alias_subnet_mask" "$alias_broadcast_address" dhcp1 - fi - UpdateDNS - exit 0 - ;; - -EXPIRE|FAIL) - if [ "$alias_ip_address" ]; then - DelINETAddr "$interface" "$alias_ip_address" "$alias_subnet_mask" "$alias_broadcast_address" dhcp1 - fi - if [ "$old_ip_address" ]; then - DelINETAddr "$interface" "$old_ip_address" "$old_subnet_mask" "$old_broadcast_address" dhcp - DelDefaultRoutes "$old_routers" - DelStaticRouteList "$old_static_routes" - fi - if [ "$alias_ip_address" ]; then - AddINETAddr "$interface" "$alias_ip_address" "$alias_subnet_mask" "$alias_broadcast_address" dhcp1 - fi - exit 0 - ;; - -TIMEOUT) - if [ "$alias_ip_address" ]; then - DelINETAddr "$interface" "$alias_ip_address" "$alias_subnet_mask" "$alias_broadcast_address" dhcp1 - fi -# Seems, means, that no more old leases found. -# Or does it mean bug in dhcpcd? 8) Fail for now. - if [ "$new_ip_address" = "" ]; then - if [ "$old_ip_address" ]; then - DelINETAddr "$interface" "$old_ip_address" "$old_subnet_mask" "$old_broadcast_address" dhcp - fi - if [ "$alias_ip_address" ]; then - AddINETAddr "$interface" "$alias_ip_address" "$alias_subnet_mask" "$alias_broadcast_address" dhcp1 - fi - exit 1 - fi - if DAD "$interface" "$new_ip_address" ; then - AddINETAddr "$interface" "$new_ip_address" "$new_subnet_mask" "$new_broadcast_address" dhcp - UnsolicitedARP "$interface" "$new_ip_address" - if [ "$alias_ip_address" -a "$alias_ip_address" != "$new_ip_address" ]; then - AddINETAddr "$interface" "$alias_ip_address" "$alias_subnet_mask" "$alias_broadcast_address" dhcp1 - UnsolicitedARP "$interface" "$alias_ip_address" - fi - if CheckRouterList "$new_routers" ; then - AddStaticRouteList "$new_static_routes" - UpdateDNS - exit 0 - fi - fi - DelINETAddr "$interface" "$new_ip_address" "$new_subnet_mask" "$new_broadcast_address" dhcp - DelDefaultRoutes "$old_routers" - DelStaticRouteList "$old_static_routes" - if [ "$alias_ip_address" ]; then - AddINETAddr "$interface" "$alias_ip_address" "$alias_subnet_mask" "$alias_broadcast_address" dhcp1 - fi - exit 1 - ;; -esac - -exit 0 From patchwork Sat Sep 22 21:24:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 973625 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@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; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XY6rfj/P"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42Hk5X1l1Cz9sBn for ; Sun, 23 Sep 2018 07:25:20 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728323AbeIWDUQ (ORCPT ); Sat, 22 Sep 2018 23:20:16 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:53223 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728189AbeIWDUQ (ORCPT ); Sat, 22 Sep 2018 23:20:16 -0400 Received: by mail-wm1-f67.google.com with SMTP id l7-v6so1378306wme.2 for ; Sat, 22 Sep 2018 14:25:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wkeDd//ojv/PcsMzrjRcOJ1zEK8XJd3xjMneiMNKrE4=; b=XY6rfj/PBWOfrgsQtO8BsaB1xOJyHUZFYLeZml6CdLFFdqes/HhcgaRzYzkZz2nZmf bpuw3ZI1jBOUOnwmAD/h7rVsv6FqpxGEZA2cQQtVce1VrYWx6/zzvGcUoS4VJiZuMJyX p1usMDOAKAT/D9WCnc+a6hXWVxdC0Xa13pVI5/oGAdv0aEByf/qa0HtGGAkOFoSyg7+q vNI2oWtgYTu27D78ffJDxjHOSS80U6Az4K33lyy5aMqt1GcRXy7KVt0fX3co6Q8Ybqjk 1WPwxwYHNPvHisN8gT2pTiLfWZcyGF/5U0+yeQFSwtz7une3ce500GuVj83Ng2tMVmK0 92pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wkeDd//ojv/PcsMzrjRcOJ1zEK8XJd3xjMneiMNKrE4=; b=f2yuOE/I2ka2vVmRqoudx+QKrQw00M4a4UufyA67iu/XbIYWXG9f7B0mf9gDCxtyYU romr0oGxjjo8TqYkcUl0hUxhk9KMCXl1rnUF8dbMfz+4jiQo31DpvXCpUHFAztzSQNyF zT65KmeTl/pn7S2RCnK2vJQje4yV4JjNP3TciqjfKIxjrdx8iEehIT5SEWfVoyULIArI 1YJ0SxZhrpBhVQDzwhMIaCDtymwz9XFtYh3VEY54Y/ps6dpMB+icVdis7nkZwuS4c8u5 rPyrZx9Y6+dwOsejZabvya7GdJHWPVpFxA7zlsck4DCoYEQg1Qd8Dow7030oj8Vi6QjQ p3iw== X-Gm-Message-State: APzg51Cn+g4VoqusVjF2kg4ih+4pfivT7bbbztawka+cIglk6JJKZhLw ixrSxojb6/i4csKv4ELW9BpAsXai X-Google-Smtp-Source: ACcGV609A2SI1Kl0wHJ0ogmfjfo3ABCpDFoGCAZY9oxCDr5ynRoKVuN5ZzufH79q9WLti09h0eOSzQ== X-Received: by 2002:a1c:668b:: with SMTP id a133-v6mr2300557wmc.50.1537651510612; Sat, 22 Sep 2018 14:25:10 -0700 (PDT) Received: from localhost.localdomain ([85.119.94.113]) by smtp.gmail.com with ESMTPSA id 75-v6sm16110032wml.21.2018.09.22.14.25.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Sep 2018 14:25:09 -0700 (PDT) From: Petr Vorel To: netdev@vger.kernel.org Cc: Petr Vorel , Stephen Hemminger Subject: [PATCH iproute2 7/7] examples: Remove cbq.init-v0.7.3 Date: Sat, 22 Sep 2018 23:24:51 +0200 Message-Id: <20180922212451.327-8-petr.vorel@gmail.com> X-Mailer: git-send-email 2.19.0.rc2 In-Reply-To: <20180922212451.327-1-petr.vorel@gmail.com> References: <20180922212451.327-1-petr.vorel@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This script is obsolete. Signed-off-by: Petr Vorel --- examples/cbq.init-v0.7.3 | 983 --------------------------------------- 1 file changed, 983 deletions(-) delete mode 100644 examples/cbq.init-v0.7.3 diff --git a/examples/cbq.init-v0.7.3 b/examples/cbq.init-v0.7.3 deleted file mode 100644 index 66448d88..00000000 --- a/examples/cbq.init-v0.7.3 +++ /dev/null @@ -1,983 +0,0 @@ -#!/bin/bash -# -# cbq.init v0.7.3 -# Copyright (C) 1999 Pavel Golubev -# Copyright (C) 2001-2004 Lubomir Bulej -# -# chkconfig: 2345 11 89 -# description: sets up CBQ-based traffic control -# -# 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. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# To get the latest version, check on Freshmeat for actual location: -# -# http://freshmeat.net/projects/cbq.init -# -# -# VERSION HISTORY -# --------------- -# v0.7.3- Deepak Singhal -# - fix timecheck to not ignore regular TIME rules after -# encountering a TIME rule that spans over midnight -# - Nathan Shafer -# - allow symlinks to class files -# - Seth J. Blank -# - replace hardcoded ip/tc location with variables -# - Mark Davis -# - allow setting of PRIO_{MARK,RULE,REALM} in class file -# - Fernando Sanch -# - allow underscores in interface names -# v0.7.2- Paulo Sedrez -# - fix time2abs to allow hours with leading zero in TIME rules -# - Svetlin Simeonov -# - fix cbq_device_list to allow VLAN interfaces -# - Mark Davis -# - ignore *~ backup files when looking for classes -# - Mike Boyer -# - fix to allow arguments to be passed to "restart" command -# v0.7.1- Lubomir Bulej -# - default value for PERTURB -# - fixed small bug in RULE parser to correctly parse rules with -# identical source and destination fields -# - faster initial scanning of DEVICE fields -# v0.7 - Lubomir Bulej -# - lots of various cleanups and reorganizations; the parsing is now -# some 40% faster, but the class ID must be in range 0x0002-0xffff -# (again). Because of the number of internal changes and the above -# class ID restriction, I bumped the version to 0.7 to indicate -# something might have got broken :) -# - changed PRIO_{U32,FW,ROUTE} to PRIO_{RULE,MARK,REALM} -# for consistency with filter keywords -# - exposed "compile" command -# - Catalin Petrescu -# - support for port masks in RULE (u32) filter -# - Jordan Vrtanoski -# - support for week days in TIME rules -# v0.6.4- Lubomir Bulej -# - added PRIO_* variables to allow easy control of filter priorities -# - added caching to speed up CBQ start, the cache is invalidated -# whenever any of the configuration files changes -# - updated the readme section + some cosmetic fixes -# v0.6.3- Lubomir Bulej -# - removed setup of (unnecessary) class 1:1 - all classes -# now use qdisc's default class 1:0 as their parent -# - minor fix in the timecheck branch - classes -# without leaf qdisc were not updated -# - minor fix to avoid timecheck failure when run -# at time with minutes equal to 08 or 09 -# - respect CBQ_PATH setting in environment -# - made PRIO=5 default, rendering it optional in configs -# - added support for route filter, see notes about REALM keyword -# - added support for fw filter, see notes about MARK keyword -# - added filter display to "list" and "stats" commands -# - readme section update + various cosmetic fixes -# v0.6.2- Catalin Petrescu -# - added tunnels interface handling -# v0.6.1- Pavel Golubev -# - added sch_prio module loading -# (thanks johan at iglo.virtual.or.id for reminding) -# - resolved errors resulting from stricter syntax checking in bash2 -# - Lubomir Bulej -# - various cosmetic fixes -# v0.6 - Lubomir Bulej -# - attempt to limit number of spawned processes by utilizing -# more of sed power (use sed instead of grep+cut) -# - simplified TIME parser, using bash builtins -# - added initial support for SFQ as leaf qdisc -# - reworked the documentation part a little -# - incorporated pending patches and ideas submitted by -# following people for versions 0.3 into version 0.6 -# - Miguel Freitas -# - in case of overlapping TIME parameters, the last match is taken -# - Juanjo Ciarlante -# - chkconfig tags, list + stats startup parameters -# - optional tc & ip command logging (into /var/run/cbq-*) -# - Rafal Maszkowski -# - PEAK parameter for setting TBF's burst peak rate -# - fix for many config files (use find instead of ls) -# v0.5.1- Lubomir Bulej -# - fixed little but serious bug in RULE parser -# v0.5 - Lubomir Bulej -# - added options PARENT, LEAF, ISOLATED and BOUNDED. This allows -# (with some attention to config file ordering) for creating -# hierarchical structures of shapers with classes able (or unable) -# to borrow bandwidth from their parents. -# - class ID check allows hexadecimal numbers -# - rewritten & simplified RULE parser -# - cosmetic changes to improve readability -# - reorganization to avoid duplicate code (timecheck etc.) -# - timecheck doesn't check classes without TIME fields anymore -# v0.4 - Lubomir Bulej -# - small bugfix in RULE parsing code -# - simplified configuration parsing code -# - several small cosmetic changes -# - TIME parameter can be now specified more than once allowing you to -# differentiate RATE throughout the whole day. Time overlapping is -# not checked, first match is taken. Midnight wrap (eg. 20:00-6:00) -# is allowed and taken care of. -# v0.3a4- fixed small bug in IF operator. Thanks to -# Rafal Maszkowski -# v0.3a3- fixed grep bug when using more than 10 eth devices. Thanks to David -# Trcka . -# v0.3a2- fixed bug in "if" operator. Thanks kad at dgtu.donetsk.ua. -# v0.3a - added TIME parameter. Example: TIME=00:00-19:00;64Kbit/6Kbit -# So, between 00:00 and 19:00 the RATE will be 64Kbit. -# Just start "cbq.init timecheck" periodically from cron -# (every 10 minutes for example). DON'T FORGET though, to run -# "cbq.init start" for CBQ to initialize. -# v0.2 - Some cosmetic changes. Now it is more compatible with old bash -# version. Thanks to Stanislav V. Voronyi . -# v0.1 - First public release -# -# -# README -# ------ -# -# First of all - this is just a SIMPLE EXAMPLE of CBQ power. -# Don't ask me "why" and "how" :) -# -# This script is meant to simplify setup and management of relatively simple -# CBQ-based traffic control on Linux. Access to advanced networking features -# of Linux kernel is provided by "ip" and "tc" utilities from A. Kuznetsov's -# iproute2 package, available at ftp://ftp.inr.ac.ru/ip-routing. Because the -# utilities serve primarily to translate user wishes to RTNETLINK commands, -# their interface is rather spartan, intolerant and requires quite a lot of -# typing. And typing is what this script attempts to reduce :) -# -# The advanced networking stuff in Linux is pretty flexible and this script -# aims to bring some of its features to the not-so-hard-core Linux users. Of -# course, there is a tradeoff between simplicity and flexibility and you may -# realize that the flexibility suffered too much for your needs -- time to -# face "ip" and "tc" interface. -# -# To speed up the "start" command, simple caching was introduced in version -# 0.6.4. The caching works so that the sequence of "tc" commands for given -# configuration is stored in a file (/var/cache/cbq.init by default) which -# is used next time the "start" command is run to avoid repeated parsing of -# configuration files. This cache is invalidated whenever any of the CBQ -# configuration files changes. If you want to run "cbq.init start" without -# caching, run it as "cbq.init start nocache". If you want to force cache -# invalidation, run it as "cbq.init start invalidate". Caching is disabled -# if you have logging enabled (ie. CBQ_DEBUG is not empty). -# -# If you only want cqb.init to translate your configuration to "tc" commands, -# use "compile" command which will output "tc" commands required to build -# your configuration. Bear in mind that "compile" does not check if the "tc" -# commands were successful - this is done (in certain places) only when the -# "start nocache" command is used, which is also useful when creating the -# configuration to check whether it is completely valid. -# -# All CBQ parameters are valid for Ethernet interfaces only, The script was -# tested on various Linux kernel versions from series 2.1 to 2.4 and several -# distributions with KSI Linux (Nostromo version) as the premier one. -# -# -# HOW DOES IT WORK? -# ----------------- -# -# Every traffic class must be described by a file in the $CBQ_PATH directory -# (/etc/sysconfig/cbq by default) - one file per class. -# -# The config file names must obey mandatory format: cbq-. where -# is two-byte hexadecimal number in range <0002-FFFF> (which in fact -# is a CBQ class ID) and is the name of the class -- anything to help -# you distinguish the configuration files. For small amount of classes it is -# often possible (and convenient) to let resemble bandwidth of the -# class. -# -# Example of valid config name: -# cbq-1280.My_first_shaper -# -# -# The configuration file may contain the following parameters: -# -### Device parameters -# -# DEVICE=,[,] mandatory -# DEVICE=eth0,10Mbit,1Mbit -# -# is the name of the interface you want to control -# traffic on, e.g. eth0 -# is the physical bandwidth of the device, e.g. for -# ethernet 10Mbit or 100Mbit, for arcnet 2Mbit -# is tuning parameter that should be proportional to -# . As a rule of thumb: = / 10 -# -# When you have more classes on one interface, it is enough to specify -# [and ] only once, therefore in other files you only -# need to set DEVICE=. -# -### Class parameters -# -# RATE= mandatory -# RATE=5Mbit -# -# Bandwidth allocated to the class. Traffic going through the class is -# shaped to conform to specified rate. You can use Kbit, Mbit or bps, -# Kbps and Mbps as suffices. If you don't specify any unit, bits/sec -# are used. Also note that "bps" means "bytes per second", not bits. -# -# WEIGHT= mandatory -# WEIGHT=500Kbit -# -# Tuning parameter that should be proportional to RATE. As a rule -# of thumb, use WEIGHT ~= RATE / 10. -# -# PRIO=<1-8> optional, default 5 -# PRIO=5 -# -# Priority of class traffic. The higher the number, the lesser -# the priority. Priority of 5 is just fine. -# -# PARENT= optional, default not set -# PARENT=1280 -# -# Specifies ID of the parent class to which you want this class be -# attached. You might want to use LEAF=none for the parent class as -# mentioned below. By using this parameter and carefully ordering the -# configuration files, it is possible to create simple hierarchical -# structures of CBQ classes. The ordering is important so that parent -# classes are constructed prior to their children. -# -# LEAF=none|tbf|sfq optional, default "tbf" -# -# Tells the script to attach specified leaf queueing discipline to CBQ -# class. By default, TBF is used. Note that attaching TBF to CBQ class -# shapes the traffic to conform to TBF parameters and prevents the class -# from borrowing bandwidth from its parent even if you have BOUNDED set -# to "no". To allow the class to borrow bandwith (provided it is not -# bounded), you must set LEAF to "none" or "sfq". -# -# If you want to ensure (approximately) fair sharing of bandwidth among -# several hosts in the same class, you might want to specify LEAF=sfq to -# attach SFQ as leaf queueing discipline to that class. -# -# BOUNDED=yes|no optional, default "yes" -# -# If set to "yes", the class is not allowed to borrow bandwidth from -# its parent class in overlimit situation. If set to "no", the class -# will be allowed to borrow bandwidth from its parent. -# -# Note: Don't forget to set LEAF to "none" or "sfq", otherwise the class will -# have TBF attached to itself and will not be able to borrow unused -# bandwith from its parent. -# -# ISOLATED=yes|no optional, default "no" -# -# If set to "yes", the class will not lend unused bandwidth to -# its children. -# -### TBF qdisc parameters -# -# BUFFER=[/] optional, default "10Kb/8" -# -# This parameter controls the depth of the token bucket. In other -# words it represents the maximal burst size the class can send. -# The optional part of parameter is used to determine the length -# of intervals in packet sizes, for which the transmission times -# are kept. -# -# LIMIT= optional, default "15Kb" -# -# This parameter determines the maximal length of backlog. If -# the queue contains more data than specified by LIMIT, the -# newly arriving packets are dropped. The length of backlog -# determines queue latency in case of congestion. -# -# PEAK= optional, default not set -# -# Maximal peak rate for short-term burst traffic. This allows you -# to control the absolute peak rate the class can send at, because -# single TBF that allows 256Kbit/s would of course allow rate of -# 512Kbit for half a second or 1Mbit for a quarter of second. -# -# MTU= optional, default "1500" -# -# Maximum number of bytes that can be sent at once over the -# physical medium. This parameter is required when you specify -# PEAK parameter. It defaults to MTU of ethernet - for other -# media types you might want to change it. -# -# Note: Setting TBF as leaf qdisc will effectively prevent the class from -# borrowing bandwidth from the ancestor class, because even if the -# class allows more traffic to pass through, it is then shaped to -# conform to TBF. -# -### SFQ qdisc parameters -# -# The SFQ queueing discipline is a cheap way for sharing class bandwidth -# among several hosts. As it is stochastic, the fairness is approximate but -# it will do the job in most cases. If you want real fairness, you should -# probably use WRR (weighted round robin) or WFQ queueing disciplines. Note -# that SFQ does not do any traffic shaping - the shaping is done by the CBQ -# class the SFQ is attached to. -# -# QUANTUM= optional, default not set -# -# This parameter should not be set lower than link MTU, for ethernet -# it is 1500b, or (with MAC header) 1514b which is the value used -# in Alexey Kuznetsov's examples. -# -# PERTURB= optional, default "10" -# -# Period of hash function perturbation. If unset, hash reconfiguration -# will never take place which is what you probably don't want. The -# default value of 10 seconds is probably a good one. -# -### Filter parameters -# -# RULE=[[saddr[/prefix]][:port[/mask]],][daddr[/prefix]][:port[/mask]] -# -# These parameters make up "u32" filter rules that select traffic for -# each of the classes. You can use multiple RULE fields per config. -# -# The optional port mask should only be used by advanced users who -# understand how the u32 filter works. -# -# Some examples: -# -# RULE=10.1.1.0/24:80 -# selects traffic going to port 80 in network 10.1.1.0 -# -# RULE=10.2.2.5 -# selects traffic going to any port on single host 10.2.2.5 -# -# RULE=10.2.2.5:20/0xfffe -# selects traffic going to ports 20 and 21 on host 10.2.2.5 -# -# RULE=:25,10.2.2.128/26:5000 -# selects traffic going from anywhere on port 50 to -# port 5000 in network 10.2.2.128 -# -# RULE=10.5.5.5:80, -# selects traffic going from port 80 of single host 10.5.5.5 -# -# -# -# REALM=[srealm,][drealm] -# -# These parameters make up "route" filter rules that classify traffic -# according to packet source/destination realms. For information about -# realms, see Alexey Kuznetsov's IP Command Reference. This script -# does not define any realms, it justs builds "tc filter" commands -# for you if you need to classify traffic this way. -# -# Realm is either a decimal number or a string referencing entry in -# /etc/iproute2/rt_realms (usually). -# -# Some examples: -# -# REALM=russia,internet -# selects traffic going from realm "russia" to realm "internet" -# -# REALM=freenet, -# selects traffic going from realm "freenet" -# -# REALM=10 -# selects traffic going to realm 10 -# -# -# -# MARK= -# -# These parameters make up "fw" filter rules that select traffic for -# each of the classes accoring to firewall "mark". Mark is a decimal -# number packets are tagged with if firewall rules say so. You can -# use multiple MARK fields per config. -# -# -# Note: Rules for different filter types can be combined. Attention must be -# paid to the priority of filter rules, which can be set below using -# PRIO_{RULE,MARK,REALM} variables. -# -### Time ranging parameters -# -# TIME=[,, ...,/]-;/[/] -# TIME=0,1,2,5/18:00-06:00;256Kbit/25Kbit -# TIME=60123/18:00-06:00;256Kbit/25Kbit -# TIME=18:00-06:00;256Kbit/25Kbit -# -# This parameter allows you to differentiate the class bandwidth -# throughout the day. You can specify multiple TIME parameters, if -# the times overlap, last match is taken. The fields , -# and correspond to parameters RATE, WEIGHT and PEAK (which -# is optional and applies to TBF leaf qdisc only). -# -# You can also specify days of week when the TIME rule applies. -# is numeric, 0 corresponds to sunday, 1 corresponds to monday, etc. -# -### -# -# Sample configuration file: cbq-1280.My_first_shaper -# -# -------------------------------------------------------------------------- -# DEVICE=eth0,10Mbit,1Mbit -# RATE=128Kbit -# WEIGHT=10Kbit -# PRIO=5 -# RULE=192.128.1.0/24 -# -------------------------------------------------------------------------- -# -# The configuration says that we will control traffic on 10Mbit ethernet -# device eth0 and the traffic going to network 192.168.1.0 will be -# processed with priority 5 and shaped to rate of 128Kbit. -# -# Note that you can control outgoing traffic only. If you want to control -# traffic in both directions, you must set up CBQ for both interfaces. -# -# Consider the following example: -# -# +---------+ 192.168.1.1 -# BACKBONE -----eth0-| linux |-eth1------*-[client] -# +---------+ -# -# Imagine you want to shape traffic from backbone to the client to 28Kbit -# and traffic in the opposite direction to 128Kbit. You need to setup CBQ -# on both eth0 and eth1 interfaces, thus you need two config files: -# -# cbq-028.backbone-client -# -------------------------------------------------------------------------- -# DEVICE=eth1,10Mbit,1Mbit -# RATE=28Kbit -# WEIGHT=2Kbit -# PRIO=5 -# RULE=192.168.1.1 -# -------------------------------------------------------------------------- -# -# cbq-128.client-backbone -# -------------------------------------------------------------------------- -# DEVICE=eth0,10Mbit,1Mbit -# RATE=128Kbit -# WEIGHT=10Kbit -# PRIO=5 -# RULE=192.168.1.1, -# -------------------------------------------------------------------------- -# -# Pay attention to comma "," in the RULE field - it denotes source address! -# -# Enjoy. -# -############################################################################# - -export LC_ALL=C - -### Command locations -TC=/sbin/tc -IP=/sbin/ip -MP=/sbin/modprobe - -### Default filter priorities (must be different) -PRIO_RULE_DEFAULT=${PRIO_RULE:-100} -PRIO_MARK_DEFAULT=${PRIO_MARK:-200} -PRIO_REALM_DEFAULT=${PRIO_REALM:-300} - -### Default CBQ_PATH & CBQ_CACHE settings -CBQ_PATH=${CBQ_PATH:-/etc/sysconfig/cbq} -CBQ_CACHE=${CBQ_CACHE:-/var/cache/cbq.init} - -### Uncomment to enable logfile for debugging -#CBQ_DEBUG="/var/run/cbq-$1" - -### Modules to probe for. Uncomment the last CBQ_PROBE -### line if you have QoS support compiled into kernel -CBQ_PROBE="sch_cbq sch_tbf sch_sfq sch_prio" -CBQ_PROBE="$CBQ_PROBE cls_fw cls_u32 cls_route" -#CBQ_PROBE="" - -### Keywords required for qdisc & class configuration -CBQ_WORDS="DEVICE|RATE|WEIGHT|PRIO|PARENT|LEAF|BOUNDED|ISOLATED" -CBQ_WORDS="$CBQ_WORDS|PRIO_MARK|PRIO_RULE|PRIO_REALM|BUFFER" -CBQ_WORDS="$CBQ_WORDS|LIMIT|PEAK|MTU|QUANTUM|PERTURB" - -### Source AVPKT if it exists -[ -r /etc/sysconfig/cbq/avpkt ] && . /etc/sysconfig/cbq/avpkt -AVPKT=${AVPKT:-3000} - - -############################################################################# -############################# SUPPORT FUNCTIONS ############################# -############################################################################# - -### Get list of network devices -cbq_device_list () { - ip link show| sed -n "/^[0-9]/ \ - { s/^[0-9]\+: \([a-z0-9._]\+\)[:@].*/\1/; p; }" -} # cbq_device_list - - -### Remove root class from device $1 -cbq_device_off () { - tc qdisc del dev $1 root 2> /dev/null -} # cbq_device_off - - -### Remove CBQ from all devices -cbq_off () { - for dev in `cbq_device_list`; do - cbq_device_off $dev - done -} # cbq_off - - -### Prefixed message -cbq_message () { - echo -e "**CBQ: $*" -} # cbq_message - -### Failure message -cbq_failure () { - cbq_message "$@" - exit 1 -} # cbq_failure - -### Failure w/ cbq-off -cbq_fail_off () { - cbq_message "$@" - cbq_off - exit 1 -} # cbq_fail_off - - -### Convert time to absolute value -cbq_time2abs () { - local min=${1##*:}; min=${min##0} - local hrs=${1%%:*}; hrs=${hrs##0} - echo $[hrs*60 + min] -} # cbq_time2abs - - -### Display CBQ setup -cbq_show () { - for dev in `cbq_device_list`; do - [ "`tc qdisc show dev $dev| wc -l`" -eq 0 ] && continue - echo -e "### $dev: queueing disciplines\n" - tc $1 qdisc show dev $dev; echo - - [ "`tc class show dev $dev| wc -l`" -eq 0 ] && continue - echo -e "### $dev: traffic classes\n" - tc $1 class show dev $dev; echo - - [ "`tc filter show dev $dev| wc -l`" -eq 0 ] && continue - echo -e "### $dev: filtering rules\n" - tc $1 filter show dev $dev; echo - done -} # cbq_show - - -### Check configuration and load DEVICES, DEVFIELDS and CLASSLIST from $1 -cbq_init () { - ### Get a list of configured classes - CLASSLIST=`find $1 -maxdepth 1 \( -type f -or -type l \) -name 'cbq-*' \ - -not -name '*~' -printf "%f\n"| sort` - [ -z "$CLASSLIST" ] && - cbq_failure "no configuration files found in $1!" - - ### Gather all DEVICE fields from $1/cbq-* - DEVFIELDS=`find $1 -maxdepth 1 \( -type f -or -type l \) -name 'cbq-*' \ - -not -name '*~' -print0 | xargs -0 sed -n 's/#.*//; \ - s/[[:space:]]//g; /^DEVICE=[^,]*,[^,]*\(,[^,]*\)\?/ \ - { s/.*=//; p; }'| sort -u` - [ -z "$DEVFIELDS" ] && - cbq_failure "no DEVICE field found in $1/cbq-*!" - - ### Check for different DEVICE fields for the same device - DEVICES=`echo "$DEVFIELDS"| sed 's/,.*//'| sort -u` - [ "`echo "$DEVICES"| wc -l`" -ne "`echo "$DEVFIELDS"| wc -l`" ] && - cbq_failure "different DEVICE fields for single device!\n$DEVFIELDS" -} # cbq_init - - -### Load class configuration from $1/$2 -cbq_load_class () { - CLASS=`echo $2| sed 's/^cbq-0*//; s/^\([0-9a-fA-F]\+\).*/\1/'` - CFILE=`sed -n 's/#.*//; s/[[:space:]]//g; /^[[:alnum:]_]\+=[[:alnum:].,:;/*@-_]\+$/ p' $1/$2` - - ### Check class number - IDVAL=`/usr/bin/printf "%d" 0x$CLASS 2> /dev/null` - [ $? -ne 0 -o $IDVAL -lt 2 -o $IDVAL -gt 65535 ] && - cbq_fail_off "class ID of $2 must be in range <0002-FFFF>!" - - ### Set defaults & load class - RATE=""; WEIGHT=""; PARENT=""; PRIO=5 - LEAF=tbf; BOUNDED=yes; ISOLATED=no - BUFFER=10Kb/8; LIMIT=15Kb; MTU=1500 - PEAK=""; PERTURB=10; QUANTUM="" - - PRIO_RULE=$PRIO_RULE_DEFAULT - PRIO_MARK=$PRIO_MARK_DEFAULT - PRIO_REALM=$PRIO_REALM_DEFAULT - - eval "`echo "$CFILE"| grep -E "^($CBQ_WORDS)="`" - - ### Require RATE/WEIGHT - [ -z "$RATE" -o -z "$WEIGHT" ] && - cbq_fail_off "missing RATE or WEIGHT in $2!" - - ### Class device - DEVICE=${DEVICE%%,*} - [ -z "$DEVICE" ] && cbq_fail_off "missing DEVICE field in $2!" - - BANDWIDTH=`echo "$DEVFIELDS"| sed -n "/^$DEVICE,/ \ - { s/[^,]*,\([^,]*\).*/\1/; p; q; }"` - - ### Convert to "tc" options - PEAK=${PEAK:+peakrate $PEAK} - PERTURB=${PERTURB:+perturb $PERTURB} - QUANTUM=${QUANTUM:+quantum $QUANTUM} - - [ "$BOUNDED" = "no" ] && BOUNDED="" || BOUNDED="bounded" - [ "$ISOLATED" = "yes" ] && ISOLATED="isolated" || ISOLATED="" -} # cbq_load_class - - -############################################################################# -#################################### INIT ################################### -############################################################################# - -### Check for presence of ip-route2 in usual place -[ -x $TC -a -x $IP ] || - cbq_failure "ip-route2 utilities not installed or executable!" - - -### ip/tc wrappers -if [ "$1" = "compile" ]; then - ### no module probing - CBQ_PROBE="" - - ip () { - $IP "$@" - } # ip - - ### echo-only version of "tc" command - tc () { - echo "$TC $*" - } # tc - -elif [ -n "$CBQ_DEBUG" ]; then - echo -e "# `date`" > $CBQ_DEBUG - - ### Logging version of "ip" command - ip () { - echo -e "\n# ip $*" >> $CBQ_DEBUG - $IP "$@" 2>&1 | tee -a $CBQ_DEBUG - } # ip - - ### Logging version of "tc" command - tc () { - echo -e "\n# tc $*" >> $CBQ_DEBUG - $TC "$@" 2>&1 | tee -a $CBQ_DEBUG - } # tc -else - ### Default wrappers - - ip () { - $IP "$@" - } # ip - - tc () { - $TC "$@" - } # tc -fi # ip/tc wrappers - - -case "$1" in - -############################################################################# -############################### START/COMPILE ############################### -############################################################################# - -start|compile) - -### Probe QoS modules (start only) -for module in $CBQ_PROBE; do - $MP $module || cbq_failure "failed to load module $module" -done - -### If we are in compile/nocache/logging mode, don't bother with cache -if [ "$1" != "compile" -a "$2" != "nocache" -a -z "$CBQ_DEBUG" ]; then - VALID=1 - - ### validate the cache - [ "$2" = "invalidate" -o ! -f $CBQ_CACHE ] && VALID=0 - if [ $VALID -eq 1 ]; then - [ "`find $CBQ_PATH -maxdepth 1 -newer $CBQ_CACHE| \ - wc -l`" -gt 0 ] && VALID=0 - fi - - ### compile the config if the cache is invalid - if [ $VALID -ne 1 ]; then - $0 compile > $CBQ_CACHE || - cbq_fail_off "failed to compile CBQ configuration!" - fi - - ### run the cached commands - exec /bin/sh $CBQ_CACHE 2> /dev/null -fi - -### Load DEVICES, DEVFIELDS and CLASSLIST -cbq_init $CBQ_PATH - - -### Setup root qdisc on all configured devices -for dev in $DEVICES; do - ### Retrieve device bandwidth and, optionally, weight - DEVTEMP=`echo "$DEVFIELDS"| sed -n "/^$dev,/ { s/$dev,//; p; q; }"` - DEVBWDT=${DEVTEMP%%,*}; DEVWGHT=${DEVTEMP##*,} - [ "$DEVBWDT" = "$DEVWGHT" ] && DEVWGHT="" - - ### Device bandwidth is required - if [ -z "$DEVBWDT" ]; then - cbq_message "could not determine bandwidth for device $dev!" - cbq_failure "please set up the DEVICE fields properly!" - fi - - ### Check if the device is there - ip link show $dev &> /dev/null || - cbq_fail_off "device $dev not found!" - - ### Remove old root qdisc from device - cbq_device_off $dev - - - ### Setup root qdisc + class for device - tc qdisc add dev $dev root handle 1 cbq \ - bandwidth $DEVBWDT avpkt $AVPKT cell 8 - - ### Set weight of the root class if set - [ -n "$DEVWGHT" ] && - tc class change dev $dev root cbq weight $DEVWGHT allot 1514 - - [ "$1" = "compile" ] && echo -done # dev - - -### Setup traffic classes -for classfile in $CLASSLIST; do - cbq_load_class $CBQ_PATH $classfile - - ### Create the class - tc class add dev $DEVICE parent 1:$PARENT classid 1:$CLASS cbq \ - bandwidth $BANDWIDTH rate $RATE weight $WEIGHT prio $PRIO \ - allot 1514 cell 8 maxburst 20 avpkt $AVPKT $BOUNDED $ISOLATED || - cbq_fail_off "failed to add class $CLASS with parent $PARENT on $DEVICE!" - - ### Create leaf qdisc if set - if [ "$LEAF" = "tbf" ]; then - tc qdisc add dev $DEVICE parent 1:$CLASS handle $CLASS tbf \ - rate $RATE buffer $BUFFER limit $LIMIT mtu $MTU $PEAK - elif [ "$LEAF" = "sfq" ]; then - tc qdisc add dev $DEVICE parent 1:$CLASS handle $CLASS sfq \ - $PERTURB $QUANTUM - fi - - - ### Create fw filter for MARK fields - for mark in `echo "$CFILE"| sed -n '/^MARK/ { s/.*=//; p; }'`; do - ### Attach fw filter to root class - tc filter add dev $DEVICE parent 1:0 protocol ip \ - prio $PRIO_MARK handle $mark fw classid 1:$CLASS - done ### mark - - ### Create route filter for REALM fields - for realm in `echo "$CFILE"| sed -n '/^REALM/ { s/.*=//; p; }'`; do - ### Split realm into source & destination realms - SREALM=${realm%%,*}; DREALM=${realm##*,} - [ "$SREALM" = "$DREALM" ] && SREALM="" - - ### Convert asterisks to empty strings - SREALM=${SREALM#\*}; DREALM=${DREALM#\*} - - ### Attach route filter to the root class - tc filter add dev $DEVICE parent 1:0 protocol ip \ - prio $PRIO_REALM route ${SREALM:+from $SREALM} \ - ${DREALM:+to $DREALM} classid 1:$CLASS - done ### realm - - ### Create u32 filter for RULE fields - for rule in `echo "$CFILE"| sed -n '/^RULE/ { s/.*=//; p; }'`; do - ### Split rule into source & destination - SRC=${rule%%,*}; DST=${rule##*,} - [ "$SRC" = "$rule" ] && SRC="" - - - ### Split destination into address, port & mask fields - DADDR=${DST%%:*}; DTEMP=${DST##*:} - [ "$DADDR" = "$DST" ] && DTEMP="" - - DPORT=${DTEMP%%/*}; DMASK=${DTEMP##*/} - [ "$DPORT" = "$DTEMP" ] && DMASK="0xffff" - - - ### Split up source (if specified) - SADDR=""; SPORT="" - if [ -n "$SRC" ]; then - SADDR=${SRC%%:*}; STEMP=${SRC##*:} - [ "$SADDR" = "$SRC" ] && STEMP="" - - SPORT=${STEMP%%/*}; SMASK=${STEMP##*/} - [ "$SPORT" = "$STEMP" ] && SMASK="0xffff" - fi - - - ### Convert asterisks to empty strings - SADDR=${SADDR#\*}; DADDR=${DADDR#\*} - - ### Compose u32 filter rules - u32_s="${SPORT:+match ip sport $SPORT $SMASK}" - u32_s="${SADDR:+match ip src $SADDR} $u32_s" - u32_d="${DPORT:+match ip dport $DPORT $DMASK}" - u32_d="${DADDR:+match ip dst $DADDR} $u32_d" - - ### Uncomment the following if you want to see parsed rules - #echo "$rule: $u32_s $u32_d" - - ### Attach u32 filter to the appropriate class - tc filter add dev $DEVICE parent 1:0 protocol ip \ - prio $PRIO_RULE u32 $u32_s $u32_d classid 1:$CLASS - done ### rule - - [ "$1" = "compile" ] && echo -done ### classfile -;; - - -############################################################################# -################################# TIME CHECK ################################ -############################################################################# - -timecheck) - -### Get time + weekday -TIME_TMP=`date +%w/%k:%M` -TIME_DOW=${TIME_TMP%%/*} -TIME_NOW=${TIME_TMP##*/} - -### Load DEVICES, DEVFIELDS and CLASSLIST -cbq_init $CBQ_PATH - -### Run through all classes -for classfile in $CLASSLIST; do - ### Gather all TIME rules from class config - TIMESET=`sed -n 's/#.*//; s/[[:space:]]//g; /^TIME/ { s/.*=//; p; }' \ - $CBQ_PATH/$classfile` - [ -z "$TIMESET" ] && continue - - MATCH=0; CHANGE=0 - for timerule in $TIMESET; do - TIME_ABS=`cbq_time2abs $TIME_NOW` - - ### Split TIME rule to pieces - TIMESPEC=${timerule%%;*}; PARAMS=${timerule##*;} - WEEKDAYS=${TIMESPEC%%/*}; INTERVAL=${TIMESPEC##*/} - BEG_TIME=${INTERVAL%%-*}; END_TIME=${INTERVAL##*-} - - ### Check the day-of-week (if present) - [ "$WEEKDAYS" != "$INTERVAL" -a \ - -n "${WEEKDAYS##*$TIME_DOW*}" ] && continue - - ### Compute interval boundaries - BEG_ABS=`cbq_time2abs $BEG_TIME` - END_ABS=`cbq_time2abs $END_TIME` - - ### Midnight wrap fixup - if [ $BEG_ABS -gt $END_ABS ]; then - [ $TIME_ABS -le $END_ABS ] && - TIME_ABS=$[TIME_ABS + 24*60] - - END_ABS=$[END_ABS + 24*60] - fi - - ### If the time matches, remember params and set MATCH flag - if [ $TIME_ABS -ge $BEG_ABS -a $TIME_ABS -lt $END_ABS ]; then - TMP_RATE=${PARAMS%%/*}; PARAMS=${PARAMS#*/} - TMP_WGHT=${PARAMS%%/*}; TMP_PEAK=${PARAMS##*/} - - [ "$TMP_PEAK" = "$TMP_WGHT" ] && TMP_PEAK="" - TMP_PEAK=${TMP_PEAK:+peakrate $TMP_PEAK} - - MATCH=1 - fi - done ### timerule - - - cbq_load_class $CBQ_PATH $classfile - - ### Get current RATE of CBQ class - RATE_NOW=`tc class show dev $DEVICE| sed -n \ - "/cbq 1:$CLASS / { s/.*rate //; s/ .*//; p; q; }"` - [ -z "$RATE_NOW" ] && continue - - ### Time interval matched - if [ $MATCH -ne 0 ]; then - - ### Check if there is any change in class RATE - if [ "$RATE_NOW" != "$TMP_RATE" ]; then - NEW_RATE="$TMP_RATE" - NEW_WGHT="$TMP_WGHT" - NEW_PEAK="$TMP_PEAK" - CHANGE=1 - fi - - ### Match not found, reset to default RATE if necessary - elif [ "$RATE_NOW" != "$RATE" ]; then - NEW_WGHT="$WEIGHT" - NEW_RATE="$RATE" - NEW_PEAK="$PEAK" - CHANGE=1 - fi - - ### If there are no changes, go for next class - [ $CHANGE -eq 0 ] && continue - - ### Replace CBQ class - tc class replace dev $DEVICE classid 1:$CLASS cbq \ - bandwidth $BANDWIDTH rate $NEW_RATE weight $NEW_WGHT prio $PRIO \ - allot 1514 cell 8 maxburst 20 avpkt $AVPKT $BOUNDED $ISOLATED - - ### Replace leaf qdisc (if any) - if [ "$LEAF" = "tbf" ]; then - tc qdisc replace dev $DEVICE handle $CLASS tbf \ - rate $NEW_RATE buffer $BUFFER limit $LIMIT mtu $MTU $NEW_PEAK - fi - - cbq_message "$TIME_NOW: class $CLASS on $DEVICE changed rate ($RATE_NOW -> $NEW_RATE)" -done ### class file -;; - - -############################################################################# -################################## THE REST ################################# -############################################################################# - -stop) - cbq_off - ;; - -list) - cbq_show - ;; - -stats) - cbq_show -s - ;; - -restart) - shift - $0 stop - $0 start "$@" - ;; - -*) - echo "Usage: `basename $0` {start|compile|stop|restart|timecheck|list|stats}" -esac