msgtype.c 1.85 KB
Newer Older
1 2 3 4 5 6 7 8
#include <ppsi/ppsi.h>

/*
 * PP_NP_GEN/EVT is the event or general message. It selects the socket etc
 * PP_P2P_MECH is used to select a destination address for pdelay frames.
 * the numeric 0..5 is the "controlField" (magic ptpV1 numbers in byte 32).
 * PP_LOG is the kind of logInterval to put in byte 33.
 */
9 10 11
struct pp_msgtype_info pp_msgtype_info[] = {
	[PPM_SYNC_FMT] = {
		PPM_SYNC, PP_SYNC_LENGTH,
12
		PP_NP_EVT, PP_E2E_MECH,  0, PP_LOG_SYNC },
13 14
	[PPM_DELAY_REQ_FMT] = {
			PPM_DELAY_REQ, PP_DELAY_REQ_LENGTH,
15
		PP_NP_EVT, PP_E2E_MECH, 1, 0x7f },
16 17
	[PPM_PDELAY_REQ_FMT] = {
			PPM_PDELAY_REQ,PP_PDELAY_REQ_LENGTH,
18
		PP_NP_EVT, PP_P2P_MECH, 5, 0x7f },
19 20
	[PPM_PDELAY_RESP_FMT] = {
			PPM_PDELAY_RESP, PP_PDELAY_RESP_LENGTH,
21
		PP_NP_EVT, PP_P2P_MECH, 5, 0x7f },
22 23
	[PPM_FOLLOW_UP_FMT] = {
			PPM_FOLLOW_UP, PP_FOLLOW_UP_LENGTH,
24
		PP_NP_GEN, PP_E2E_MECH, 2, PP_LOG_SYNC },
25 26
	[PPM_DELAY_RESP_FMT] = {
			PPM_DELAY_RESP, PP_DELAY_RESP_LENGTH,
27
		PP_NP_GEN, PP_E2E_MECH, 3, PP_LOG_REQUEST },
28 29
	[PPM_PDELAY_R_FUP_FMT] = {
			PPM_PDELAY_R_FUP, PP_PDELAY_RESP_FOLLOW_UP_LENGTH,
30
		PP_NP_GEN, PP_P2P_MECH, 5, 0x7f },
31 32
	[PPM_ANNOUNCE_FMT] = {
			PPM_ANNOUNCE, PP_ANNOUNCE_LENGTH,
33
		PP_NP_GEN, PP_E2E_MECH, 5, PP_LOG_ANNOUNCE},
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
	[PPM_SIGNALING_FMT] = {
			PPM_SIGNALING, -1,
		PP_NP_GEN, PP_E2E_MECH, 5, 0x7f},
	[PPM_SIGNALING_NO_FWD_FMT] = {
			PPM_SIGNALING, -1,
			PP_NP_GEN, PP_P2P_MECH, 5, 0x7f},
/* We don't use management, or not in the table-driven code */
	[PPM_MANAGEMENT_FMT] = { PPM_MANAGEMENT, -1, PP_NP_GEN, PP_E2E_MECH, 4, 0x7f},
};

char  *pp_msgtype_name[] = {
	[PPM_SYNC] = "sync",
	[PPM_DELAY_REQ] = "delay_req",
	[PPM_PDELAY_REQ] = "pdelay_req",
	[PPM_PDELAY_RESP] ="pdelay_resp",
	[PPM_FOLLOW_UP] = "follow_up",
	[PPM_DELAY_RESP] ="delay_resp",
	[PPM_PDELAY_R_FUP] ="pdelay_resp_follow_up",
	[PPM_ANNOUNCE] ="announce",
	[PPM_SIGNALING] ="signaling",
	[PPM_MANAGEMENT] ="management"
55
};