The node is explicitly told which of the links are up via the NGM_ONE2MANY_SET_CONFIG control message (see below). Newly connected links are down until configured otherwise.
NG_ONE2MANY_FAIL_NOTIFY
The node listens to flow control message from many hooks, and considers link failed if NGM_LINK_IS_DOWN is received. If the NGM_LINK_IS_UP message is received, node considers link active.
In the future other algorithms may be added as well.
When all links are considered failed, node sends the NGM_LINK_IS_DOWN message towards the one hook. When at least one link comes up, node sends the NGM_LINK_IS_UP message towards the one hook.
Sets the node configuration using a "struct ng_one2many_link_config" as the control message argument:
/* Node configuration structure */
struct ng_one2many_config {
u_int32_t xmitAlg; /* how to distribute packets */
u_int32_t failAlg; /* how to detect link failure */
u_char enabledLinks[NG_ONE2MANY_MAX_LINKS];
};
Currently, the valid settings for the xmitAlg field are NG_ONE2MANY_XMIT_ROUNDROBIN (default) or NG_ONE2MANY_XMIT_ALL. The only valid setting for failAlg is NG_ONE2MANY_FAIL_MANUAL; this is also the default setting.
NGM_ONE2MANY_GET_CONFIG
Returns the current node configuration in a "struct ng_one2many_link_config".
NGM_ONE2MANY_GET_STATS
This command takes a 32 bit link number as an argument and returns a "struct ng_one2many_link_stats" containing statistics for the corresponding many link, which may or may not be currently connected:
/* Statistics structure (one for each link) */
struct ng_one2many_link_stats {
u_int64_t recvOctets;/* total octets recd on link */
u_int64_t recvPackets; /* total pkts recd on link */
u_int64_t xmitOctets;/* total octets xmitd on link */
u_int64_t xmitPackets; /* total pkts xmitd on link */
};
To access statistics for the one link, use the link number -1.
NGM_ONE2MANY_CLR_STATS
This command takes a 32 bit link number as an argument and clears the statistics for that link.
NGM_ONE2MANY_GETCLR_STATS
Same as NGM_ONE2MANY_GET_STATS, but also atomically clears the statistics for the link as well.