/
Capture.html
160 lines (139 loc) · 4.44 KB
/
Capture.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<HTML>
<!-- THIS FILE IS GENERATED FROM ANOTHER SOURCE FILE -->
<HEAD>
<TITLE>Capture</TITLE>
</HEAD>
<BODY BGCOLOR="ffffff">
<DL>
<DT><H1>Capture</H1></DT>
<DD>
Packet Capture Object
</DD>
<DT><H2>Super Class:</H2></DT>
<DD><DL><DT><A HREF="http://www.ruby-lang.org/en/man-1.4/Object.html"><CODE>Object</CODE></A></DT></DL></DD>
<DT><H2>Included Modules:</H2></DT>
<DL>
<DT><A HREF="http://www.ruby-lang.org/en/man-1.4/Enum.html"><CODE>Enumerable</CODE></A></DT>
</DL>
<DT><H2>Class Methods:</H2></DT>
<DL COMPACT>
<DT>
<A NAME=".open_live"><CODE>open_live(<var>device</var>[, <var>snaplen</var>[, <var>promisc</var>[, <var>to_ms</var>]]])</CODE></A>
<DD>
<p>
Open specified device and return <CODE>Capture</CODE>
object.
Default value for <VAR>snaplen</VAR>,
<VAR>promisc</VAR> and <VAR>to_ms</VAR> are 68 octets,
<CODE>true</CODE> and 1000 milliseconds.
</p>
<DT>
<A NAME=".open_offline"><CODE>open_offline(<var>filename</var>)</CODE></A>
<DD>
<p>
Open <VAR>filename</VAR> and return <CODE>Capture</CODE> object.
</p>
<DT>
<A NAME=".open_dead"><CODE>open_dead([<var>linktype</var>[, <var>snaplen</var>]])</CODE></A>
<DD>
<p>
Open fake <CODE>Capture</CODE> object.
Default value for <VAR>linktype<VAR> and <VAR>snaplen</VAR> are
<A HREF="Pcap.html#::DLT_EN10MB"><CODE>DLT_EN10MB</CODE></A> and 68 octets.
</p>
</DL>
<DT><H2>Methods:</H2></DT>
<DL COMPACT>
<DT>
<A NAME="close"><CODE>close</CODE></A>
<DD>
<p>
Close <CODE>Capture</CODE> object.
</p>
<DT>
<A NAME="datalink"><CODE>datalink</CODE></A>
<DD>
<p>
Return an integer representing data-link type.
(e.g. <A HREF="Pcap.html#::DLT_EN10MB"><CODE>DLT_EN10MB</CODE></A>)
</p>
<DT>
<A NAME="dispatch"><CODE>dispatch([<var>count</var>]) {|<var>packet</var>|...}</CODE></A>
<DD>
<p>
<P>
Iterate over each packet. The argument given to the block
is an instance of <A HREF="Packet.html"><CODE>Packet</CODE></A> or its sub-class.
</P>
<P>
<VAR>count</VAR> specifies the maximum number of packets to
process. a <VAR>count</VAR> of -1 processes all the packets
received in one buffer. a <VAR>count</VAR> of 0 processes all
packets until an error occurs, EOF is reached, or the read
times out.
Default of <VAR>count</VAR> is -1.
</P>
</p>
<DT>
<A NAME="each_packet"><CODE>each_packet([<var>count</var>]) {|<var>packet</var>|...}</CODE></A>
<DD>
<DT>
<A NAME="each"><CODE>each([<var>count</var>]) {|<var>packet</var>|...}</CODE></A>
<DD>
<DT>
<A NAME="loop"><CODE>loop([<var>count</var>]) {|<var>packet</var>|...}</CODE></A>
<DD>
<p>
<P>
Iterate over each packet. The argument given to the block
is an instance of <A HREF="Packet.html"><CODE>Packet</CODE></A> or its sub-class.
</P>
<P>
<VAR>count</VAR> specifies the maximum number of packets to
process. A negative <VAR>count</VAR> processes packets forever
or until EOF is reached. Default of <VAR>count</VAR> is -1.
</P>
</p>
<DT>
<A NAME="snapshot"><CODE>snapshot</CODE></A>
<DD>
<DT>
<A NAME="snaplen"><CODE>snaplen</CODE></A>
<DD>
<p>
Return the snapshot length.
</p>
<DT>
<A NAME="setfilter"><CODE>setfilter(<var>filter</var>[, <var>optimize</var>])</CODE></A>
<DD>
<p>
Specify <VAR>filter</VAR> as packet filter.
<VAR>filter</VAR> can be a string or a <A HREF="Filter.html"><CODE>Filter</CODE></A> object.
<VAR>optimize</VAR> controls whether optimization is performed.
Default of <VAR>optimize</VAR> is <CODE>true</CODE>.
</p>
<DT>
<A NAME="stats"><CODE>stats</CODE></A>
<DD>
<p>
Return a <A HREF="http://www.ruby-lang.org/en/man-1.4/Struct.html"><CODE>Struct</CODE></A> which represents packet statistics.
This struct has following members.
<BLOCKQUOTE>
<DL COMPACT>
<DT><CODE>recv</CODE></DT><DD>number of received packets</DD><DT><CODE>drop</CODE></DT><DD>number of dropped packets</DD></DL>
</BLOCKQUOTE>
</p>
<DT>
<A NAME="inject"><CODE>inject(<var>buf</var>)</CODE></A>
<DD>
<p>
Inject <VAR>buf</VAR> as a packet.
</p>
</DL>
</DL>
<HR>
<P ALIGN="RIGHT">
<A HREF="mailto:fukusima@goto.info.waseda.ac.jp">fukusima@goto.info.waseda.ac.jp</A><BR>
</P>
</BODY>
</HTML>