tcpdump mailing list archives
Re: supporting extend 'open live capture' parametes
From: Guy Harris <guy () alum mit edu>
Date: Sun, 13 Jan 2008 13:08:39 -0800
Michael Richardson wrote:
What problem is the ultra-open parameter list supposed to solve?
1) allow open options to be added without having to change the signature of the open-live routine, so that we don't have to anticipate all the options that might ever want to be added.
2) allow a application to inquire which particular options are available for a particular device, so it could, for example, not present UI for turning on 802.11 monitor mode if it's not available, and present UI for selecting an 802.11 channel to monitor that shows only the available channels, or, for a command-line utility, list the available options for a particular device.
And possibly 3) allow options to be selectively supplied, so that we don't have to come up with "no value supplied" values for options that an app might not supply (e.g., buffer size for an app that wants the default).
My experience is that you either make it a structure and deal with possibly versioning it,
I.e.: struct open_options { int version; /* actual options follow */ }; struct open_options_v1 { int version; /* = 1 */ options go here; }; struct open_options_v2 { int version; /* = 2 */ a bigger set of options go here */ };
you make it a string and let the library parse it, or you go whole-hog, and make it XML.
It's probably easier to construct the option list then to construct the string, and to parse the option list than to parse the string (especially if it's XML).
- This is the tcpdump-workers list. Visit https://cod.sandelman.ca/ to unsubscribe.
Current thread:
- Re: setting the initial ring size, (continued)
- Re: setting the initial ring size Andy Howell (Jan 07)
- Re: setting the initial ring size Guy Harris (Jan 09)
- Re: setting the initial ring size Abeni Paolo (Jan 10)
- Re: setting the initial ring size Guy Harris (Jan 10)
- Re: supporting extend 'open live capture' parametes [was: setting the initial ring size] Abeni Paolo (Jan 10)
- Re: supporting extend 'open live capture' parametes Guy Harris (Jan 10)
- Re: supporting extend 'open live capture' parametes Andy Howell (Jan 10)
- Re: supporting extend 'open live capture' parametes Guy Harris (Jan 10)
- Re: supporting extend 'open live capture' parametes Andy Howell (Jan 11)
- Re: supporting extend 'open live capture' parametes Michael Richardson (Jan 13)
- Re: supporting extend 'open live capture' parametes Guy Harris (Jan 13)
- Re: supporting extend 'open live capture' parametes Michael Richardson (Jan 13)
- Re: supporting extend 'open live capture' parametes Guy Harris (Jan 15)
- Re: setting the initial ring size Guy Harris (Jan 09)
- Re: setting the initial ring size Andy Howell (Jan 07)