freebsd-nq/sntp/tests/sntptest.h
Cy Schubert b5e14a1344 Vendor import ntp 4.2.8.
Reviewed by:	roberto
Security:	VUXML: 4033d826-87dd-11e4-9079-3c970e169bc2
Security:	http://www.kb.cert.org/vuls/id/852879
Security:	CVE-2014-9293
Security	CVE-2014-9294
Security	CVE-2014-9295
Security	CVE-2014-9296
2014-12-20 22:52:39 +00:00

36 lines
599 B
C++

#ifndef SNTPTEST_H
#define SNTPTEST_H
#include "tests_main.h"
extern "C" {
#include "ntp_stdlib.h"
#include "sntp-opts.h"
};
class sntptest : public ntptest {
protected:
sntptest() {
optionSaveState(&sntpOptions);
}
~sntptest() {
optionRestore(&sntpOptions);
}
void ActivateOption(const char* option, const char* argument) {
const int ARGV_SIZE = 4;
char* opts[ARGV_SIZE];
opts[0] = estrdup("sntpopts");
opts[1] = estrdup(option);
opts[2] = estrdup(argument);
opts[3] = estrdup("127.0.0.1");
optionProcess(&sntpOptions, ARGV_SIZE, opts);
}
};
#endif // SNTPTEST_H