| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: net_common.sh,v 1.13 2017/03/03 07:34:04 ozaki-r Exp $ | | 1 | # $NetBSD: net_common.sh,v 1.14 2017/03/06 07:15:47 ozaki-r Exp $ |
2 | # | | 2 | # |
3 | # Copyright (c) 2016 Internet Initiative Japan Inc. | | 3 | # Copyright (c) 2016 Internet Initiative Japan Inc. |
4 | # All rights reserved. | | 4 | # All rights reserved. |
5 | # | | 5 | # |
6 | # Redistribution and use in source and binary forms, with or without | | 6 | # Redistribution and use in source and binary forms, with or without |
7 | # modification, are permitted provided that the following conditions | | 7 | # modification, are permitted provided that the following conditions |
8 | # are met: | | 8 | # are met: |
9 | # 1. Redistributions of source code must retain the above copyright | | 9 | # 1. Redistributions of source code must retain the above copyright |
10 | # notice, this list of conditions and the following disclaimer. | | 10 | # notice, this list of conditions and the following disclaimer. |
11 | # 2. Redistributions in binary form must reproduce the above copyright | | 11 | # 2. Redistributions in binary form must reproduce the above copyright |
12 | # notice, this list of conditions and the following disclaimer in the | | 12 | # notice, this list of conditions and the following disclaimer in the |
13 | # documentation and/or other materials provided with the distribution. | | 13 | # documentation and/or other materials provided with the distribution. |
14 | # | | 14 | # |
| @@ -21,27 +21,27 @@ | | | @@ -21,27 +21,27 @@ |
21 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 21 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
22 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 22 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
23 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 23 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
24 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 24 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
25 | # POSSIBILITY OF SUCH DAMAGE. | | 25 | # POSSIBILITY OF SUCH DAMAGE. |
26 | # | | 26 | # |
27 | | | 27 | |
28 | # | | 28 | # |
29 | # Common utility functions for tests/net | | 29 | # Common utility functions for tests/net |
30 | # | | 30 | # |
31 | | | 31 | |
32 | HIJACKING="env LD_PRELOAD=/usr/lib/librumphijack.so \ | | 32 | HIJACKING="env LD_PRELOAD=/usr/lib/librumphijack.so \ |
33 | RUMPHIJACK=path=/rump,socket=all:nolocal,sysctl=yes" | | 33 | RUMPHIJACK=path=/rump,socket=all:nolocal,sysctl=yes" |
34 | ONEDAYISH="(23h5[0-9]m|1d0h0m)[0-9]+s" | | 34 | ONEDAYISH="(23h5[0-9]m|1d0h0m)[0-9]+s ?" |
35 | | | 35 | |
36 | extract_new_packets() | | 36 | extract_new_packets() |
37 | { | | 37 | { |
38 | local bus=$1 | | 38 | local bus=$1 |
39 | local old=./.__old | | 39 | local old=./.__old |
40 | | | 40 | |
41 | if [ ! -f $old ]; then | | 41 | if [ ! -f $old ]; then |
42 | old=/dev/null | | 42 | old=/dev/null |
43 | fi | | 43 | fi |
44 | | | 44 | |
45 | shmif_dumpbus -p - $bus 2>/dev/null| \ | | 45 | shmif_dumpbus -p - $bus 2>/dev/null| \ |
46 | tcpdump -n -e -r - 2>/dev/null > ./.__new | | 46 | tcpdump -n -e -r - 2>/dev/null > ./.__new |
47 | diff -u $old ./.__new |grep '^+' |cut -d '+' -f 2 > ./.__diff | | 47 | diff -u $old ./.__new |grep '^+' |cut -d '+' -f 2 > ./.__diff |