All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

rpc.h 1.96 KB
Newer Older
1 2
/*
 * EMULAB-COPYRIGHT
Timothy Stack's avatar
 
Timothy Stack committed
3
 * Copyright (c) 2004, 2005 University of Utah and the Flux Group.
4 5 6
 * All rights reserved.
 */

Timothy Stack's avatar
 
Timothy Stack committed
7 8 9 10 11
#ifndef _event_sched_rpc_h
#define _event_sched_rpc_h

#include "event-sched.h"

12
#ifdef __cplusplus
Timothy Stack's avatar
 
Timothy Stack committed
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

#include <ulxmlrpcpp.h>  // always first header
#include <iostream>
#include <ulxr_tcpip_connection.h>  // first, don't move: msvc #include bug
#include <ulxr_ssl_connection.h> 
#include <ulxr_http_protocol.h> 
#include <ulxr_requester.h>
#include <ulxr_value.h>
#include <ulxr_except.h>
#include <emulab_proxy.h>

int RPC_invoke(char *method,
	       emulab::EmulabResponse *er_out,
	       emulab::spa_attr_t tag,
	       ...);

struct rpc_conn_proto {
	ulxr::Connection *conn;
	ulxr::Protocol *proto;
};

struct r_rpc_data {
	const char *certpath;
	const char *host;
	unsigned short port;
	int refcount;
	struct rpc_conn_proto conn_proto;
	pthread_mutex_t mutex;
};

extern struct r_rpc_data rpc_data;

45 46
#endif

Timothy Stack's avatar
 
Timothy Stack committed
47 48 49
#define DEFAULT_RPC_PORT 3069

#define ROBOT_TIMEOUT 10 * 60 /* seconds */
50

Timothy Stack's avatar
 
Timothy Stack committed
51 52
#ifdef __cplusplus
extern "C" {
53 54
#endif

Timothy Stack's avatar
 
Timothy Stack committed
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
int RPC_init(const char *certpath, const char *host, unsigned short port);
int RPC_grab(void);
void RPC_drop(void);

int RPC_exppath(char *pid, char *eid, char *path_out, size_t path_size);
int RPC_waitforrobots(char *pid, char *eid);
int RPC_waitforactive(char *pid, char *eid);
int RPC_agentlist(event_handle_t handle, char *pid, char *eid);
int RPC_grouplist(event_handle_t handle, char *pid, char *eid);
int RPC_eventlist(char *pid, char *eid,
		  event_handle_t handle, address_tuple_t tuple,
		  long basetime);

extern int AddAgent(event_handle_t handle,
		    char *vname, char *vnode, char *nodeid,
		    char *ipaddr, char *type);
71

Timothy Stack's avatar
 
Timothy Stack committed
72
extern int AddGroup(event_handle_t handle, char *groupname, char *agentname);
73

Timothy Stack's avatar
 
Timothy Stack committed
74 75 76 77
extern int AddEvent(event_handle_t handle, address_tuple_t tuple,
		    long basetime,
		    char *exidx, char *ftime, char *objname, char *exargs,
		    char *objtype, char *evttype, char *parent);
78

Timothy Stack's avatar
 
Timothy Stack committed
79 80 81 82 83
#ifdef __cplusplus
}
#endif

#endif