xref: /aosp_15_r20/external/ltp/testcases/lib/net_cmdlib.sh (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1*49cdfc7eSAndroid Build Coastguard Worker#!/bin/sh
2*49cdfc7eSAndroid Build Coastguard Worker#
3*49cdfc7eSAndroid Build Coastguard Worker#    An extension to cmdlib.sh, purely for networking based commands.
4*49cdfc7eSAndroid Build Coastguard Worker#
5*49cdfc7eSAndroid Build Coastguard Worker#    Copyright (C) 2009, Cisco Systems Inc.
6*49cdfc7eSAndroid Build Coastguard Worker#
7*49cdfc7eSAndroid Build Coastguard Worker#    This program is free software; you can redistribute it and/or modify
8*49cdfc7eSAndroid Build Coastguard Worker#    it under the terms of the GNU General Public License as published by
9*49cdfc7eSAndroid Build Coastguard Worker#    the Free Software Foundation; either version 2 of the License, or
10*49cdfc7eSAndroid Build Coastguard Worker#    (at your option) any later version.
11*49cdfc7eSAndroid Build Coastguard Worker#
12*49cdfc7eSAndroid Build Coastguard Worker#    This program is distributed in the hope that it will be useful,
13*49cdfc7eSAndroid Build Coastguard Worker#    but WITHOUT ANY WARRANTY; without even the implied warranty of
14*49cdfc7eSAndroid Build Coastguard Worker#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15*49cdfc7eSAndroid Build Coastguard Worker#    GNU General Public License for more details.
16*49cdfc7eSAndroid Build Coastguard Worker#
17*49cdfc7eSAndroid Build Coastguard Worker#    You should have received a copy of the GNU General Public License along
18*49cdfc7eSAndroid Build Coastguard Worker#    with this program; if not, write to the Free Software Foundation, Inc.,
19*49cdfc7eSAndroid Build Coastguard Worker#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20*49cdfc7eSAndroid Build Coastguard Worker#
21*49cdfc7eSAndroid Build Coastguard Worker# Ngie Cooper, August 2009
22*49cdfc7eSAndroid Build Coastguard Worker#
23*49cdfc7eSAndroid Build Coastguard Worker
24*49cdfc7eSAndroid Build Coastguard Worker. cmdlib.sh
25*49cdfc7eSAndroid Build Coastguard Worker
26*49cdfc7eSAndroid Build Coastguard Worker# Blank for an IPV4 test; 6 for an IPV6 test.
27*49cdfc7eSAndroid Build Coastguard WorkerEXEC_SUFFIX=
28*49cdfc7eSAndroid Build Coastguard Worker
29*49cdfc7eSAndroid Build Coastguard Workerread_opts()
30*49cdfc7eSAndroid Build Coastguard Worker{
31*49cdfc7eSAndroid Build Coastguard Worker    while getopts "6" opt; do
32*49cdfc7eSAndroid Build Coastguard Worker        case "$opt" in
33*49cdfc7eSAndroid Build Coastguard Worker        6)
34*49cdfc7eSAndroid Build Coastguard Worker            EXEC_SUFFIX=6;;
35*49cdfc7eSAndroid Build Coastguard Worker        *)
36*49cdfc7eSAndroid Build Coastguard Worker            echo "Setup  0  : FAIL Unknown option: $opt"
37*49cdfc7eSAndroid Build Coastguard Worker            exit 1;;
38*49cdfc7eSAndroid Build Coastguard Worker        esac
39*49cdfc7eSAndroid Build Coastguard Worker    done
40*49cdfc7eSAndroid Build Coastguard Worker}
41