X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fstatd%2Fnotlist.h;h=f915ae1a88e80b62dd087cde6b3ba4e98b04eb31;hp=0c6709ca7dd4dccaf8cc484e9906bd53c7cb03ea;hb=4f3f745c172202bf3846f8f1ee5d0a430b6014af;hpb=8b7ad01b14df1e7529b9ba8a1ea17df0d6004ef9 diff --git a/utils/statd/notlist.h b/utils/statd/notlist.h index 0c6709c..f915ae1 100644 --- a/utils/statd/notlist.h +++ b/utils/statd/notlist.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995, 1997-1999 Jeffrey A. Uphoff + * Copyright (C) 1995, 1997-1999, 2002 Jeffrey A. Uphoff * Major rewrite by Olaf Kirch, Dec. 1996. * * NSM for Linux. @@ -13,21 +13,19 @@ struct notify_list { mon mon; /* Big honkin' NSM structure. */ struct in_addr addr; /* IP address for callback. */ - unsigned short port; /* port number for callback */ + in_port_t port; /* port number for callback */ short int times; /* Counter used for various things. */ int state; /* For storing notified state for callbacks. */ + char *dns_name; /* used for matching incoming + * NOTIFY requests */ struct notify_list *next; /* Linked list forward pointer. */ struct notify_list *prev; /* Linked list backward pointer. */ - u_int32_t xid; /* XID of MS_NOTIFY RPC call */ + uint32_t xid; /* XID of MS_NOTIFY RPC call */ time_t when; /* notify: timeout for re-xmit */ - int type; /* type of notify (REBOOT/CALLBACK) */ }; typedef struct notify_list notify_list; -#define NOTIFY_REBOOT 0 /* notify remote of our reboot */ -#define NOTIFY_CALLBACK 1 /* notify client of remote reboot */ - /* * Global Variables */ @@ -67,45 +65,3 @@ extern notify_list * nlist_gethost(notify_list *, char *, int); #define NL_MY_PROG(L) (NL_MY_ID((L)).my_prog) #define NL_MY_VERS(L) (NL_MY_ID((L)).my_vers) #define NL_WHEN(L) ((L)->when) -#define NL_TYPE(L) ((L)->type) - -#if 0 -#define NL_ADD_NO_ZERO(LIST, ITEM)\ - NL_PREV(NL_FIRST((LIST))) = (ITEM);\ - NL_NEXT((ITEM)) = NL_FIRST((LIST));\ - NL_FIRST((LIST)) = (ITEM);\ - NL_PREV((ITEM)) = (LIST);\ - NL_TIMES((ITEM)) = 0; - -#define NL_ADD(LIST, ITEM)\ - NL_ADD_NO_ZERO((LIST), (ITEM));\ - NL_ADDR((ITEM)) = 0;\ - NL_STATE((ITEM)) = 0; - -#define NL_DEL(ITEM)\ - NL_NEXT(NL_PREV((ITEM))) = NL_NEXT((ITEM));\ - NL_PREV(NL_NEXT((ITEM))) = NL_PREV((ITEM)); - -#define NL_FREE(ITEM)\ - if (NL_MY_NAME ((ITEM)))\ - free (NL_MY_NAME ((ITEM)));\ - if (NL_MON_NAME ((ITEM)))\ - free (NL_MON_NAME((ITEM)));\ - free ((ITEM)); - -#define NL_DEL_FREE(ITEM)\ - NL_DEL((ITEM))\ - NL_FREE((ITEM)) - -/* Yuck. Kludge. */ -#define NL_COPY(SRC, DEST)\ - NL_TIMES((DEST)) = NL_TIMES((SRC));\ - NL_STATE((DEST)) = NL_TIMES((SRC));\ - NL_MY_PROC((DEST)) = NL_MY_PROC((SRC));\ - NL_MY_PROG((DEST)) = NL_MY_PROG((SRC));\ - NL_MY_VERS((DEST)) = NL_MY_VERS((SRC));\ - NL_MON_NAME((DEST)) = xstrdup (NL_MON_NAME((SRC)));\ - NL_MY_NAME((DEST)) = xstrdup (NL_MY_NAME((SRC)));\ - memcpy (&NL_ADDR((DEST)), &NL_ADDR((SRC)), sizeof (u_long));\ - memcpy (NL_PRIV((DEST)), NL_PRIV((SRC)), SM_PRIV_SIZE); -#endif