Check-in [8f671ec548]
Overview
SHA1:8f671ec548d63755846863d16f8fb56860e9ecd6
Date: 2014-01-25 06:27:03
User: rkeene
Comment:Updated to name service we create "npf", which is what winpcap expects to find and creates if not present
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2014-01-25
06:40
[eda3d468e1] Cleaned up (user: rkeene, tags: trunk)
06:27
[8f671ec548] Updated to name service we create "npf", which is what winpcap expects to find and creates if not present (user: rkeene, tags: trunk)
05:17
[b69c1be66d] Added checksum verification for downloads (user: rkeene, tags: trunk)
Changes

Modified main.tcl from [3ddbc51628] to [836be22022].

    34     34   } else {
    35     35   	if {$tcl_platform(platform) == "windows"} {
    36     36   		set tmpdir {C:/TEMP}
    37     37   	} else {
    38     38   		set tmpdir /tmp
    39     39   	}
    40     40   }
    41         -set tmpdir "C:/TEMP"
    42     41   
    43     42   # Determine interface to lookup
    44     43   set dest_parm_idx [lsearch -exact $argv "-i"]
    45     44   if {$dest_parm_idx != -1} {
    46     45   	incr dest_parm_idx
    47     46   
    48     47   	set dest_chk [lindex $argv $dest_parm_idx]
................................................................................
    79     78   
    80     79   # Run tcpdump
    81     80   set exit 1
    82     81   set start_npf_service 0
    83     82   set npf_failed 0
    84     83   if {[catch {
    85     84   	set filesdir [file join $dstdir files]
           85  +	file mkdir $dstdir
    86     86   
    87         -	exec cmd /c mkdir [file nativename $dstdir]
    88         -	exec cmd /c mkdir [file nativename $filesdir]
    89         -
    90         -	file copy -- {*}[glob -directory $srcdir *] $filesdir
           87  +	file copy -- $srcdir $filesdir
    91     88   
    92     89   	## Delete extraneous service
    93         -	if {[::twapi::service_exists npf]} {
    94         -		if {![catch {
    95         -			::twapi::stop_service npf
    96         -		}]} {
    97         -			set start_npf_service 1
    98         -		}
           90  +	catch {
           91  +		::twapi::stop_service npf
    99     92   	}
   100     93   
   101     94   	catch {
   102         -		::twapi::stop_service npf_tcpdump
   103         -	}
   104         -
   105         -	catch {
   106         -		::twapi::delete_service npf_tcpdump
           95  +		::twapi::delete_service npf
   107     96   	}
   108     97   
   109     98   	## Install driver and start service
   110     99   	if {[catch {
   111    100   		set driver [file join $filesdir npf${bits}.sys]
   112    101   		set driver [file nativename $driver]
   113         -		::twapi::create_service npf_tcpdump $driver -displayname "NPF for TCPDUMP (ignore)" -servicetype kernel_driver -starttype demand_start -errorcontrol ignore
          102  +		::twapi::create_service npf $driver -displayname "WinPcap Packet Driver (NPF)" -servicetype kernel_driver -starttype demand_start -errorcontrol ignore
   114    103   
   115         -puts [exec net start npf_tcpdump]
   116         -		::twapi::start_service npf_tcpdump
   117         -puts [exec net start npf_tcpdump]
          104  +		set started [::twapi::start_service npf -wait 60000]
          105  +		if {!$started} {
          106  +			error "npf did not start"
          107  +		}
   118    108   	} npf_err]} {
   119    109   		set npf_failed 1
   120    110   	}
   121    111   
   122    112   	after 5000
   123    113   
   124    114   	## Launch tcpdump with the apropriate parameters
................................................................................
   132    122   	}
   133    123   
   134    124   	puts "Failed: $::errorInfo"
   135    125   
   136    126   	set exit 1
   137    127   }
   138    128   
   139         -# Debug
   140         -puts [exec net stop npf_tcpdump]
   141         -puts [exec net start npf_tcpdump]
   142    129   
   143    130   # Cleanup
   144    131   catch {
   145         -	::twapi::stop_service npf_tcpdump
          132  +	::twapi::stop_service npf
   146    133   }
   147    134   catch {
   148         -	::twapi::delete_service npf_tcpdump
   149         -}
   150         -
   151         -if {$start_npf_service} {
   152         -	catch {
   153         -		::twapi::start_service npf
   154         -	}
          135  +	::twapi::delete_service npf
   155    136   }
   156    137   
   157    138   catch {
   158    139   	file delete -force -- $dstdir
   159    140   }
   160    141   
   161    142   # Terminate
   162    143   exit $exit