File: admin.h

package info (click to toggle)
ion 3.2.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 23,700 kB
  • ctags: 10,983
  • sloc: ansic: 141,798; sh: 22,848; makefile: 7,818; python: 1,638; sql: 311; perl: 197; awk: 178; xml: 50; java: 19
file content (126 lines) | stat: -rw-r--r-- 3,756 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/******************************************************************************
 **                           COPYRIGHT NOTICE
 **      (c) 2012 The Johns Hopkins University Applied Physics Laboratory
 **                         All rights reserved.
 **
 **     This material may only be used, modified, or reproduced by or for the
 **       U.S. Government pursuant to the license rights granted under
 **          FAR clause 52.227-14 or DFARS clauses 252.227-7013/7014
 **
 **     For any other permissions, please contact the Legal Office at JHU/APL.
 ******************************************************************************/

/*****************************************************************************
 **
 ** \file admin.h
 **
 **
 ** Description: Administrative primitives.
 **
 ** Notes:
 **
 ** Assumptions:
 **
 ** Modification History:
 **  MM/DD/YY  AUTHOR         DESCRIPTION
 **  --------  ------------   ---------------------------------------------
 **  01/17/13  E. Birrane     Redesign of messaging architecture.
 **  06/24/13  E. Birrane     Migrated from uint32_t to time_t.
 *****************************************************************************/


#ifndef _ADMIN_H_
#define _ADMIN_H_


#include "shared/utils/nm_types.h"

/*
 * +--------------------------------------------------------------------------+
 * |							  CONSTANTS  								  +
 * +--------------------------------------------------------------------------+
 */



/*
 * +--------------------------------------------------------------------------+
 * |							  	MACROS  								  +
 * +--------------------------------------------------------------------------+
 */


/*
 * +--------------------------------------------------------------------------+
 * |							  DATA TYPES  								  +
 * +--------------------------------------------------------------------------+
 */


/*
 * Associated Message Type: MSG_TYPE_ADMIN_REG_AGENT
 * Purpose: Notify manager of discovered agent.
 * +-------+----------+
 * | Size  | Agent ID |
 * | (SDNV)| (var)    |
 * +-------+----------+
 */
typedef struct {
	eid_t agent_id;       /**> ID of the agent being registered. */
} adm_reg_agent_t;


/*
 * Associated Message Type: MSG_TYPE_ADMIN_RPT_POLICY
 * Purpose: Set the reporting policy on an agent.
 *
 * +-------+--------+-------+-------+----------+
 * | Alert |  Warn  | Error |  Log  | Reserved |
 * +-------+--------+-------+-------+----------+
 * |   0   |    1   |    2  |    3  |  4 5 6 7 |
 * +-------+--------+-------+-------+----------+
 * LSB                                     MSB
 */
typedef struct {
    uint8_t mask;         /**> Reporting Policy Mask. */
} adm_rpt_policy_t;


/*
 * Associated Message Type: MSG_TYPE_ADMIN_STAT_MSG
 * Purpose: Report status from an agent.
 *  +------+------+------------+
 *  | Code | Time | Generators |
 *  |(MID) | (TS) |    (MC)    |
 *  +------+------+------------+
 */
typedef struct {
    mid_t *code;          /**> Status Code. */
	time_t time;          /**> Time when code occurred. */
	Lyst generators;      /**> MID list of generators. */
} adm_stat_msg_t;


/*
 * +--------------------------------------------------------------------------+
 * |						  FUNCTION PROTOTYPES  							  +
 * +--------------------------------------------------------------------------+
 */


/* Create functions. */
adm_reg_agent_t *msg_create_reg_agent(eid_t eid);

adm_rpt_policy_t *msg_create_rpt_policy(uint8_t mask);

adm_stat_msg_t *msg_create_stat_msg(mid_t *code,
								    time_t time,
									Lyst generators);

/* Release functions.*/
void msg_release_reg_agent(adm_reg_agent_t *msg);
void msg_release_rpt_policy(adm_rpt_policy_t *msg);
void msg_release_stat_msg(adm_stat_msg_t *msg);


#endif /* _ADMIN_H_ */