ntp: refactor switching between online and offline state

Use an enum to describe connectivity of a source and merge
the NCR and NSR TakeSourceOnline/Offline() functions into
SetConnectivity() functions.
This commit is contained in:
Miroslav Lichvar
2018-05-24 13:42:52 +02:00
parent 2962fc6286
commit ce6b896948
10 changed files with 78 additions and 113 deletions

View File

@@ -29,10 +29,15 @@
#include "sources.h"
typedef enum {
SRC_OFFLINE,
SRC_ONLINE,
} SRC_Connectivity;
typedef struct {
int minpoll;
int maxpoll;
int online;
SRC_Connectivity connectivity;
int auto_offline;
int presend_minpoll;
int burst;