summaryrefslogtreecommitdiffstats
path: root/tests/nsm_client/nlm_sm_inter.x
blob: 95fa326bb411cdd513cc7a0bf337c19369570660 (plain)
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
/*
 * Copyright (C) 1995, 1997-1999 Jeffrey A. Uphoff
 * Modified by Olaf Kirch, 1996.
 * Modified by H.J. Lu, 1998.
 * Modified by Jeff Layton, 2010.
 *
 * NLM similator for Linux
 */

#ifdef RPC_CLNT
%#include <string.h>
#endif

/*
 * statd rejects monitor registrations for any non-lockd services, so pretend
 * to be lockd when testing. Furthermore, the only call we care about from
 * statd is #16, which is the downcall to notify the kernel of a host's status
 * change.
 */
program NLM_SM_PROG {
	/* version 3 of the NLM protocol */
	version NLM_SM_VERS3 {
		void	 NLM_SM_NOTIFY(struct nlm_sm_notify) = 16;
	} = 3;

	/* version 2 of NLM protocol */
	version NLM_SM_VERS4 {
		void	 NLM_SM_NOTIFY(struct nlm_sm_notify) = 16;
	} = 4;
} = 100021;

const  SM_MAXSTRLEN = 1024;
const  SM_PRIV_SIZE = 16;

/*
 * structure of the status message sent back by the status monitor
 * when monitor site status changes
 */
struct nlm_sm_notify {
	string mon_name<SM_MAXSTRLEN>;
	int state;
	opaque priv[SM_PRIV_SIZE]; /* stored private information */
};