ahobson-pcap 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +340 -0
- data/ChangeLog +145 -0
- data/MANIFEST +46 -0
- data/README +48 -0
- data/README.ja +50 -0
- data/Rakefile +17 -0
- data/VERSION +1 -0
- data/doc-ja/Capture.html +147 -0
- data/doc-ja/Dumper.html +54 -0
- data/doc-ja/Filter.html +112 -0
- data/doc-ja/ICMPPacket.html +189 -0
- data/doc-ja/IPAddress.html +60 -0
- data/doc-ja/IPPacket.html +142 -0
- data/doc-ja/Packet.html +101 -0
- data/doc-ja/Pcap.html +111 -0
- data/doc-ja/PcapError.html +21 -0
- data/doc-ja/Pcaplet.html +113 -0
- data/doc-ja/TCPPacket.html +148 -0
- data/doc-ja/TruncatedPacket.html +22 -0
- data/doc-ja/UDPPacket.html +73 -0
- data/doc-ja/index.html +54 -0
- data/doc/Capture.html +160 -0
- data/doc/Dumper.html +60 -0
- data/doc/Filter.html +109 -0
- data/doc/ICMPPacket.html +184 -0
- data/doc/IPAddress.html +60 -0
- data/doc/IPPacket.html +142 -0
- data/doc/Packet.html +98 -0
- data/doc/Pcap.html +113 -0
- data/doc/PcapError.html +21 -0
- data/doc/Pcaplet.html +108 -0
- data/doc/TCPPacket.html +147 -0
- data/doc/TruncatedPacket.html +22 -0
- data/doc/UDPPacket.html +73 -0
- data/doc/index.html +53 -0
- data/examples/httpdump.rb +27 -0
- data/examples/tcpdump.rb +26 -0
- data/examples/test.rb +11 -0
- data/ext/Pcap.c +915 -0
- data/ext/extconf.rb +16 -0
- data/ext/icmp_packet.c +444 -0
- data/ext/ip_packet.c +378 -0
- data/ext/packet.c +328 -0
- data/ext/ruby_pcap.h +134 -0
- data/ext/tcp_packet.c +121 -0
- data/ext/udp_packet.c +96 -0
- data/lib/pcap_misc.rb +116 -0
- data/lib/pcaplet.rb +123 -0
- metadata +103 -0
data/doc/IPAddress.html
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
<HTML>
|
2
|
+
<!-- THIS FILE IS GENERATED FROM ANOTHER SOURCE FILE -->
|
3
|
+
<HEAD>
|
4
|
+
<TITLE>IPAddress</TITLE>
|
5
|
+
</HEAD>
|
6
|
+
<BODY BGCOLOR="ffffff">
|
7
|
+
<DL>
|
8
|
+
<DT><H1>IPAddress</H1></DT>
|
9
|
+
<DD>
|
10
|
+
|
11
|
+
IP Address object.
|
12
|
+
</DD>
|
13
|
+
<DT><H2>Super Class:</H2></DT>
|
14
|
+
<DD><DL><DT><A HREF="http://www.ruby-lang.org/en/man-1.4/Object.html"><CODE>Object</CODE></A></DT></DL></DD>
|
15
|
+
<DT><H2>Methods:</H2></DT>
|
16
|
+
<DL COMPACT>
|
17
|
+
<DT>
|
18
|
+
<A NAME="=="><CODE>self == <var>other</var></CODE></A>
|
19
|
+
<DD>
|
20
|
+
<p>
|
21
|
+
|
22
|
+
Return <CODE>true</CODE> if two addresses are the same address.
|
23
|
+
</p>
|
24
|
+
<DT>
|
25
|
+
<A NAME="hostname"><CODE>hostname</CODE></A>
|
26
|
+
<DD>
|
27
|
+
<p>
|
28
|
+
|
29
|
+
Return host name correspond to this address.
|
30
|
+
</p>
|
31
|
+
<DT>
|
32
|
+
<A NAME="to_i"><CODE>to_i</CODE></A>
|
33
|
+
<DD>
|
34
|
+
<p>
|
35
|
+
|
36
|
+
Return the value of IP address as integer.
|
37
|
+
</p>
|
38
|
+
<DT>
|
39
|
+
<A NAME="to_num_s"><CODE>to_num_s</CODE></A>
|
40
|
+
<DD>
|
41
|
+
<p>
|
42
|
+
|
43
|
+
Return numerical string representation
|
44
|
+
</p>
|
45
|
+
<DT>
|
46
|
+
<A NAME="to_s"><CODE>to_s</CODE></A>
|
47
|
+
<DD>
|
48
|
+
<p>
|
49
|
+
|
50
|
+
Return numerical string representation or host name.
|
51
|
+
Behavior of this method is controlled by <A HREF="Pcap.html#.convert="><CODE>Pcap.convert=</CODE></A>.
|
52
|
+
</p>
|
53
|
+
</DL>
|
54
|
+
</DL>
|
55
|
+
<HR>
|
56
|
+
<P ALIGN="RIGHT">
|
57
|
+
<A HREF="mailto:fukusima@goto.info.waseda.ac.jp">fukusima@goto.info.waseda.ac.jp</A><BR>
|
58
|
+
</P>
|
59
|
+
</BODY>
|
60
|
+
</HTML>
|
data/doc/IPPacket.html
ADDED
@@ -0,0 +1,142 @@
|
|
1
|
+
<HTML>
|
2
|
+
<!-- THIS FILE IS GENERATED FROM ANOTHER SOURCE FILE -->
|
3
|
+
<HEAD>
|
4
|
+
<TITLE>IPPacket</TITLE>
|
5
|
+
</HEAD>
|
6
|
+
<BODY BGCOLOR="ffffff">
|
7
|
+
<DL>
|
8
|
+
<DT><H1>IPPacket</H1></DT>
|
9
|
+
<DD>
|
10
|
+
|
11
|
+
A packet carrying IP header.
|
12
|
+
</DD>
|
13
|
+
<DT><H2>Super Class:</H2></DT>
|
14
|
+
<DD><DL><DT><A HREF="Packet.html"><CODE>Packet</CODE></A></DT></DL></DD>
|
15
|
+
<DT><H2>Methods:</H2></DT>
|
16
|
+
<DL COMPACT>
|
17
|
+
<DT>
|
18
|
+
<A NAME="ip_data"><CODE>ip_data</CODE></A>
|
19
|
+
<DD>
|
20
|
+
<p>
|
21
|
+
|
22
|
+
Return data part as <A HREF="http://www.ruby-lang.org/en/man-1.4/String.html"><CODE>String</CODE></A>.
|
23
|
+
</p>
|
24
|
+
<DT>
|
25
|
+
<A NAME="ip_df?"><CODE>ip_df?</CODE></A>
|
26
|
+
<DD>
|
27
|
+
<p>
|
28
|
+
|
29
|
+
Return <CODE>true</CODE> if Don't Fragment bit is set.
|
30
|
+
</p>
|
31
|
+
<DT>
|
32
|
+
<A NAME="ip_dst"><CODE>ip_dst</CODE></A>
|
33
|
+
<DD>
|
34
|
+
<DT>
|
35
|
+
<A NAME="dst"><CODE>dst</CODE></A>
|
36
|
+
<DD>
|
37
|
+
<p>
|
38
|
+
|
39
|
+
Return destination IP address as <A HREF="IPAddress.html"><CODE>IPAddress</CODE></A>.
|
40
|
+
</p>
|
41
|
+
<DT>
|
42
|
+
<A NAME="ip_flags"><CODE>ip_flags</CODE></A>
|
43
|
+
<DD>
|
44
|
+
<p>
|
45
|
+
|
46
|
+
Return the value of 3-bits IP flag field.
|
47
|
+
</p>
|
48
|
+
<DT>
|
49
|
+
<A NAME="ip_hlen"><CODE>ip_hlen</CODE></A>
|
50
|
+
<DD>
|
51
|
+
<p>
|
52
|
+
|
53
|
+
Return header length. (Unit: 4 octets)
|
54
|
+
</p>
|
55
|
+
<DT>
|
56
|
+
<A NAME="ip_id"><CODE>ip_id</CODE></A>
|
57
|
+
<DD>
|
58
|
+
<p>
|
59
|
+
|
60
|
+
Return identification.
|
61
|
+
</p>
|
62
|
+
<DT>
|
63
|
+
<A NAME="ip_len"><CODE>ip_len</CODE></A>
|
64
|
+
<DD>
|
65
|
+
<p>
|
66
|
+
|
67
|
+
Return total length.
|
68
|
+
</p>
|
69
|
+
<DT>
|
70
|
+
<A NAME="ip_mf?"><CODE>ip_mf?</CODE></A>
|
71
|
+
<DD>
|
72
|
+
<p>
|
73
|
+
|
74
|
+
Return <CODE>true</CODE> if More Fragment bit is set.
|
75
|
+
</p>
|
76
|
+
<DT>
|
77
|
+
<A NAME="ip_off"><CODE>ip_off</CODE></A>
|
78
|
+
<DD>
|
79
|
+
<p>
|
80
|
+
|
81
|
+
Return fragment offset.
|
82
|
+
</p>
|
83
|
+
<DT>
|
84
|
+
<A NAME="ip_proto"><CODE>ip_proto</CODE></A>
|
85
|
+
<DD>
|
86
|
+
<p>
|
87
|
+
|
88
|
+
Return the value of protocol field.
|
89
|
+
</p>
|
90
|
+
<DT>
|
91
|
+
<A NAME="ip_src"><CODE>ip_src</CODE></A>
|
92
|
+
<DD>
|
93
|
+
<DT>
|
94
|
+
<A NAME="src"><CODE>src</CODE></A>
|
95
|
+
<DD>
|
96
|
+
<p>
|
97
|
+
|
98
|
+
Return source IP address as <A HREF="IPAddress.html"><CODE>IPAddress</CODE></A>.
|
99
|
+
</p>
|
100
|
+
<DT>
|
101
|
+
<A NAME="ip_sum"><CODE>ip_sum</CODE></A>
|
102
|
+
<DD>
|
103
|
+
<p>
|
104
|
+
|
105
|
+
Return the value of checksum field.
|
106
|
+
</p>
|
107
|
+
<DT>
|
108
|
+
<A NAME="ip_tos"><CODE>ip_tos</CODE></A>
|
109
|
+
<DD>
|
110
|
+
<p>
|
111
|
+
|
112
|
+
Return the value of TOS field.
|
113
|
+
</p>
|
114
|
+
<DT>
|
115
|
+
<A NAME="ip_ttl"><CODE>ip_ttl</CODE></A>
|
116
|
+
<DD>
|
117
|
+
<p>
|
118
|
+
|
119
|
+
Return TTL.
|
120
|
+
</p>
|
121
|
+
<DT>
|
122
|
+
<A NAME="ip_ver"><CODE>ip_ver</CODE></A>
|
123
|
+
<DD>
|
124
|
+
<p>
|
125
|
+
|
126
|
+
Return IP version.
|
127
|
+
</p>
|
128
|
+
<DT>
|
129
|
+
<A NAME="to_s"><CODE>to_s</CODE></A>
|
130
|
+
<DD>
|
131
|
+
<p>
|
132
|
+
|
133
|
+
Return string representation.
|
134
|
+
</p>
|
135
|
+
</DL>
|
136
|
+
</DL>
|
137
|
+
<HR>
|
138
|
+
<P ALIGN="RIGHT">
|
139
|
+
<A HREF="mailto:fukusima@goto.info.waseda.ac.jp">fukusima@goto.info.waseda.ac.jp</A><BR>
|
140
|
+
</P>
|
141
|
+
</BODY>
|
142
|
+
</HTML>
|
data/doc/Packet.html
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
<HTML>
|
2
|
+
<!-- THIS FILE IS GENERATED FROM ANOTHER SOURCE FILE -->
|
3
|
+
<HEAD>
|
4
|
+
<TITLE>Packet</TITLE>
|
5
|
+
</HEAD>
|
6
|
+
<BODY BGCOLOR="ffffff">
|
7
|
+
<DL>
|
8
|
+
<DT><H1>Packet</H1></DT>
|
9
|
+
<DD>
|
10
|
+
|
11
|
+
Packet captured with <A HREF="Capture.html"><CODE>Capture</CODE></A> object.
|
12
|
+
<CODE>Packet</CODE> and its sub-classes are <A HREF="http://www.ruby-lang.org/en/man-1.4/Marshal.html"><CODE>Marshal</CODE></A> compliant.
|
13
|
+
</DD>
|
14
|
+
<DT><H2>Super Class:</H2></DT>
|
15
|
+
<DD><DL><DT><A HREF="http://www.ruby-lang.org/en/man-1.4/Object.html"><CODE>Object</CODE></A></DT></DL></DD>
|
16
|
+
<DT><H2>Methods:</H2></DT>
|
17
|
+
<DL COMPACT>
|
18
|
+
<DT>
|
19
|
+
<A NAME="caplen"><CODE>caplen</CODE></A>
|
20
|
+
<DD>
|
21
|
+
<p>
|
22
|
+
|
23
|
+
Return captured length.
|
24
|
+
</p>
|
25
|
+
<DT>
|
26
|
+
<A NAME="datalink"><CODE>datalink</CODE></A>
|
27
|
+
<DD>
|
28
|
+
<p>
|
29
|
+
|
30
|
+
Return an integer representing data-link type.
|
31
|
+
(e.g. <A HREF="Pcap.html#::DLT_EN10MB"><CODE>DLT_EN10MB</CODE></A>)
|
32
|
+
</p>
|
33
|
+
<DT>
|
34
|
+
<A NAME="ip?"><CODE>ip?</CODE></A>
|
35
|
+
<DD>
|
36
|
+
<p>
|
37
|
+
|
38
|
+
Return <CODE>true</CODE> if this packet is an instance of
|
39
|
+
<A HREF="IPPacket.html"><CODE>IPPacket</CODE></A> or its sub-class.
|
40
|
+
</p>
|
41
|
+
<DT>
|
42
|
+
<A NAME="len"><CODE>len</CODE></A>
|
43
|
+
<DD>
|
44
|
+
<DT>
|
45
|
+
<A NAME="length"><CODE>length</CODE></A>
|
46
|
+
<DD>
|
47
|
+
<DT>
|
48
|
+
<A NAME="size"><CODE>size</CODE></A>
|
49
|
+
<DD>
|
50
|
+
<p>
|
51
|
+
|
52
|
+
Return total length of packet.
|
53
|
+
</p>
|
54
|
+
<DT>
|
55
|
+
<A NAME="raw_data"><CODE>raw_data</CODE></A>
|
56
|
+
<DD>
|
57
|
+
<p>
|
58
|
+
|
59
|
+
Return raw data of packet as <A HREF="http://www.ruby-lang.org/en/man-1.4/String.html"><CODE>String</CODE></A>.
|
60
|
+
</p>
|
61
|
+
<DT>
|
62
|
+
<A NAME="tcp?"><CODE>tcp?</CODE></A>
|
63
|
+
<DD>
|
64
|
+
<p>
|
65
|
+
|
66
|
+
Return <CODE>true</CODE> if this packet is an instance of
|
67
|
+
<A HREF="TCPPacket.html"><CODE>TCPPacket</CODE></A> or its sub-class.
|
68
|
+
</p>
|
69
|
+
<DT>
|
70
|
+
<A NAME="time"><CODE>time</CODE></A>
|
71
|
+
<DD>
|
72
|
+
<p>
|
73
|
+
|
74
|
+
Return timestamp as <A HREF="http://www.ruby-lang.org/en/man-1.4/Time.html"><CODE>Time</CODE></A>.
|
75
|
+
</p>
|
76
|
+
<DT>
|
77
|
+
<A NAME="time_i"><CODE>time_i</CODE></A>
|
78
|
+
<DD>
|
79
|
+
<p>
|
80
|
+
|
81
|
+
Return timestamp as integer.
|
82
|
+
</p>
|
83
|
+
<DT>
|
84
|
+
<A NAME="udp?"><CODE>udp?</CODE></A>
|
85
|
+
<DD>
|
86
|
+
<p>
|
87
|
+
|
88
|
+
Return <CODE>true</CODE> if this packet is an instance of
|
89
|
+
<A HREF="UDPPacket.html"><CODE>UDPPacket</CODE></A> or its sub-class.
|
90
|
+
</p>
|
91
|
+
</DL>
|
92
|
+
</DL>
|
93
|
+
<HR>
|
94
|
+
<P ALIGN="RIGHT">
|
95
|
+
<A HREF="mailto:fukusima@goto.info.waseda.ac.jp">fukusima@goto.info.waseda.ac.jp</A><BR>
|
96
|
+
</P>
|
97
|
+
</BODY>
|
98
|
+
</HTML>
|
data/doc/Pcap.html
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
<HTML>
|
2
|
+
<!-- THIS FILE IS GENERATED FROM ANOTHER SOURCE FILE -->
|
3
|
+
<HEAD>
|
4
|
+
<TITLE>Pcap</TITLE>
|
5
|
+
</HEAD>
|
6
|
+
<BODY BGCOLOR="ffffff">
|
7
|
+
<DL>
|
8
|
+
<DT><H1>Pcap</H1></DT>
|
9
|
+
<DD>
|
10
|
+
|
11
|
+
<CODE>Pcap</CODE> defines general methods and constants related to
|
12
|
+
pcap.
|
13
|
+
</DD>
|
14
|
+
<DT><H2>Constants:</H2></DT>
|
15
|
+
<DL COMPACT>
|
16
|
+
<DT>
|
17
|
+
<A NAME="::DLT_NULL"><CODE>DLT_NULL</CODE></A>
|
18
|
+
<DD>
|
19
|
+
<DT>
|
20
|
+
<A NAME="::DLT_EN10MB"><CODE>DLT_EN10MB</CODE></A>
|
21
|
+
<DD>
|
22
|
+
<DT>
|
23
|
+
<A NAME="::DLT_EN3MB"><CODE>DLT_EN3MB</CODE></A>
|
24
|
+
<DD>
|
25
|
+
<DT>
|
26
|
+
<A NAME="::DLT_AX25"><CODE>DLT_AX25</CODE></A>
|
27
|
+
<DD>
|
28
|
+
<DT>
|
29
|
+
<A NAME="::DLT_PRONET"><CODE>DLT_PRONET</CODE></A>
|
30
|
+
<DD>
|
31
|
+
<DT>
|
32
|
+
<A NAME="::DLT_CHAOS"><CODE>DLT_CHAOS</CODE></A>
|
33
|
+
<DD>
|
34
|
+
<DT>
|
35
|
+
<A NAME="::DLT_IEEE802"><CODE>DLT_IEEE802</CODE></A>
|
36
|
+
<DD>
|
37
|
+
<DT>
|
38
|
+
<A NAME="::DLT_ARCNET"><CODE>DLT_ARCNET</CODE></A>
|
39
|
+
<DD>
|
40
|
+
<DT>
|
41
|
+
<A NAME="::DLT_SLIP"><CODE>DLT_SLIP</CODE></A>
|
42
|
+
<DD>
|
43
|
+
<DT>
|
44
|
+
<A NAME="::DLT_PPP"><CODE>DLT_PPP</CODE></A>
|
45
|
+
<DD>
|
46
|
+
<DT>
|
47
|
+
<A NAME="::DLT_FDDI"><CODE>DLT_FDDI</CODE></A>
|
48
|
+
<DD>
|
49
|
+
<DT>
|
50
|
+
<A NAME="::DLT_ATM_RFC1483"><CODE>DLT_ATM_RFC1483</CODE></A>
|
51
|
+
<DD>
|
52
|
+
<DT>
|
53
|
+
<A NAME="::DLT_RAW"><CODE>DLT_RAW</CODE></A>
|
54
|
+
<DD>
|
55
|
+
<DT>
|
56
|
+
<A NAME="::DLT_SLIP_BSDOS"><CODE>DLT_SLIP_BSDOS</CODE></A>
|
57
|
+
<DD>
|
58
|
+
<DT>
|
59
|
+
<A NAME="::DLT_PPP_BSDOS"><CODE>DLT_PPP_BSDOS</CODE></A>
|
60
|
+
<DD>
|
61
|
+
<p>
|
62
|
+
|
63
|
+
Data-link type constants.
|
64
|
+
</p>
|
65
|
+
</DL>
|
66
|
+
<DT><H2>Module Methods:</H2></DT>
|
67
|
+
<DL COMPACT>
|
68
|
+
<DT>
|
69
|
+
<A NAME=".convert="><CODE>convert = <var>bool</var></CODE></A>
|
70
|
+
<DD>
|
71
|
+
<p>
|
72
|
+
|
73
|
+
Set the behavior of classes under module <CODE>Pcap</CODE>
|
74
|
+
when they convert IP address or other numbers to string.
|
75
|
+
Value <CODE>true</CODE> means that the numbers are converted
|
76
|
+
to their symbolic name.
|
77
|
+
</p>
|
78
|
+
<DT>
|
79
|
+
<A NAME=".convert?"><CODE>convert?</CODE></A>
|
80
|
+
<DD>
|
81
|
+
<p>
|
82
|
+
|
83
|
+
Return the behavior of classes under module <CODE>Pcap</CODE>
|
84
|
+
when they convert IP address or other numbers to string.
|
85
|
+
Value <CODE>true</CODE> means that the numbers are converted
|
86
|
+
to their symbolic name.
|
87
|
+
</p>
|
88
|
+
<DT>
|
89
|
+
<A NAME=".lookupdev"><CODE>lookupdev</CODE></A>
|
90
|
+
<DD>
|
91
|
+
<p>
|
92
|
+
|
93
|
+
Return a name of network device.
|
94
|
+
</p>
|
95
|
+
<DT>
|
96
|
+
<A NAME=".lookupnet"><CODE>lookupnet(<var>device</var>)</CODE></A>
|
97
|
+
<DD>
|
98
|
+
<p>
|
99
|
+
|
100
|
+
Return a two-element array
|
101
|
+
<CODE>[net, mask]</CODE>.
|
102
|
+
<CODE>net</CODE> is network number as <A HREF="IPAddress.html"><CODE>IPAddress</CODE></A>.
|
103
|
+
<CODE>mask</CODE> is netmask as <A HREF="http://www.ruby-lang.org/en/man-1.4/Integer.html"><CODE>Integer</CODE></A>.
|
104
|
+
Argument <VAR>device</VAR> is network device name.
|
105
|
+
</p>
|
106
|
+
</DL>
|
107
|
+
</DL>
|
108
|
+
<HR>
|
109
|
+
<P ALIGN="RIGHT">
|
110
|
+
<A HREF="mailto:fukusima@goto.info.waseda.ac.jp">fukusima@goto.info.waseda.ac.jp</A><BR>
|
111
|
+
</P>
|
112
|
+
</BODY>
|
113
|
+
</HTML>
|
data/doc/PcapError.html
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
<HTML>
|
2
|
+
<!-- THIS FILE IS GENERATED FROM ANOTHER SOURCE FILE -->
|
3
|
+
<HEAD>
|
4
|
+
<TITLE>PcapError</TITLE>
|
5
|
+
</HEAD>
|
6
|
+
<BODY BGCOLOR="ffffff">
|
7
|
+
<DL>
|
8
|
+
<DT><H1>PcapError</H1></DT>
|
9
|
+
<DD>
|
10
|
+
|
11
|
+
Exception about pcap.
|
12
|
+
</DD>
|
13
|
+
<DT><H2>Super Class:</H2></DT>
|
14
|
+
<DD><DL><DT><CODE>StandardError</CODE></DT></DL></DD>
|
15
|
+
</DL>
|
16
|
+
<HR>
|
17
|
+
<P ALIGN="RIGHT">
|
18
|
+
<A HREF="mailto:fukusima@goto.info.waseda.ac.jp">fukusima@goto.info.waseda.ac.jp</A><BR>
|
19
|
+
</P>
|
20
|
+
</BODY>
|
21
|
+
</HTML>
|
data/doc/Pcaplet.html
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
<HTML>
|
2
|
+
<!-- THIS FILE IS GENERATED FROM ANOTHER SOURCE FILE -->
|
3
|
+
<HEAD>
|
4
|
+
<TITLE>Pcaplet</TITLE>
|
5
|
+
</HEAD>
|
6
|
+
<BODY BGCOLOR="ffffff">
|
7
|
+
<DL>
|
8
|
+
<DT><H1>Pcaplet</H1></DT>
|
9
|
+
<DD>
|
10
|
+
|
11
|
+
<P>
|
12
|
+
|
13
|
+
<CODE>Pcaplet</CODE> provides a template for packet monitoring tool
|
14
|
+
using <A HREF="Capture.html"><CODE>Capture</CODE></A>.
|
15
|
+
You need to <CODE>require 'pcaplet'</CODE> to use this class.
|
16
|
+
</P>
|
17
|
+
|
18
|
+
<P>
|
19
|
+
|
20
|
+
Typical usage:
|
21
|
+
<blockquote>
|
22
|
+
<pre>require 'pcaplet'
|
23
|
+
|
24
|
+
my_tool = Pcaplet.new
|
25
|
+
my_tool.each_packet {|pkt|
|
26
|
+
# code for processing pkt
|
27
|
+
}
|
28
|
+
my_tool.close
|
29
|
+
</pre>
|
30
|
+
</blockquote>
|
31
|
+
|
32
|
+
</P>
|
33
|
+
|
34
|
+
<P>
|
35
|
+
|
36
|
+
<CODE>Pcaplet</CODE> interprets filter expression specified in
|
37
|
+
command line and following command line options as tcpdump does.
|
38
|
+
<blockquote>
|
39
|
+
<pre>-i -r -c -s -n
|
40
|
+
</pre>
|
41
|
+
</blockquote>
|
42
|
+
|
43
|
+
'<CODE>-r</CODE>' option can handle gzipped file.
|
44
|
+
</P>
|
45
|
+
|
46
|
+
</DD>
|
47
|
+
<DT><H2>Super Class:</H2></DT>
|
48
|
+
<DD><DL><DT><A HREF="http://www.ruby-lang.org/en/man-1.4/Object.html"><CODE>Object</CODE></A></DT></DL></DD>
|
49
|
+
<DT><H2>Class Methods:</H2></DT>
|
50
|
+
<DL COMPACT>
|
51
|
+
<DT>
|
52
|
+
<A NAME=".new"><CODE>new([<var>option</var>])</CODE></A>
|
53
|
+
<DD>
|
54
|
+
<p>
|
55
|
+
|
56
|
+
Generate <CODE>Pcaplet</CODE> instance. Command line
|
57
|
+
analysis and device open is performed.
|
58
|
+
<VAR>option</VAR> is added to command line options.
|
59
|
+
</p>
|
60
|
+
</DL>
|
61
|
+
<DT><H2>Methods:</H2></DT>
|
62
|
+
<DL COMPACT>
|
63
|
+
<DT>
|
64
|
+
<A NAME="add_filter"><CODE>add_filter(<var>filter</var>)</CODE></A>
|
65
|
+
<DD>
|
66
|
+
<p>
|
67
|
+
|
68
|
+
Add <VAR>filter</VAR> to the filter specified in command line.
|
69
|
+
Filter is set as follows.
|
70
|
+
<blockquote>
|
71
|
+
<pre>"( current_filter ) and ( filter )"
|
72
|
+
</pre>
|
73
|
+
</blockquote>
|
74
|
+
|
75
|
+
</p>
|
76
|
+
<DT>
|
77
|
+
<A NAME="each_packet"><CODE>each_packet {|<var>packet</var>|...}</CODE></A>
|
78
|
+
<DD>
|
79
|
+
<DT>
|
80
|
+
<A NAME="each"><CODE>each {|<var>packet</var>|...}</CODE></A>
|
81
|
+
<DD>
|
82
|
+
<p>
|
83
|
+
|
84
|
+
Iterate over each packet. The argument given to the block
|
85
|
+
is an instance of <A HREF="Packet.html"><CODE>Packet</CODE></A> or its sub-class.
|
86
|
+
</p>
|
87
|
+
<DT>
|
88
|
+
<A NAME="capture"><CODE>capture</CODE></A>
|
89
|
+
<DD>
|
90
|
+
<p>
|
91
|
+
|
92
|
+
Return <A HREF="Capture.html"><CODE>Capture</CODE></A> object which is used internally.
|
93
|
+
</p>
|
94
|
+
<DT>
|
95
|
+
<A NAME="close"><CODE>close</CODE></A>
|
96
|
+
<DD>
|
97
|
+
<p>
|
98
|
+
|
99
|
+
Close underlying device.
|
100
|
+
</p>
|
101
|
+
</DL>
|
102
|
+
</DL>
|
103
|
+
<HR>
|
104
|
+
<P ALIGN="RIGHT">
|
105
|
+
<A HREF="mailto:fukusima@goto.info.waseda.ac.jp">fukusima@goto.info.waseda.ac.jp</A><BR>
|
106
|
+
</P>
|
107
|
+
</BODY>
|
108
|
+
</HTML>
|