ub_ctx_get_option

Hello

Can ub_ctx_get_option() be used to get parameter outgoing-interface ?

The results from the below code:

main ub_ctx_get_option() ok

main optval is set

And the unbound.conf has the following:

is used. Specify every interface on a ‘outgoing-interface:’ line.

outgoing-interface: 192.0.2.153

outgoing-interface: 10.112.206.115

outgoing-interface: 2001:DB8::5

outgoing-interface: 2001:DB8::6

outgoing-interface: 2001:DB8::/64

/* test API get / set configuration options

*/

char *optval;

int status = ub_ctx_get_option( ctx, “outgoing-interface”, &optval );

if( status == 0 )

{

printf(“%s ub_ctx_get_option() ok\n”, func);

if( optval )

{

printf(“%s optval is set\n”, func);

if( strlen( optval ) )

printf(“%s optval %s\n”, func, optval);

free( optval );

}

else

{

printf(“%s optval is NULL\n”, func);

}

}

else

{

printf(“%s ub_ctx_get_option() error %s\n”, func, ub_strerror( status ) );

}

Thanks