⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lect08-bb.ppt

📁 unix/linux 编程实践一书的所有源代码
💻 PPT
📖 第 1 页 / 共 5 页
字号:
    print "ipsec spi --saref --af inet --edst $edst --spi $spi --proto $proto --del\n";          if($sanum != $saCount-1) {      # delete it, by copying one from end.      $edst[$sanum]=$edst[$saCount-1];      $spi[$sanum]=$spi[$saCount-1];    }    $saCount--;  } else {    # make a new one.    $choice=int(rand(100));    $edst=$edst_choices[$choice];    $spi="0x".(int(rand(16777216))+1024);    #print "alloc $edst $spi $proto $src\n";    print "ipsec spi --saref --af inet --edst $edst --spi $spi --proto $proto --src $src --esp $algo --enckey $enckey --authkey $authkey\n";    $edst[$saCount]=$edst;    $spi[$saCount]=$spi;    $saCount++;  }  if($maxSa < $saCount) {  	$maxSa = $saCount;  }  print "echo saCount=$saCount $maxSa\n";}print "# maxSa = $maxSa\n";sub init_stuff {  # make up 100 random edst's  for($i=0; $i<100; $i++) {    $a=int(rand(256)); $b=int(rand(256)); $c=int(rand(256)); $d=int(rand(256));    $edst_choices[$i]="$a.$b.$c.$d";  }}uClinux-dist/openswan/testing/klips/saref-alloc-01/alloc_dealloc.sh0000664000076400007640000000265310212740376025532 0ustar  gerggerg00000000000000#!/bin/sh# This script allocates a number of SPIs, then deallocates them in a # different order. It is driven by an input file which contains some# generated SPI data.def_enckey=0x4043434545464649494a4a4c4c4f4f515152525454575758def_authkey=0x87658765876587658765876587658765# input file is in the format:#   {alloc,free}  edst spi proto src algo enckey authkey## if algo="", then algo="3des-md5-96"# if enckey="", then enckey=above, ditto for authkey.# keys are not relevant for dealloc.## note, proto must be = esp at present.# the goal is to make something like:n# ipsec spi --saref --af inet --edst 192.1.2.45 --spi 0x12345678 --proto esp --src 192.1.2.23 --esp 3des-md5-96 --enckey $enckey --authkey $authkey### ROOT is "" in the UML testing environment, and /testing is mounted.line=0cat $ROOT/testing/klips/saref-alloc-01/allocfile1.txt | while read op edst spi proto src algo enckey authkeydo    # set up defaults    if [ -z "$algo" ]; then algo="3des-md5-96"; fi    if [ -z "$enckey" ]; then enckey=$def_enckey;  fi    if [ -z "$authkey"]; then authkey=$def_authkey; fi    line=`expr $line + 1`    #echo Input Line: $line    case $op in    \#*) ;;    alloc) echo ipsec spi --saref --af inet --edst $edst --spi $spi --proto $proto --src $src --esp $algo --enckey $enckey --authkey $authkey;;    free)  echo ipsec spi --saref --af inet --edst $edst --spi $spi --proto $proto --del;;    esacdone    uClinux-dist/openswan/testing/klips/saref-alloc-01/testparams.sh0000664000076400007640000000125710212740376025137 0ustar  gerggerg00000000000000#!/bin/shTEST_PURPOSE=regressTEST_PROB_REPORT=0TEST_TYPE=ctltestTESTNAME=saref-alloc-01TESTHOST=eastREFCONSOLEOUTPUT=saref-console.txtREF_CONSOLE_FIXUPS="kern-list-fixups.sed nocr.sed"REF_CONSOLE_FIXUPS="$REF_CONSOLE_FIXUPS klips-spi-sanitize.sed"REF_CONSOLE_FIXUPS="$REF_CONSOLE_FIXUPS ipsec-look-sanitize.sed"REF_CONSOLE_FIXUPS="$REF_CONSOLE_FIXUPS east-prompt-splitline.pl"REF_CONSOLE_FIXUPS="$REF_CONSOLE_FIXUPS klips-debug-sanitize.sed"REF_CONSOLE_FIXUPS="$REF_CONSOLE_FIXUPS pfkey-sanitize.sed"INIT_SCRIPT=alloctest3.sh# do not store this in CVS, but generate it the first time.if [ ! -f alloctest2.sh ]then    perl genallocfile.pl >alloctest2.shfiuClinux-dist/openswan/testing/klips/saref-alloc-01/alloctest1.sh0000664000076400007640000000027310212740376025024 0ustar  gerggerg00000000000000#!/bin/shTZ=GMT export TZipsec spi --clearipsec eroute --clear#ipsec klipsdebug --set pfkeyROOT= export ROOTsh $ROOT/testing/klips/saref-alloc-01/alloc_dealloc.sh#ipsec lookuClinux-dist/openswan/testing/klips/saref-alloc-01/alloctest3.sh0000664000076400007640000000027010212740376025023 0ustar  gerggerg00000000000000#!/bin/shTZ=GMT export TZipsec spi --clearipsec eroute --clear#ipsec klipsdebug --set pfkeyROOT= export ROOTsh $ROOT/testing/klips/saref-alloc-01/alloctest2.sh#ipsec lookuClinux-dist/openswan/testing/klips/saref-alloc-01/allocfile1.txt0000664000076400007640000132457310212740376025206 0ustar  gerggerg00000000000000alloc 30.122.14.231 0x3989876 esp 192.1.2.23free 30.122.14.231 0x3989876 esp 192.1.2.23alloc 250.128.167.40 0x7078247 esp 192.1.2.23free 250.128.167.40 0x7078247 esp 192.1.2.23alloc 76.30.241.132 0x2578363 esp 192.1.2.23alloc 117.30.250.38 0x3147647 esp 192.1.2.23free 76.30.241.132 0x2578363 esp 192.1.2.23alloc 16.125.20.100 0x5871399 esp 192.1.2.23alloc 244.130.69.6 0x12063530 esp 192.1.2.23alloc 221.166.143.219 0x9083808 esp 192.1.2.23alloc 156.96.102.246 0x928066 esp 192.1.2.23alloc 190.3.105.114 0x3624918 esp 192.1.2.23alloc 137.41.189.19 0x15420208 esp 192.1.2.23alloc 149.255.75.187 0x1754290 esp 192.1.2.23alloc 32.97.52.61 0x5686174 esp 192.1.2.23alloc 69.42.155.116 0x12595525 esp 192.1.2.23free 149.255.75.187 0x1754290 esp 192.1.2.23alloc 36.172.219.191 0x325937 esp 192.1.2.23alloc 69.42.155.116 0x10975273 esp 192.1.2.23alloc 161.40.222.160 0x1532065 esp 192.1.2.23free 117.30.250.38 0x3147647 esp 192.1.2.23alloc 51.77.15.243 0x11509978 esp 192.1.2.23alloc 156.96.102.246 0x6501032 esp 192.1.2.23alloc 124.3.224.231 0x10215168 esp 192.1.2.23alloc 2.244.240.219 0x8989932 esp 192.1.2.23free 2.244.240.219 0x8989932 esp 192.1.2.23alloc 202.247.168.30 0x12924000 esp 192.1.2.23free 221.166.143.219 0x9083808 esp 192.1.2.23alloc 104.129.201.18 0x15247366 esp 192.1.2.23alloc 26.119.129.27 0x7161372 esp 192.1.2.23free 36.172.219.191 0x325937 esp 192.1.2.23alloc 190.115.174.9 0x13335699 esp 192.1.2.23free 190.115.174.9 0x13335699 esp 192.1.2.23alloc 100.15.147.116 0x10850873 esp 192.1.2.23alloc 179.223.238.117 0x10783429 esp 192.1.2.23free 244.130.69.6 0x12063530 esp 192.1.2.23alloc 189.208.141.133 0x7783879 esp 192.1.2.23free 161.40.222.160 0x1532065 esp 192.1.2.23free 202.247.168.30 0x12924000 esp 192.1.2.23alloc 46.68.81.205 0x15678528 esp 192.1.2.23alloc 31.242.19.35 0x2386608 esp 192.1.2.23free 69.42.155.116 0x10975273 esp 192.1.2.23alloc 151.191.21.199 0x6147107 esp 192.1.2.23alloc 250.128.167.40 0x2196727 esp 192.1.2.23alloc 214.18.73.0 0x2777382 esp 192.1.2.23alloc 132.18.101.63 0x15412452 esp 192.1.2.23alloc 54.19.145.213 0x7184049 esp 192.1.2.23alloc 221.166.143.219 0x7809041 esp 192.1.2.23free 137.41.189.19 0x15420208 esp 192.1.2.23alloc 100.15.147.116 0x2651605 esp 192.1.2.23alloc 47.150.146.91 0x13473321 esp 192.1.2.23alloc 78.190.114.37 0x16618287 esp 192.1.2.23alloc 18.143.218.125 0x5636112 esp 192.1.2.23alloc 18.143.218.125 0x14950411 esp 192.1.2.23alloc 47.150.146.91 0x10837747 esp 192.1.2.23

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -