Skip to content

Commit 5b7d9da

Browse files
committed
Update libpcap module HOWTO for the current API.
Spell pcapint_add_any_dev() and pcapint_install_bpf_program(). [skip ci]
1 parent 3474b3e commit 5b7d9da

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

htmlsrc/libpcap-module-HOWTO.html

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ <h2 class="title">Where to start</h2>
105105
<h2 class="title">The list device instances routine (most generic case)</h2>
106106
<div class="entry">
107107
<p>
108-
The "list of device instances" routine takes, as arguments:
108+
The "list device instances" routine takes, as arguments:
109109
</p>
110110
<ul>
111111
<li>a pointer to a <code>pcap_if_list_t</code>;</li>
@@ -159,6 +159,13 @@ <h2 class="title">The list device instances routine (most generic case)</h2>
159159
message buffer has been filled in with an error string, and your
160160
routine must return <code>PCAP_ERROR</code> to indicate the error.
161161
</p>
162+
<p>
163+
If the module is the only module that is adding network interfaces
164+
to the list of capture devices and it supports the "any"
165+
pseudo-interface, the "list device instances" routine can call the
166+
<b>pcapint_add_any_dev</b>() routine to add the pseudo-interface to
167+
the list.
168+
</p>
162169
<p>
163170
If your routine succeeds, it must return 0. If it fails, it must
164171
fill in the error message buffer with an error string and return
@@ -546,7 +553,7 @@ <h2 class="title">The setfilter routine</h2>
546553
<code>BPF_MOD</code> or <code>BPF_XOR</code> instructions&mdash;the
547554
module should fall
548555
back on filtering in userland by saving a copy of the filter with a
549-
call to <b>install_bpf_program</b>(), setting a flag in the
556+
call to <b>pcapint_install_bpf_program</b>(), setting a flag in the
550557
private data instructure indicating that filtering is being done by
551558
the module and, in the read routine's main loop, checking the flag
552559
and, if it's set, calling <b>pcapint_filter</b>(),
@@ -557,7 +564,7 @@ <h2 class="title">The setfilter routine</h2>
557564
<b>pcapint_filter</b>() returns a non-zero value. (If the flag is not
558565
set, all packets should be passed to the callback routine and
559566
counted, as the filtering is being done by the mechanism used by the
560-
module.) If <b>install_bpf_program</b>() returns a negative
567+
module.) If <b>pcapint_install_bpf_program</b>() returns a negative
561568
value, the routine should return <code>PCAP_ERROR</code>.
562569
</p>
563570
<p>
@@ -582,13 +589,13 @@ <h2 class="title">The setfilter routine</h2>
582589
<p>
583590
If the attempt to set the filter succeeded, or it failed because the
584591
mechanism used by the module rejected it and the call to
585-
<b>install_bpf_program</b>() succeeded, the routine should
592+
<b>pcapint_install_bpf_program</b>() succeeded, the routine should
586593
return 0.
587594
</p>
588595
<p>
589596
If the mechanism the module uses doesn't support filtering, the
590597
pointer to the setfilter routine can just be set to point to
591-
<b>install_bpf_program</b>(); the module does not need a
598+
<b>pcapint_install_bpf_program</b>(); the module does not need a
592599
routine of its own to handle that.
593600
</p>
594601
</div>

libpcap-module-HOWTO.html

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ <h2 class="title">Where to start</h2>
149149
<h2 class="title">The list device instances routine (most generic case)</h2>
150150
<div class="entry">
151151
<p>
152-
The "list of device instances" routine takes, as arguments:
152+
The "list device instances" routine takes, as arguments:
153153
</p>
154154
<ul>
155155
<li>a pointer to a <code>pcap_if_list_t</code>;</li>
@@ -203,6 +203,13 @@ <h2 class="title">The list device instances routine (most generic case)</h2>
203203
message buffer has been filled in with an error string, and your
204204
routine must return <code>PCAP_ERROR</code> to indicate the error.
205205
</p>
206+
<p>
207+
If the module is the only module that is adding network interfaces
208+
to the list of capture devices and it supports the "any"
209+
pseudo-interface, the "list device instances" routine can call the
210+
<b>pcapint_add_any_dev</b>() routine to add the pseudo-interface to
211+
the list.
212+
</p>
206213
<p>
207214
If your routine succeeds, it must return 0. If it fails, it must
208215
fill in the error message buffer with an error string and return
@@ -590,7 +597,7 @@ <h2 class="title">The setfilter routine</h2>
590597
<code>BPF_MOD</code> or <code>BPF_XOR</code> instructions&mdash;the
591598
module should fall
592599
back on filtering in userland by saving a copy of the filter with a
593-
call to <b>install_bpf_program</b>(), setting a flag in the
600+
call to <b>pcapint_install_bpf_program</b>(), setting a flag in the
594601
private data instructure indicating that filtering is being done by
595602
the module and, in the read routine's main loop, checking the flag
596603
and, if it's set, calling <b>pcapint_filter</b>(),
@@ -601,7 +608,7 @@ <h2 class="title">The setfilter routine</h2>
601608
<b>pcapint_filter</b>() returns a non-zero value. (If the flag is not
602609
set, all packets should be passed to the callback routine and
603610
counted, as the filtering is being done by the mechanism used by the
604-
module.) If <b>install_bpf_program</b>() returns a negative
611+
module.) If <b>pcapint_install_bpf_program</b>() returns a negative
605612
value, the routine should return <code>PCAP_ERROR</code>.
606613
</p>
607614
<p>
@@ -626,13 +633,13 @@ <h2 class="title">The setfilter routine</h2>
626633
<p>
627634
If the attempt to set the filter succeeded, or it failed because the
628635
mechanism used by the module rejected it and the call to
629-
<b>install_bpf_program</b>() succeeded, the routine should
636+
<b>pcapint_install_bpf_program</b>() succeeded, the routine should
630637
return 0.
631638
</p>
632639
<p>
633640
If the mechanism the module uses doesn't support filtering, the
634641
pointer to the setfilter routine can just be set to point to
635-
<b>install_bpf_program</b>(); the module does not need a
642+
<b>pcapint_install_bpf_program</b>(); the module does not need a
636643
routine of its own to handle that.
637644
</p>
638645
</div>

0 commit comments

Comments
 (0)