ub_ctx_get_option

Modster, Anthony Anthony.Modster at Teledyne.com
Wed Jul 15 20:12:20 UTC 2020


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nlnetlabs.nl/pipermail/unbound-users/attachments/20200715/45a9a277/attachment.htm>


More information about the Unbound-users mailing list