ntp_control.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright (c) 1996 by Sun Microsystems, Inc.
* All Rights Reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ntp_control.h - definitions related to NTP mode 6 control messages
*/
#include "ntp_types.h"
struct ntp_control {
};
/*
* Length of the control header, in octets
*/
#define CTL_HEADER_LEN 12
#define CTL_MAX_DATA_LEN 468
/*
* Limits and things
*/
/*
* Decoding for the r_m_e_op field
*/
#define CTL_RESPONSE 0x80
#define CTL_ERROR 0x40
#define CTL_MORE 0x20
#define CTL_OP_MASK 0x1f
/*
* Opcodes
*/
#define CTL_OP_UNSPEC 0
#define CTL_OP_READSTAT 1
#define CTL_OP_READVAR 2
#define CTL_OP_WRITEVAR 3
#define CTL_OP_READCLOCK 4
#define CTL_OP_WRITECLOCK 5
#define CTL_OP_SETTRAP 6
#define CTL_OP_ASYNCMSG 7
#define CTL_OP_UNSETTRAP 31
/*
* {En,De}coding of the system status word
*/
#define CTL_SST_TS_UNSPEC 0 /* time source unspecified */
#define CTL_SYS_MAXEVENTS 15
((evnt)&0x000f))
/*
* {En,De}coding of the peer status word
*/
#define CTL_PST_CONFIG 0x80
#define CTL_PST_AUTHENABLE 0x40
#define CTL_PST_AUTHENTIC 0x20
#define CTL_PST_REACH 0x10
#define CTL_PST_UNSPEC 0x08
#define CTL_PST_SEL_REJECT 0 /* rejected */
#define CTL_PEER_MAXEVENTS 15
((evnt) & 0x000f))
/*
* {En,De}coding of the clock status word
*/
#define CTL_CLK_OKAY 0
#define CTL_CLK_NOREPLY 1
#define CTL_CLK_BADFORMAT 2
#define CTL_CLK_FAULT 3
#define CTL_CLK_PROPAGATION 4
#define CTL_CLK_BADDATE 5
#define CTL_CLK_BADTIME 6
((event) & 0x00ff))
/*
* Error code responses returned when the E bit is set.
*/
#define CERR_UNSPEC 0
#define CERR_PERMISSION 1
#define CERR_BADFMT 2
#define CERR_BADOP 3
#define CERR_BADASSOC 4
#define CERR_UNKNOWNVAR 5
#define CERR_BADVALUE 6
#define CERR_RESTRICT 7
/*
* System variables we understand
*/
#define CS_LEAP 1
#define CS_STRATUM 2
#define CS_PRECISION 3
#define CS_ROOTDELAY 4
#define CS_ROOTDISPERSION 5
#define CS_REFID 6
#define CS_REFTIME 7
#define CS_POLL 8
#define CS_PEERID 9
#define CS_OFFSET 10
#define CS_DRIFT 11
#define CS_COMPLIANCE 12
#define CS_CLOCK 13
#define CS_LEAPIND 14
#define CS_LEAPWARNING 15
#define CS_PROCESSOR 16
#define CS_SYSTEM 17
#define CS_KEYID 18
#define CS_REFSKEW 19
#define CS_VARLIST 20
#define CS_MAXCODE CS_VARLIST
/*
* Peer variables we understand
*/
#define CP_CONFIG 1
#define CP_AUTHENABLE 2
#define CP_AUTHENTIC 3
#define CP_SRCADR 4
#define CP_SRCPORT 5
#define CP_DSTADR 6
#define CP_DSTPORT 7
#define CP_LEAP 8
#define CP_HMODE 9
#define CP_STRATUM 10
#define CP_PPOLL 11
#define CP_HPOLL 12
#define CP_PRECISION 13
#define CP_ROOTDELAY 14
#define CP_ROOTDISPERSION 15
#define CP_REFID 16
#define CP_REFTIME 17
#define CP_ORG 18
#define CP_REC 19
#define CP_XMT 20
#define CP_REACH 21
#define CP_VALID 22
#define CP_TIMER 23
#define CP_DELAY 24
#define CP_OFFSET 25
#define CP_DISPERSION 26
#define CP_KEYID 27
#define CP_FILTDELAY 28
#define CP_FILTOFFSET 29
#define CP_PMODE 30
#define CP_RECEIVED 31
#define CP_SENT 32
#define CP_FILTERROR 33
#define CP_FLASH 34
#define CP_DISP 35
#define CP_VARLIST 36
#define CP_MAXCODE CP_VARLIST
/*
* Clock variables we understand
*/
#define CC_TYPE 1
#define CC_TIMECODE 2
#define CC_POLL 3
#define CC_NOREPLY 4
#define CC_BADFORMAT 5
#define CC_BADDATA 6
#define CC_FUDGETIME1 7
#define CC_FUDGETIME2 8
#define CC_FUDGEVAL1 9
#define CC_FUDGEVAL2 10
#define CC_FLAGS 11
#define CC_DEVICE 12
#define CC_VARLIST 13
#define CC_MAXCODE CC_VARLIST
/*
* Definition of the structure used internally to hold trap information.
* ntp_request.c wants to see this.
*/
struct ctl_trap {
};
/*
* Flag bits
*/
/*
* Types of things we may deal with
* shared between ntpq and library
*/
#define TYPE_SYS 1
#define TYPE_PEER 2
#define TYPE_CLOCK 3