1#!/bin/sh 2# 3# 4# Copyright (c) 2010 Apple Inc. All rights reserved. 5# 6# @APPLE_LICENSE_HEADER_START@ 7# 8# Redistribution and use in source and binary forms, with or without 9# modification, are permitted provided that the following conditions 10# are met: 11# 12# 1. Redistributions of source code must retain the above copyright 13# notice, this list of conditions and the following disclaimer. 14# 2. Redistributions in binary form must reproduce the above copyright 15# notice, this list of conditions and the following disclaimer in the 16# documentation and/or other materials provided with the distribution. 17# 3. Neither the name of Apple Inc. ("Apple") nor the names of its 18# contributors may be used to endorse or promote products derived from 19# this software without specific prior written permission. 20# 21# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY 22# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 25# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31# 32# Portions of this software have been released under the following terms: 33# 34# (c) Copyright 1989-1993 OPEN SOFTWARE FOUNDATION, INC. 35# (c) Copyright 1989-1993 HEWLETT-PACKARD COMPANY 36# (c) Copyright 1989-1993 DIGITAL EQUIPMENT CORPORATION 37# 38# To anyone who acknowledges that this file is provided "AS IS" 39# without any express or implied warranty: 40# permission to use, copy, modify, and distribute this file for any 41# purpose is hereby granted without fee, provided that the above 42# copyright notices and this notice appears in all source code copies, 43# and that none of the names of Open Software Foundation, Inc., Hewlett- 44# Packard Company or Digital Equipment Corporation be used 45# in advertising or publicity pertaining to distribution of the software 46# without specific, written prior permission. Neither Open Software 47# Foundation, Inc., Hewlett-Packard Company nor Digital 48# Equipment Corporation makes any representations about the suitability 49# of this software for any purpose. 50# 51# Copyright (c) 2007, Novell, Inc. All rights reserved. 52# Redistribution and use in source and binary forms, with or without 53# modification, are permitted provided that the following conditions 54# are met: 55# 56# 1. Redistributions of source code must retain the above copyright 57# notice, this list of conditions and the following disclaimer. 58# 2. Redistributions in binary form must reproduce the above copyright 59# notice, this list of conditions and the following disclaimer in the 60# documentation and/or other materials provided with the distribution. 61# 3. Neither the name of Novell Inc. nor the names of its contributors 62# may be used to endorse or promote products derived from this 63# this software without specific prior written permission. 64# 65# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 66# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 67# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 68# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY 69# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 70# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 71# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 72# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 73# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 74# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 75# 76# @APPLE_LICENSE_HEADER_END@ 77# 78# 79 80case $# in 812) ;; 82*) echo 'Usage: perf_udp.sh server_host_name client_program_directory' 1>&2 ; exit 1;; 83esac 84 85cd $2 86##IP=`host $1 | awk '{print $3}'` 87# Use the dce getip program, and if that doesn't work, try the 88# basic approach of greping /etc/hosts. This combination 89# should cover most any platform. 90if [ -x /opt/dcelocal/bin/getip ]; then 91 IP=`getip $1` 92else 93 IP=`grep $1 /etc/hosts | awk '{print $1}'` 94fi 95 96echo "client 0a" 97client 0 "ncadg_ip_udp:${IP}[2001]" 3 40 y y 98echo "client 0b" 99client 0 "ncadg_ip_udp:${IP}[2001]" 3 40 y n 100echo "client 0c" 101client 0 "ncadg_ip_udp:${IP}[2001]" 3 40 n y 102echo "client 0d" 103client 0 "ncadg_ip_udp:${IP}[2001]" 3 40 n n 104echo "client 1a" 105client 1 "ncadg_ip_udp:${IP}[2001]" 3 40 y y 400 106echo "client 1b" 107client 1 "ncadg_ip_udp:${IP}[2001]" 3 40 y n 400 108echo "client 1c" 109client 1 "ncadg_ip_udp:${IP}[2001]" 3 10 y y 4000 110echo "client 1d" 111client 1 "ncadg_ip_udp:${IP}[2001]" 3 10 y n 4000 112echo "client 1e" 113client 1 "ncadg_ip_udp:${IP}[2001]" 3 2 y y 100000 114echo "client 1f" 115client 1 "ncadg_ip_udp:${IP}[2001]" 3 2 y n 100000 116echo "client 2a" 117client 2 "ncadg_ip_udp:${IP}[2001]" 3 100 y y 400 118echo "client 2b" 119client 2 "ncadg_ip_udp:${IP}[2001]" 3 100 y n 400 120echo "client 2c" 121client 2 "ncadg_ip_udp:${IP}[2001]" 3 10 y y 4000 122echo "client 2d" 123client 2 "ncadg_ip_udp:${IP}[2001]" 3 10 y n 4000 124echo "client 2e" 125client 2 "ncadg_ip_udp:${IP}[2001]" 3 2 y y 100000 126echo "client 2f" 127client 2 "ncadg_ip_udp:${IP}[2001]" 3 2 y n 100000 128echo "client 3" 129client 3 "ncadg_ip_udp" 130echo "client 4" 131client 4 "ncadg_ip_udp:${IP}[2001]" 3 2 132echo "client 5" 133client 5 "ncadg_ip_udp" 134echo "client 6a" 135client 6 "ncadg_ip_udp:${IP}[2001]" 3 100 y y 136echo "client 6b" 137client 6 "ncadg_ip_udp:${IP}[2001]" 3 100 y n 138#echo "client 8" 139#client 8 "ncadg_ip_udp:${IP}[2001]" y 140echo "client 7" 141client 7 "ncadg_ip_udp:${IP}[2001]" 142echo "client 9" 143client 9 "ncadg_ip_udp:${IP}[2001]" 144echo "client 10a" 145client 10 "ncadg_ip_udp:${IP}[2001]" 4 3 y y 2 146echo "client 10b" 147client 10 "ncadg_ip_udp:${IP}[2001]" 2 3 y n 2 148echo "client 10c" 149client 10 "ncadg_ip_udp:${IP}[2001]" 4 3 y y 2 1 150echo "client 10d" 151client 10 "ncadg_ip_udp:${IP}[2001]" 2 3 y n 2 1 152echo "client 10e" 153client 10 "ncadg_ip_udp:${IP}[2001]" 4 3 y y 2 2 154echo "client 10f" 155client 10 "ncadg_ip_udp:${IP}[2001]" 2 3 y n 2 2 156echo "client 12a" 157client 12 "ncadg_ip_udp:${IP}[2001]" 2 10 y 158echo "client 12b" 159client 12 "ncadg_ip_udp:${IP}[2001]" 2 10 n 160echo "client 13" 161client 13 "ncadg_ip_udp:${IP}[2001]" 162echo "client 14a" 163client 14 "ncadg_ip_udp:${IP}[2001]" 4 n 1 164echo "client 14b" 165client 14 "ncadg_ip_udp:${IP}[2001]" 4 y 1 166echo "client 15a" 167client 15 "ncadg_ip_udp:${IP}[2001]" 2 y 1 168echo "client 15b" 169client 15 "ncadg_ip_udp:${IP}[2001]" 2 n 1 170echo "client 15c" 171client 15 "ncadg_ip_udp:${IP}[2001]" 2 y 1 5 172echo "client 15d" 173client 15 "ncadg_ip_udp:${IP}[2001]" 2 n 1 5 174