config: count the interfaces as they are added.
This information is useful to the various clock types. Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
8f7fb11fbc
commit
63e530e297
2
config.c
2
config.c
|
@ -607,6 +607,8 @@ struct interface *config_create_interface(char *name, struct config *cfg)
|
||||||
strncpy(iface->name, name, MAX_IFNAME_SIZE);
|
strncpy(iface->name, name, MAX_IFNAME_SIZE);
|
||||||
sk_get_ts_info(iface->name, &iface->ts_info);
|
sk_get_ts_info(iface->name, &iface->ts_info);
|
||||||
STAILQ_INSERT_TAIL(&cfg->interfaces, iface, list);
|
STAILQ_INSERT_TAIL(&cfg->interfaces, iface, list);
|
||||||
|
cfg->n_interfaces++;
|
||||||
|
|
||||||
return iface;
|
return iface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
1
config.h
1
config.h
|
@ -41,6 +41,7 @@ struct interface {
|
||||||
struct config {
|
struct config {
|
||||||
/* configured interfaces */
|
/* configured interfaces */
|
||||||
STAILQ_HEAD(interfaces_head, interface) interfaces;
|
STAILQ_HEAD(interfaces_head, interface) interfaces;
|
||||||
|
int n_interfaces;
|
||||||
|
|
||||||
/* hash of all non-legacy items */
|
/* hash of all non-legacy items */
|
||||||
struct hash *htab;
|
struct hash *htab;
|
||||||
|
|
Loading…
Reference in New Issue