0
|
1 |
#
|
|
2 |
# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
# All rights reserved.
|
|
4 |
# This component and the accompanying materials are made available
|
|
5 |
# under the terms of "Eclipse Public License v1.0"
|
|
6 |
# which accompanies this distribution, and is available
|
|
7 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
#
|
|
9 |
# Initial Contributors:
|
|
10 |
# Nokia Corporation - initial contribution.
|
|
11 |
#
|
|
12 |
# Contributors:
|
|
13 |
#
|
|
14 |
# Description:
|
|
15 |
#
|
|
16 |
|
|
17 |
#######################################################################################
|
|
18 |
#
|
|
19 |
# USE-CASE-1 : Configure the QoS of a Linux-to-Linux PPP channel
|
|
20 |
#
|
|
21 |
#######################################################################################
|
|
22 |
|
|
23 |
#######################################################################################
|
|
24 |
#
|
|
25 |
# Start the services
|
|
26 |
#
|
|
27 |
#######################################################################################
|
|
28 |
runcmd svcid=5 svchost="penmn" methodid=1 PORT=7000
|
|
29 |
check RESULT=0
|
|
30 |
runcmd svcid=7 svchost="penmn" methodid=1
|
|
31 |
check RESULT=0
|
|
32 |
runcmd svcid=8 svchost="penmn" methodid=1
|
|
33 |
check RESULT=0
|
|
34 |
runcmd svcid=10 svchost="penmn" methodid=1
|
|
35 |
check RESULT=0
|
|
36 |
runcmd svcid=5 svchost="penpdsn" methodid=1 PORT=7000
|
|
37 |
check RESULT=0
|
|
38 |
runcmd svcid=7 svchost="penpdsn" methodid=1
|
|
39 |
check RESULT=0
|
|
40 |
runcmd svcid=6 svchost="penuu" methodid=1
|
|
41 |
check RESULT=0
|
|
42 |
|
|
43 |
|
|
44 |
#######################################################################################
|
|
45 |
#
|
|
46 |
# Create two MTs and make them talk to each other
|
|
47 |
#
|
|
48 |
#######################################################################################
|
|
49 |
runcmd svcid=5 svchost="penmn" methodid=3 DATALINKCONFIG=1 FILTERCONFIG=0
|
|
50 |
assign dev0=RESULT
|
|
51 |
runcmd svcid=5 svchost="penpdsn" methodid=3 DATALINKCONFIG=1 FILTERCONFIG=0
|
|
52 |
assign dev1=RESULT
|
|
53 |
runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
|
|
54 |
|
|
55 |
runcmd svcid=5 svchost="penmn" methodid=4 DEVICEID=dev0
|
|
56 |
assign local_uu_port0=AIR_INPORT
|
|
57 |
runcmd svcid=5 svchost="penpdsn" methodid=4 DEVICEID=dev1
|
|
58 |
assign local_uu_port1=AIR_INPORT
|
|
59 |
|
|
60 |
runcmd svcid=5 svchost="penmn" methodid=10 DEVICEID=dev0 REMOTE_ADDRESS="192.168.10.11" REMOTE_PORT=local_uu_port1
|
|
61 |
runcmd svcid=5 svchost="penpdsn" methodid=10 DEVICEID=dev1 REMOTE_ADDRESS="192.168.14.10" REMOTE_PORT=local_uu_port0
|
|
62 |
|
|
63 |
|
|
64 |
#######################################################################################
|
|
65 |
#
|
|
66 |
# Create two PPP sessions and wait for them to connect to one another
|
|
67 |
#
|
|
68 |
#######################################################################################
|
|
69 |
runcmd svcid=7 svchost="penmn" methodid=31 MADDR="localhost" MPORT=7000 MTID=dev0 CONFIG="defaultroute noauth debug nodetach noaccomp nobsdcomp nodeflate novjccomp"
|
|
70 |
assign sid0=RESULT
|
|
71 |
runcmd svcid=7 svchost="penpdsn" methodid=31 MADDR="localhost" MPORT=7000 MTID=dev1 CONFIG="noauth 192.168.200.20:192.168.200.10 debug nodetach noaccomp nobsdcomp nodeflate novjccomp"
|
|
72 |
assign sid1=RESULT
|
|
73 |
runcmd svcid=7 svchost="penmn" methodid=7 SID=sid0
|
|
74 |
waitfor SESSION_STATUS=2
|
|
75 |
runcmd svcid=7 svchost="penpdsn" methodid=7 SID=sid1
|
|
76 |
waitfor SESSION_STATUS=2
|
|
77 |
|
|
78 |
|
|
79 |
#######################################################################################
|
|
80 |
#
|
|
81 |
# Set the drop percentage and capture a few ping commands - you can use the
|
|
82 |
# icmp seq no to see how many were lost
|
|
83 |
#
|
|
84 |
#######################################################################################
|
|
85 |
runcmd svcid=6 svchost="penuu" methodid=4 SRC="192.168.14.10" SRCPORT=local_uu_port0 DST="192.168.10.11" DSTPORT=local_uu_port1 DROPI=20 PROTOCOL="UDP"
|
|
86 |
runcmd svcid=9 svchost="localhost" methodid=4 MSG="The drop rate of the PPP channel has been set to 20%. You can see the effect of this using the ICMP sequence numbers in the ping output below."
|
|
87 |
runcmd svcid=8 svchost="penmn" methodid=3 COMMAND="ping -c 10 192.168.12.11" TIMEOUT=-1 GETSTDOUT=1 GETSTDERR=1
|
|
88 |
runcmd svcid=8 svchost="penmn" methodid=3 COMMAND="ping -c 10 192.168.12.11" TIMEOUT=-1 GETSTDOUT=1 GETSTDERR=1
|
|
89 |
|
|
90 |
|
|
91 |
#######################################################################################
|
|
92 |
#
|
|
93 |
# Now give the user a turn to play
|
|
94 |
#
|
|
95 |
#######################################################################################
|
|
96 |
signal
|
|
97 |
waitforsignal
|
|
98 |
runcmd svcid=6 svchost="penuu" methodid=4 SRC="192.168.14.10" SRCPORT=local_uu_port0 DST="192.168.10.11" DSTPORT=local_uu_port1 DROPI=0 PROTOCOL="UDP"
|
|
99 |
|
|
100 |
|
|
101 |
#######################################################################################
|
|
102 |
#
|
|
103 |
# Set the delay percentage and play
|
|
104 |
#
|
|
105 |
#######################################################################################
|
|
106 |
runcmd svcid=6 svchost="penuu" methodid=3 SRC="192.168.14.10" SRCPORT=local_uu_port0 DST="192.168.10.11" DSTPORT=local_uu_port1 DELAYI=150 PROTOCOL="UDP"
|
|
107 |
runcmd svcid=9 svchost="localhost" methodid=4 MSG="The delay of the PPP channel has been set to 150ms. You can see the effect of this using the ICMP sequence numbers in the ping output below."
|
|
108 |
runcmd svcid=10 svchost="penmn" methodid=31 CMD="ping 192.168.12.11"
|
|
109 |
assign pid0=RESULT
|
|
110 |
runcmd svcid=10 svchost="penmn" methodid=8 PID=pid0
|
|
111 |
runcmd svcid=9 svchost="localhost" methodid=1 PERIOD=2000
|
|
112 |
runcmd svcid=10 svchost="penmn" methodid=8 PID=pid0
|
|
113 |
runcmd svcid=10 svchost="penmn" methodid=5 PID=pid0
|
|
114 |
runcmd svcid=10 svchost="penmn" methodid=32 PID=pid0
|
|
115 |
runcmd svcid=6 svchost="penuu" methodid=3 SRC="192.168.14.10" SRCPORT=local_uu_port0 DST="192.168.10.11" DSTPORT=local_uu_port1 DELAYI=0 PROTOCOL="UDP"
|
|
116 |
|
|
117 |
|
|
118 |
#######################################################################################
|
|
119 |
#
|
|
120 |
# STOP the first ppp peer and then wait for the other end to terminate gracefully.
|
|
121 |
#
|
|
122 |
#######################################################################################
|
|
123 |
runcmd svcid=7 svchost="penmn" methodid=6 SID=sid0
|
|
124 |
check RESULT=0
|
|
125 |
runcmd svcid=7 svchost="penmn" methodid=8 SID=sid0
|
|
126 |
runcmd svcid=7 svchost="penmn" methodid=32 SID=sid0
|
|
127 |
check RESULT=0
|
|
128 |
runcmd svcid=7 svchost="penpdsn" methodid=7 SID=sid1
|
|
129 |
waitfor SESSION_PROCESS_STATUS=3
|
|
130 |
check RESULT=0
|
|
131 |
check SESSION_STATUS=4
|
|
132 |
runcmd svcid=7 svchost="penpdsn" methodid=8 SID=sid1
|
|
133 |
runcmd svcid=7 svchost="penpdsn" methodid=32 SID=sid1
|
|
134 |
check RESULT=0
|
|
135 |
|
|
136 |
|
|
137 |
#######################################################################################
|
|
138 |
#
|
|
139 |
# Remove the mobster devices, they should already have stopped
|
|
140 |
#
|
|
141 |
#######################################################################################
|
|
142 |
runcmd svcid=5 svchost="penmn" methodid=6 DEVICEID=dev0
|
|
143 |
check RESULT=0
|
|
144 |
runcmd svcid=5 svchost="penmn" methodid=7 DEVICEID=dev0
|
|
145 |
check RESULT=0
|
|
146 |
runcmd svcid=5 svchost="penpdsn" methodid=6 DEVICEID=dev1
|
|
147 |
check RESULT=0
|
|
148 |
runcmd svcid=5 svchost="penpdsn" methodid=7 DEVICEID=dev1
|
|
149 |
check RESULT=0
|
|
150 |
|
|
151 |
|
|
152 |
#######################################################################################
|
|
153 |
#
|
|
154 |
# Stop all the services
|
|
155 |
#
|
|
156 |
#######################################################################################
|
|
157 |
runcmd svcid=10 svchost="penmn" methodid=2 FORCE=0
|
|
158 |
check RESULT=0
|
|
159 |
runcmd svcid=8 svchost="penmn" methodid=2 FORCE=0
|
|
160 |
check RESULT=0
|
|
161 |
runcmd svcid=7 svchost="penmn" methodid=2 FORCE=0
|
|
162 |
check RESULT=0
|
|
163 |
runcmd svcid=5 svchost="penmn" methodid=2 FORCE=0
|
|
164 |
check RESULT=0
|
|
165 |
runcmd svcid=7 svchost="penpdsn" methodid=2 FORCE=0
|
|
166 |
check RESULT=0
|
|
167 |
runcmd svcid=5 svchost="penpdsn" methodid=2 FORCE=0
|
|
168 |
check RESULT=0
|
|
169 |
runcmd svcid=6 svchost="penuu" methodid=2
|
|
170 |
check RESULT=0
|
|
171 |
|
|
172 |
|
|
173 |
#######################################################################################
|
|
174 |
#
|
|
175 |
# Done
|
|
176 |
#
|
|
177 |
#######################################################################################
|
|
178 |
rendezvous
|