[asterisk-dev] [Code Review] 4156: Test Suite: Allow setting snaplen & buffer_size for packet capturing

Kevin Harwell reviewboard at asterisk.org
Fri Nov 14 11:53:43 CST 2014



> On Nov. 13, 2014, 5:17 p.m., Kevin Harwell wrote:
> > /asterisk/trunk/lib/python/pcap_listener.py, lines 61-64
> > <https://reviewboard.asterisk.org/r/4156/diff/1/?file=68770#file68770line61>
> >
> >     Instead of checking for None here and then setting the value just set these as the defaults on the function parameters (similar to what you did on PcapFile _init_).
> 
> jbigelow wrote:
>     I thought of doing it that way while writing it but decided not to so that the defaults are in a single place and to keep things consistent in this area of code. Thoughts?

Typically, and if it is possible, you'd set the default on the function parameter, but I suppose it is somewhat a matter of taste.


- Kevin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4156/#review13757
-----------------------------------------------------------


On Nov. 6, 2014, 5:05 p.m., jbigelow wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4156/
> -----------------------------------------------------------
> 
> (Updated Nov. 6, 2014, 5:05 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: testsuite
> 
> 
> Description
> -------
> 
> This allows setting the snaplen and buffer_size for packet capturing. The defaults set are the same as the defaults that yappcap.PcapLive sets.
> 
> 
> Diffs
> -----
> 
>   /asterisk/trunk/lib/python/pcap_listener.py 5913 
>   /asterisk/trunk/lib/python/asterisk/test_case.py 5913 
>   /asterisk/trunk/lib/python/asterisk/pcap.py 5913 
> 
> Diff: https://reviewboard.asterisk.org/r/4156/diff/
> 
> 
> Testing
> -------
> 
> Used the options to set a lower snaplen and a higher buffer successfully.
> 
> 
> Thanks,
> 
> jbigelow
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20141114/833a7352/attachment-0001.html>


More information about the asterisk-dev mailing list