Re: [PATCH 0/6] Add support for interface binding

Bart Van Assche <[email protected]>
Newsgroups gmane.network.net-snmp.devel
Message-ID <[email protected]>
On 1/23/19 9:43 AM, Bill Fenner wrote:
> The pattern I was trying to follow from the existing code appeared to be 
> basically
> 
> if (cp == delimiter of optional section) {
>      *cp = '\0'; /* terminate previous section at delimiter */
>      this = cp + 1; /* handle this section */
>      cp = ... /* find next optional delimiter or NULL */
> }
> 
> Are you suggesting instead to put the "find next optional delimiter" 
> code between sections, e.g.,
> 
> /* parse IP address, cp still points at beginning of address */
> maybeintf = strchr( cp, '@' );
> if (maybeintf) {
>     *maybeintf = '\0';
>     cp = maybeintf + 1;
>     intf = cp;
> }
> maybens = strchr( cp, '@' );
> if (maybens) {
> ...
> }
> maybeport = strchr( cp, ':' );
> if (maybeport) {
> ...
> }

Hi Bill,

No matter which approach will be chosen, please add test cases into 
testing/fulltests/unit-tests/T022netsnmp_parse_ep_str_clib.c.

Thanks,

Bart.


_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.