ahobson-pcap 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,54 @@
1
+ <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2
+ <html> <head>
3
+ <title>Ruby/Pcap Library</title>
4
+ </head>
5
+
6
+ <body bgcolor="ffffff">
7
+ <h1>Ruby/Pcap��ĥ�饤�֥��</h1>
8
+
9
+ LBL �� libpcap (Packet Capture library) �ؤ� ruby ���󥿥ե������Ǥ���
10
+
11
+ <h2>�⥸�塼��</h2>
12
+ <ul>
13
+ <li><a href="Pcap.html"><code>Pcap</code></a>
14
+ </ul>
15
+
16
+ <h2>���饹</h2>
17
+
18
+ �ʲ��Υ��饹������ <code>Pcap</code> �⥸�塼��β����������Ƥ��ޤ���
19
+ �������äƻ��Ѥ���Ȥ��� <code>Pcap</code> �⥸�塼���
20
+ <code>include</code> ���뤫���⤷���� <code>Pcap::Capture</code> �Τ�
21
+ ���˻��Ȥ��Ƥ���������
22
+
23
+ <ul>
24
+ <li><a href="Capture.html"><code>Capture</code></a>
25
+ <li><a href="Pcaplet.html"><code>Pcaplet</code></a>
26
+ <li><a href="Packet.html"><code>Packet</code></a>
27
+ <ul>
28
+ <li><a href="IPPacket.html"><code>IPPacket</code></a>
29
+ <ul>
30
+ <li><a href="TCPPacket.html"><code>TCPPacket</code></a>
31
+ <li><a href="UDPPacket.html"><code>UDPPacket</code></a>
32
+ <li><a href="ICMPPacket.html"><code>ICMPPacket</code></a>
33
+ </ul>
34
+ </ul>
35
+ <li><a href="IPAddress.html"><code>IPAddress</code></a>
36
+ <li><a href="Dumper.html"><code>Dumper</code></a>
37
+ <li><a href="Filter.html"><code>Filter</code></a>
38
+ </ul>
39
+
40
+ <h2>�㳰</h2>
41
+
42
+ <ul>
43
+ <li><a href="PcapError.html"><code>PcapError</code></a>
44
+ <ul>
45
+ <li><a href="TruncatedPacket.html"><code>TruncatedPacket</code></a>
46
+ </ul>
47
+ </ul>
48
+
49
+ <hr>
50
+ <P ALIGN="RIGHT">
51
+ <A HREF="mailto:fukusima@goto.info.waseda.ac.jp">
52
+ fukusima@goto.info.waseda.ac.jp</A><BR>
53
+ </P>
54
+ </body> </html>
@@ -0,0 +1,160 @@
1
+ <HTML>
2
+ <!-- THIS FILE IS GENERATED FROM ANOTHER SOURCE FILE -->
3
+ <HEAD>
4
+ <TITLE>Capture</TITLE>
5
+ </HEAD>
6
+ <BODY BGCOLOR="ffffff">
7
+ <DL>
8
+ <DT><H1>Capture</H1></DT>
9
+ <DD>
10
+
11
+ Packet Capture 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>Included Modules:</H2></DT>
16
+ <DL>
17
+ <DT><A HREF="http://www.ruby-lang.org/en/man-1.4/Enum.html"><CODE>Enumerable</CODE></A></DT>
18
+ </DL>
19
+ <DT><H2>Class Methods:</H2></DT>
20
+ <DL COMPACT>
21
+ <DT>
22
+ <A NAME=".open_live"><CODE>open_live(<var>device</var>[, <var>snaplen</var>[, <var>promisc</var>[, <var>to_ms</var>]]])</CODE></A>
23
+ <DD>
24
+ <p>
25
+
26
+ Open specified device and return <CODE>Capture</CODE>
27
+ object.
28
+ Default value for <VAR>snaplen</VAR>,
29
+ <VAR>promisc</VAR> and <VAR>to_ms</VAR> are 68 octets,
30
+ <CODE>true</CODE> and 1000 milliseconds.
31
+ </p>
32
+ <DT>
33
+ <A NAME=".open_offline"><CODE>open_offline(<var>filename</var>)</CODE></A>
34
+ <DD>
35
+ <p>
36
+
37
+ Open <VAR>filename</VAR> and return <CODE>Capture</CODE> object.
38
+ </p>
39
+ <DT>
40
+ <A NAME=".open_dead"><CODE>open_dead([<var>linktype</var>[, <var>snaplen</var>]])</CODE></A>
41
+ <DD>
42
+ <p>
43
+
44
+ Open fake <CODE>Capture</CODE> object.
45
+ Default value for <VAR>linktype<VAR> and <VAR>snaplen</VAR> are
46
+ <A HREF="Pcap.html#::DLT_EN10MB"><CODE>DLT_EN10MB</CODE></A> and 68 octets.
47
+ </p>
48
+ </DL>
49
+ <DT><H2>Methods:</H2></DT>
50
+ <DL COMPACT>
51
+ <DT>
52
+ <A NAME="close"><CODE>close</CODE></A>
53
+ <DD>
54
+ <p>
55
+
56
+ Close <CODE>Capture</CODE> object.
57
+ </p>
58
+ <DT>
59
+ <A NAME="datalink"><CODE>datalink</CODE></A>
60
+ <DD>
61
+ <p>
62
+
63
+ Return an integer representing data-link type.
64
+ (e.g. <A HREF="Pcap.html#::DLT_EN10MB"><CODE>DLT_EN10MB</CODE></A>)
65
+ </p>
66
+ <DT>
67
+ <A NAME="dispatch"><CODE>dispatch([<var>count</var>]) {|<var>packet</var>|...}</CODE></A>
68
+ <DD>
69
+ <p>
70
+
71
+ <P>
72
+
73
+ Iterate over each packet. The argument given to the block
74
+ is an instance of <A HREF="Packet.html"><CODE>Packet</CODE></A> or its sub-class.
75
+ </P>
76
+
77
+ <P>
78
+
79
+ <VAR>count</VAR> specifies the maximum number of packets to
80
+ process. a <VAR>count</VAR> of -1 processes all the packets
81
+ received in one buffer. a <VAR>count</VAR> of 0 processes all
82
+ packets until an error occurs, EOF is reached, or the read
83
+ times out.
84
+ Default of <VAR>count</VAR> is -1.
85
+ </P>
86
+
87
+ </p>
88
+ <DT>
89
+ <A NAME="each_packet"><CODE>each_packet([<var>count</var>]) {|<var>packet</var>|...}</CODE></A>
90
+ <DD>
91
+ <DT>
92
+ <A NAME="each"><CODE>each([<var>count</var>]) {|<var>packet</var>|...}</CODE></A>
93
+ <DD>
94
+ <DT>
95
+ <A NAME="loop"><CODE>loop([<var>count</var>]) {|<var>packet</var>|...}</CODE></A>
96
+ <DD>
97
+ <p>
98
+
99
+ <P>
100
+
101
+ Iterate over each packet. The argument given to the block
102
+ is an instance of <A HREF="Packet.html"><CODE>Packet</CODE></A> or its sub-class.
103
+ </P>
104
+
105
+ <P>
106
+
107
+ <VAR>count</VAR> specifies the maximum number of packets to
108
+ process. A negative <VAR>count</VAR> processes packets forever
109
+ or until EOF is reached. Default of <VAR>count</VAR> is -1.
110
+ </P>
111
+
112
+ </p>
113
+ <DT>
114
+ <A NAME="snapshot"><CODE>snapshot</CODE></A>
115
+ <DD>
116
+ <DT>
117
+ <A NAME="snaplen"><CODE>snaplen</CODE></A>
118
+ <DD>
119
+ <p>
120
+
121
+ Return the snapshot length.
122
+ </p>
123
+ <DT>
124
+ <A NAME="setfilter"><CODE>setfilter(<var>filter</var>[, <var>optimize</var>])</CODE></A>
125
+ <DD>
126
+ <p>
127
+
128
+ Specify <VAR>filter</VAR> as packet filter.
129
+ <VAR>filter</VAR> can be a string or a <A HREF="Filter.html"><CODE>Filter</CODE></A> object.
130
+ <VAR>optimize</VAR> controls whether optimization is performed.
131
+ Default of <VAR>optimize</VAR> is <CODE>true</CODE>.
132
+ </p>
133
+ <DT>
134
+ <A NAME="stats"><CODE>stats</CODE></A>
135
+ <DD>
136
+ <p>
137
+
138
+ Return a <A HREF="http://www.ruby-lang.org/en/man-1.4/Struct.html"><CODE>Struct</CODE></A> which represents packet statistics.
139
+ This struct has following members.
140
+ <BLOCKQUOTE>
141
+ <DL COMPACT>
142
+ <DT><CODE>recv</CODE></DT><DD>number of received packets</DD><DT><CODE>drop</CODE></DT><DD>number of dropped packets</DD></DL>
143
+ </BLOCKQUOTE>
144
+
145
+ </p>
146
+ <DT>
147
+ <A NAME="inject"><CODE>inject(<var>buf</var>)</CODE></A>
148
+ <DD>
149
+ <p>
150
+
151
+ Inject <VAR>buf</VAR> as a packet.
152
+ </p>
153
+ </DL>
154
+ </DL>
155
+ <HR>
156
+ <P ALIGN="RIGHT">
157
+ <A HREF="mailto:fukusima@goto.info.waseda.ac.jp">fukusima@goto.info.waseda.ac.jp</A><BR>
158
+ </P>
159
+ </BODY>
160
+ </HTML>
@@ -0,0 +1,60 @@
1
+ <HTML>
2
+ <!-- THIS FILE IS GENERATED FROM ANOTHER SOURCE FILE -->
3
+ <HEAD>
4
+ <TITLE>Dumper</TITLE>
5
+ </HEAD>
6
+ <BODY BGCOLOR="ffffff">
7
+ <DL>
8
+ <DT><H1>Dumper</H1></DT>
9
+ <DD>
10
+
11
+ Class to dump packets to tcpdump-format file. Generated file
12
+ can be read with tcpdump and <A HREF="Capture.html#.open_offline"><CODE>Capture.open_offline</CODE></A>.
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>Class Methods:</H2></DT>
17
+ <DL COMPACT>
18
+ <DT>
19
+ <A NAME=".open"><CODE>open(<var>capture</var>, <var>filename</var>)</CODE></A>
20
+ <DD>
21
+ <p>
22
+
23
+ Return a <CODE>Dumper</CODE> to dump packets captured by
24
+ <VAR>capture</VAR> to <VAR>filename</VAR>.
25
+ </p>
26
+ </DL>
27
+ <DT><H2>Methods:</H2></DT>
28
+ <DL COMPACT>
29
+ <DT>
30
+ <A NAME="close"><CODE>close</CODE></A>
31
+ <DD>
32
+ <p>
33
+
34
+ close <CODE>Dumper</CODE>.
35
+ </p>
36
+ <DT>
37
+ <A NAME="dump"><CODE>dump(<var>packet</var>)</CODE></A>
38
+ <DD>
39
+ <p>
40
+
41
+ Dump <VAR>packet</VAR> to this <CODE>Dumper</CODE>.
42
+ <VAR>packet</VAR> must be a packet captured by
43
+ <A HREF="Capture.html"><CODE>Capture</CODE></A> specified when opening this <CODE>Dumper</CODE>.
44
+ </p>
45
+ <DT>
46
+ <A NAME="dump_raw"><CODE>dump_raw(<var>buf</var>)</CODE></A>
47
+ <DD>
48
+ <p>
49
+
50
+ Dump <VAR>buf</VAR> to this <CODE>Dumper</CODE> as a packet.
51
+ </p>
52
+
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>
@@ -0,0 +1,109 @@
1
+ <HTML>
2
+ <!-- THIS FILE IS GENERATED FROM ANOTHER SOURCE FILE -->
3
+ <HEAD>
4
+ <TITLE>Filter</TITLE>
5
+ </HEAD>
6
+ <BODY BGCOLOR="ffffff">
7
+ <DL>
8
+ <DT><H1>Filter</H1></DT>
9
+ <DD>
10
+
11
+ <CODE>Filter</CODE> determines whether a packet satisfies
12
+ specified condition. Actually <CODE>Filter</CODE> is
13
+ wrapper for <CODE>bpf_program</CODE>. For details of filter
14
+ expression, see <CODE>tcpdump(1)</CODE>.
15
+ </DD>
16
+ <DT><H2>Super Class:</H2></DT>
17
+ <DD><DL><DT><A HREF="http://www.ruby-lang.org/en/man-1.4/Object.html"><CODE>Object</CODE></A></DT></DL></DD>
18
+ <DT><H2>Class Methods:</H2></DT>
19
+ <DL COMPACT>
20
+ <DT>
21
+ <A NAME=".compile"><CODE>compile(<var>expr</var>, <var>capture</var>[, <var>optimize</var>[, <var>netmask</var>]])</CODE></A>
22
+ <DD>
23
+ <DT>
24
+ <A NAME=".new"><CODE>new(<var>expr</var>, <var>capture</var>[, <var>optimize</var>[, <var>netmask</var>]])</CODE></A>
25
+ <DD>
26
+ <p>
27
+
28
+ <P>
29
+
30
+ Create a new <CODE>Filter</CODE> object.
31
+ <VAR>expr</VAR> is a filter string. <VAR>capture</VAR>
32
+ is a <A HREF="Capture.html"><CODE>Capture</CODE></A> object. <VAR>optimize</VAR>
33
+ controls optimization of resulting code.
34
+ <VAR>netmask</VAR> specifies the netmask of the local net.
35
+ </P>
36
+
37
+ <P>
38
+
39
+ Created <CODE>Filter</CODE> can be applied to packets
40
+ captured via <VAR>capture</VAR>.
41
+ </P>
42
+
43
+ <P>
44
+
45
+ If <A HREF="http://www.tcpdump.org/"><CODE>libpcap-0.5 or later</CODE></A>
46
+ used, one of following values can be specified
47
+ instead of <VAR>capture</VAR>:
48
+ <BLOCKQUOTE>
49
+ <DL COMPACT>
50
+ <DT><CODE>[snaplen, datalink]</CODE></DT><DD>an array containing required parameters</DD><DT>omitted (or <CODE>nil</CODE>)</DT><DD>Ethernet default
51
+ (<CODE>[68, <A HREF="Pcap.html#::DLT_EN10MB"><CODE>DLT_EN10MB</CODE></A>]</CODE>)
52
+ </DD></DL>
53
+ </BLOCKQUOTE>
54
+
55
+ </P>
56
+
57
+ </p>
58
+ </DL>
59
+ <DT><H2>Methods:</H2></DT>
60
+ <DL COMPACT>
61
+ <DT>
62
+ <A NAME="==="><CODE>self === <var>packet</var></CODE></A>
63
+ <DD>
64
+ <DT>
65
+ <A NAME="=~"><CODE>self =~ <var>packet</var></CODE></A>
66
+ <DD>
67
+ <p>
68
+
69
+ Return true if <VAR>packet</VAR> matches this filter.
70
+ </p>
71
+ <DT>
72
+ <A NAME="~self"><CODE>~ self</CODE></A>
73
+ <DD>
74
+ <p>
75
+
76
+ Return a <CODE>Filter</CODE> which represents
77
+ &quot;not <CODE>self</CODE>&quot;.
78
+ </p>
79
+ <DT>
80
+ <A NAME="|"><CODE>self | <var>other</var></CODE></A>
81
+ <DD>
82
+ <p>
83
+
84
+ Return a <CODE>Filter</CODE> which represents
85
+ &quot;<CODE>self</CODE> or <VAR>other</VAR>&quot;.
86
+ </p>
87
+ <DT>
88
+ <A NAME="&amp;"><CODE>self &amp; <var>other</var></CODE></A>
89
+ <DD>
90
+ <p>
91
+
92
+ Return a <CODE>Filter</CODE> which represents
93
+ &quot;<CODE>self</CODE> and <VAR>other</VAR>&quot;.
94
+ </p>
95
+ <DT>
96
+ <A NAME="source"><CODE>source</CODE></A>
97
+ <DD>
98
+ <p>
99
+
100
+ Returns the orginal string from which the filter is constructed.
101
+ </p>
102
+ </DL>
103
+ </DL>
104
+ <HR>
105
+ <P ALIGN="RIGHT">
106
+ <A HREF="mailto:fukusima@goto.info.waseda.ac.jp">fukusima@goto.info.waseda.ac.jp</A><BR>
107
+ </P>
108
+ </BODY>
109
+ </HTML>
@@ -0,0 +1,184 @@
1
+ <HTML>
2
+ <!-- THIS FILE IS GENERATED FROM ANOTHER SOURCE FILE -->
3
+ <HEAD>
4
+ <TITLE>ICMPPacket</TITLE>
5
+ </HEAD>
6
+ <BODY BGCOLOR="ffffff">
7
+ <DL>
8
+ <DT><H1>ICMPPacket</H1></DT>
9
+ <DD>
10
+
11
+ <P>
12
+
13
+ A packet carrying ICMP message.
14
+ </P>
15
+
16
+ ICMP message formats are vary according to ICMP type.
17
+ Thus some fields exist in certain types of packet. Any
18
+ attempt to access nonexistence field raises an exception.
19
+ <P>
20
+
21
+ </P>
22
+
23
+ Type, code and cksum fields are valid for any ICMP type.
24
+ <P>
25
+
26
+ </P>
27
+
28
+ </DD>
29
+ <DT><H2>Super Class:</H2></DT>
30
+ <DD><DL><DT><A HREF="IPPacket.html"><CODE>IPPacket</CODE></A></DT></DL></DD>
31
+ <DT><H2>Methods:</H2></DT>
32
+ <DL COMPACT>
33
+ <DT>
34
+ <A NAME="icmp_cksum"><CODE>icmp_cksum</CODE></A>
35
+ <DD>
36
+ <p>
37
+
38
+ Return ICMP checksum.
39
+ </p>
40
+ <DT>
41
+ <A NAME="icmp_code"><CODE>icmp_code</CODE></A>
42
+ <DD>
43
+ <p>
44
+
45
+ Return ICMP code.
46
+ </p>
47
+ <DT>
48
+ <A NAME="icmp_data"><CODE>icmp_data</CODE></A>
49
+ <DD>
50
+ <p>
51
+
52
+ Return data portion of ICMP_ECHO/ICMP_ECHOREPLY
53
+ messages as <A HREF="http://www.ruby-lang.org/en/man-1.4/String.html"><CODE>String</CODE></A>
54
+ </p>
55
+ <DT>
56
+ <A NAME="icmp_gwaddr"><CODE>icmp_gwaddr</CODE></A>
57
+ <DD>
58
+ <p>
59
+
60
+ Return gateway address of ICMP_REDIRECT message as
61
+ <A HREF="IPAddress.html"><CODE>IPAddress</CODE></A>.
62
+ </p>
63
+ <DT>
64
+ <A NAME="icmp_id"><CODE>icmp_id</CODE></A>
65
+ <DD>
66
+ <p>
67
+
68
+ Return identifier.
69
+ </p>
70
+ <DT>
71
+ <A NAME="icmp_ip"><CODE>icmp_ip</CODE></A>
72
+ <DD>
73
+ <p>
74
+
75
+ Return original IP Datagram as <A HREF="IPPacket.html"><CODE>IPPacket</CODE></A>.
76
+ </p>
77
+ <DT>
78
+ <A NAME="icmp_lifetime"><CODE>icmp_lifetime</CODE></A>
79
+ <DD>
80
+ <p>
81
+
82
+ Return lifetime of ICMP_ROUTERADVERT message.
83
+ </p>
84
+ <DT>
85
+ <A NAME="icmp_nextmtu"><CODE>icmp_nextmtu</CODE></A>
86
+ <DD>
87
+ <p>
88
+
89
+ Return Next Hop MTU of ICMP_UNREACH_NEEDFRAG message
90
+ (See rfc1191).
91
+ </p>
92
+ <DT>
93
+ <A NAME="icmp_num_addrs"><CODE>icmp_num_addrs</CODE></A>
94
+ <DD>
95
+ <p>
96
+
97
+ Return number of addresses of ICMP_ROUTERADVERT message.
98
+ </p>
99
+ <DT>
100
+ <A NAME="icmp_otime"><CODE>icmp_otime</CODE></A>
101
+ <DD>
102
+ <DT>
103
+ <A NAME="icmp_rtime"><CODE>icmp_rtime</CODE></A>
104
+ <DD>
105
+ <DT>
106
+ <A NAME="icmp_ttime"><CODE>icmp_ttime</CODE></A>
107
+ <DD>
108
+ <p>
109
+
110
+ Return timestamp of
111
+ ICMP_TSTAMP/ICMP_TSTAMPREPLY message as <A HREF="http://www.ruby-lang.org/en/man-1.4/Time.html"><CODE>Time</CODE></A>.
112
+ </p>
113
+ <DT>
114
+ <A NAME="icmp_pptr"><CODE>icmp_pptr</CODE></A>
115
+ <DD>
116
+ <p>
117
+
118
+ Return error pointer of ICMP_PARAMPROB message.
119
+ </p>
120
+ <DT>
121
+ <A NAME="icmp_radv"><CODE>icmp_radv(<var>nth</var>)</CODE></A>
122
+ <DD>
123
+ <p>
124
+
125
+ Return <VAR>nth</VAR> address entry of
126
+ ICMP_ROUTERADVERT message. Returned value is a two
127
+ elements array <CODE>[address, preference]</CODE>.
128
+ </p>
129
+ <DT>
130
+ <A NAME="icmp_seq"><CODE>icmp_seq</CODE></A>
131
+ <DD>
132
+ <p>
133
+
134
+ Return sequence number.
135
+ </p>
136
+ <DT>
137
+ <A NAME="icmp_seqle"><CODE>icmp_seqle</CODE></A>
138
+ <DD>
139
+ <p>
140
+
141
+ <P>
142
+
143
+ Return sequence number interpreted as little endian.
144
+ </P>
145
+
146
+ <P>
147
+
148
+ No small portion of <CODE>ping</CODE> command
149
+ implementations write sequence number in host byte
150
+ order. Thus the sequence number of ICMP messages
151
+ transmitted from little endian host may be in little
152
+ endian.
153
+ </P>
154
+
155
+ </p>
156
+ <DT>
157
+ <A NAME="icmp_type"><CODE>icmp_type</CODE></A>
158
+ <DD>
159
+ <p>
160
+
161
+ Return ICMP type.
162
+ </p>
163
+ <DT>
164
+ <A NAME="icmp_typestr"><CODE>icmp_typestr</CODE></A>
165
+ <DD>
166
+ <p>
167
+
168
+ Return string describing ICMP type (e.g. &quot;echo reply&quot;).
169
+ </p>
170
+ <DT>
171
+ <A NAME="icmp_wpa"><CODE>icmp_wpa</CODE></A>
172
+ <DD>
173
+ <p>
174
+
175
+ Return word per address entry of ICMP_ROUTERADVERT message.
176
+ </p>
177
+ </DL>
178
+ </DL>
179
+ <HR>
180
+ <P ALIGN="RIGHT">
181
+ <A HREF="mailto:fukusima@goto.info.waseda.ac.jp">fukusima@goto.info.waseda.ac.jp</A><BR>
182
+ </P>
183
+ </BODY>
184
+ </HTML>