[netcf-devel] [PATCH] Implement ncf_if_status()

David Lutterkort lutter at redhat.com
Mon Oct 26 10:00:53 UTC 2009


On Thu, 2009-10-22 at 17:37 -0400, Laine Stump wrote:
> Here's a first draft of a suggested new API, subject to change based
> on comments.
> 
> ncf_if_status returns various status bits about the given interface. As a
> start, only a single bit is defined:
> 
>        NETCF_IFACE_STATUS_UP
> 
> This bit is set if the interface is currently up (active) and not set if it
> is currently down (inactive).
> 
> The value of all other bits should be considered random by an
> application program, as later versions of netcf may use them. In other
> words, you should always mask out all the other bits.

This all looks good, one question though:

> diff --git a/src/netcf.h b/src/netcf.h
> index a8619f5..0e1d4bd 100644
> --- a/src/netcf.h
> +++ b/src/netcf.h
> @@ -163,6 +163,15 @@ char *ncf_if_xml_desc(struct netcf_if *);
>   */
>  char *ncf_if_xml_state(struct netcf_if *);
>  
> +typedef enum {
> +    NETCF_IFACE_STATUS_UP = 1,
> +} ncf_if_status_flags;

How about reusing the existing type netcf_if_flag_t ? Longer term, it
seems to me that we would want to filter interface lists by the same
criteria that we list as status for each of them. For consistency, we
should also call this type ncf_if_status_flags_t, since all the other
types have a _t at the end.

David




More information about the netcf-devel mailing list