2b45e011ca
When the series of commits is complete, things like https://cert.litnet.lt/en/docs/ntp-distributed-reflection-dos-attacks should be fixed. PR: bin/148836 (except that we import a newer version) Asked by: Too many MFC after: 2 weeks
35 lines
488 B
C
35 lines
488 B
C
/*
|
|
* modetoa - return an asciized mode
|
|
*/
|
|
#include <stdio.h>
|
|
|
|
#include "lib_strbuf.h"
|
|
#include "ntp_stdlib.h"
|
|
|
|
const char *
|
|
modetoa(
|
|
int mode
|
|
)
|
|
{
|
|
char *bp;
|
|
static const char *modestrings[] = {
|
|
"unspec",
|
|
"sym_active",
|
|
"sym_passive",
|
|
"client",
|
|
"server",
|
|
"broadcast",
|
|
"control",
|
|
"private",
|
|
"bclient",
|
|
};
|
|
|
|
if (mode < 0 || mode >= COUNTOF(modestrings)) {
|
|
LIB_GETBUF(bp);
|
|
snprintf(bp, LIB_BUFLENGTH, "mode#%d", mode);
|
|
return bp;
|
|
}
|
|
|
|
return modestrings[mode];
|
|
}
|