2 * Copyright (C) 1995, 1997-1999, 2002 Jeffrey A. Uphoff
3 * Major rewrite by Olaf Kirch, Dec. 1996.
8 #include <netinet/in.h>
11 * Primary information structure.
14 mon mon; /* Big honkin' NSM structure. */
15 struct in_addr addr; /* IP address for callback. */
16 unsigned short port; /* port number for callback */
17 short int times; /* Counter used for various things. */
18 int state; /* For storing notified state for callbacks. */
19 struct notify_list *next; /* Linked list forward pointer. */
20 struct notify_list *prev; /* Linked list backward pointer. */
21 u_int32_t xid; /* XID of MS_NOTIFY RPC call */
22 time_t when; /* notify: timeout for re-xmit */
23 int type; /* type of notify (REBOOT/CALLBACK) */
26 typedef struct notify_list notify_list;
28 #define NOTIFY_REBOOT 0 /* notify remote of our reboot */
29 #define NOTIFY_CALLBACK 1 /* notify client of remote reboot */
34 extern notify_list * rtnl; /* Run-time notify list */
35 extern notify_list * notify; /* Pending RPC calls */
38 * List-handling functions
40 extern notify_list * nlist_new(char *, char *, int);
41 extern void nlist_insert(notify_list **, notify_list *);
42 extern void nlist_remove(notify_list **, notify_list *);
43 extern void nlist_insert_timer(notify_list **, notify_list *);
44 extern notify_list * nlist_clone(notify_list *);
45 extern void nlist_free(notify_list **, notify_list *);
46 extern void nlist_kill(notify_list **);
47 extern notify_list * nlist_gethost(notify_list *, char *, int);
50 * List-handling macros.
51 * THESE INHERIT INFORMATION FROM PREVIOUSLY-DEFINED MACROS.
52 * (So don't change their order unless you study them first!)
54 #define NL_NEXT(L) ((L)->next)
55 #define NL_FIRST NL_NEXT
56 #define NL_PREV(L) ((L)->prev)
57 #define NL_DATA(L) ((L)->mon)
58 #define NL_ADDR(L) ((L)->addr)
59 #define NL_STATE(L) ((L)->state)
60 #define NL_TIMES(L) ((L)->times)
61 #define NL_MON_ID(L) (NL_DATA((L)).mon_id)
62 #define NL_PRIV(L) (NL_DATA((L)).priv)
63 #define NL_MON_NAME(L) (NL_MON_ID((L)).mon_name)
64 #define NL_MY_ID(L) (NL_MON_ID((L)).my_id)
65 #define NL_MY_NAME(L) (NL_MY_ID((L)).my_name)
66 #define NL_MY_PROC(L) (NL_MY_ID((L)).my_proc)
67 #define NL_MY_PROG(L) (NL_MY_ID((L)).my_prog)
68 #define NL_MY_VERS(L) (NL_MY_ID((L)).my_vers)
69 #define NL_WHEN(L) ((L)->when)
70 #define NL_TYPE(L) ((L)->type)