capdecls.h 1.23 KB
Newer Older
Leigh B. Stoller's avatar
Leigh B. Stoller committed
1 2 3 4
/*
 * EMULAB-COPYRIGHT
 * Copyright (c) 2000-2002 University of Utah and the Flux Group.
 * All rights reserved.
5 6 7 8 9
 */

#define SERVERPORT	855
#define DEVPATH		"/dev"
#define TIPPATH		"/dev/tip"
10 11 12 13 14 15 16
#ifdef HPBSD
#define LOGPATH		"/usr/adm/tiplogs"
#else
#define LOGPATH		"/var/log/tiplogs"
#endif
/* Socket based tip/capture uses an ACL file to hold key below. */
#define ACLPATH		LOGPATH
17 18

/*
19
 * The key is transferred from capture to capserver in ascii text.
20 21 22 23 24 25 26
 */
typedef struct {
	int		keylen;		/* of the key string */
	char		key[256];	/* and the string itself. */
} secretkey_t;
#define DEFAULTKEYLEN	32

27 28 29 30 31 32 33 34
/*
 * The capserver then returns this structure as part of the handshake.
 */
typedef struct {
	uid_t		uid;
	gid_t		gid;
} tipowner_t;

35 36 37 38
/*
 * The remote capture sends this back when it starts up
 */
typedef struct {
39
	char		name[64];	/* "tipname" in tiplines table */
40 41 42
	int		portnum;
	secretkey_t	key;
} whoami_t;
43 44 45 46 47 48 49 50 51 52 53 54

/*
 * Return Status. Define a constant size return to ensure that the
 * status is read as an independent block, distinct from any output
 * that might be sent. An int is a reasonable thing to use.
 *
 * XXX: If you change this, be sure to change the PERL code!
 */
#define CAPOK		0
#define CAPBUSY		1
#define CAPNOPERM	2
typedef int		capret_t;