Index: branches/fep_client_cpp/build
===================================================================
--- branches/fep_client_cpp/build	(revision 70)
+++ branches/fep_client_cpp/build	(revision 71)
@@ -1,3 +1,3 @@
 #!/bin/bash
 
-g++ -g fep_client.cpp fep_clnt.c fep_xdr.c control.cpp -o client && gcc fep_server.c fep_svc.c fep_xdr.c -o server
+g++ -g fep_client.cpp fep_clnt.c fep_xdr.c -o client && gcc ./dummyserver/fep_server.c ./dummyserver/fep_svc.c fep_xdr.c -o ./dummyserver/server
Index: branches/fep_client_cpp/network.h
===================================================================
--- branches/fep_client_cpp/network.h	(revision 70)
+++ branches/fep_client_cpp/network.h	(revision 71)
@@ -1,4 +1,6 @@
 #ifndef NETWORK_H
 #define NETWORK_H
+#include <vector>
+using namespace std;
 
 typedef struct loopagg LOOPAGG;
Index: branches/fep_client_cpp/network_factory.cpp
===================================================================
--- branches/fep_client_cpp/network_factory.cpp	(revision 70)
+++ branches/fep_client_cpp/network_factory.cpp	(revision 71)
@@ -3,12 +3,12 @@
 FEP_LINE_LDS * load_lines(int *size, const char * fName)
 {
-	FEP_LINE_LDS lines[1];
+	FEP_LINE_LDS *lines = (FEP_LINE_LDS *) malloc(sizeof(FEP_LINE_LDS));
 	*size = 1;
 	return lines;	
 }
 
-FEP_LDS * load_lds(const char * fName)
+LDS_LOOP * load_lds(const char * fName)
 {
-	FEP_LDS lds[1];
-	return lds;
+	LDS_LOOP *lds_map = (LDS_LOOP *) malloc(sizeof(LDS_LOOP));
+	return lds_map;
 }
Index: branches/fep_client_cpp/dummyserver/fep.h
===================================================================
--- branches/fep_client_cpp/dummyserver/fep.h	(revision 71)
+++ branches/fep_client_cpp/dummyserver/fep.h	(revision 71)
@@ -0,0 +1,761 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _FEP_H_RPCGEN
+#define _FEP_H_RPCGEN
+
+#include <rpc/rpc.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RPC HDR test */
+#ifndef FEP_PROGRAM
+#define MAXDEVLEN 32
+#define _MAXSHORTMESSAGELEN 128
+#define _MAXLONGMESSAGELEN 1024
+#define _MAXSHORTPOLLS 20
+#define _MAXLONGPOLLS 2
+#define _MAXPOLLRETRY 2
+#define _MAXSHORTREPLYLEN 128
+#define _MAXLONGREPLYLEN 1024
+#define MAXADDRLEN 64
+#define MAXSHORTMESSAGELEN _MAXSHORTMESSAGELEN
+#define MAXLONGMESSAGELEN _MAXLONGMESSAGELEN
+#define MAXSHORTPOLLS _MAXSHORTPOLLS
+#define MAXLONGPOLLS _MAXLONGPOLLS
+#define MAXPOLLRETRY _MAXPOLLRETRY
+#define MAXSHORTREPLYLEN _MAXSHORTREPLYLEN
+#define MAXLONGREPLYLEN _MAXLONGREPLYLEN
+
+enum errorstatus {
+	FEP_OK = 0,
+	FEP_OUTOFRANGE = 1,
+	FEP_BADHANDLE = 2,
+	FEP_NOREPLY = 3,
+	FEP_SCHBUSY = 4,
+	FEP_LINEBUSY = 5,
+	FEP_REPORTBUSY = 6,
+	FEP_NOREPORT = 7,
+	FEP_NOMEMORY = 8,
+	FEP_BADTIME = 9,
+	FEP_BADTIMESYNCH = 10,
+	FEP_BADKIND = 11,
+	FEP_BADCONNECT = 12,
+	FEP_NOAUTHORITY = 13,
+};
+typedef enum errorstatus errorstatus;
+
+enum Polling_FSM_States {
+	INITSTATE = 0x01,
+	WRALARMSTATE = 0x10,
+	CLRSTATE = 0x20,
+	RTSONSTATE = 0x30,
+	CTSSTATE = 0x40,
+	WRITESTATE = 0x50,
+	RTSOFFSTATE = 0x60,
+	RDALARMSTATE = 0x70,
+	RDSTATE = 0x80,
+	DONESTATE = 0x00,
+};
+typedef enum Polling_FSM_States Polling_FSM_States;
+
+struct fep_lineinfo {
+	int lineinfo;
+	char device[MAXDEVLEN];
+	int poll;
+	int command;
+	int sync;
+	int line_error_count;
+	int pid;
+	int semaphore;
+	int debug;
+};
+typedef struct fep_lineinfo fep_lineinfo;
+
+struct lineinfo_ret {
+	errorstatus status;
+	union {
+		fep_lineinfo info;
+	} lineinfo_ret_u;
+};
+typedef struct lineinfo_ret lineinfo_ret;
+
+struct fep_std_time {
+	int year;
+	int month;
+	int day;
+	int hour;
+	int minute;
+	int second;
+	long time_t;
+};
+typedef struct fep_std_time fep_std_time;
+
+struct std_time_ret {
+	errorstatus status;
+	union {
+		fep_std_time info;
+	} std_time_ret_u;
+};
+typedef struct std_time_ret std_time_ret;
+
+enum protocoltype {
+	DEFAULT = 0,
+	SATMSPROT = 1,
+	SDRMSPROT = 2,
+	INACTIVE = 3,
+	CLEARPROT = 4,
+	CMS500PROT = 5,
+	CMSHPPROT = 6,
+	TIMESYNCPOLL = 7,
+};
+typedef enum protocoltype protocoltype;
+
+enum duplex {
+	HALFDUPLEX = 0,
+	FULLDUPLEX = 1,
+};
+typedef enum duplex duplex;
+
+struct fep_poll_info {
+	int D7_update;
+	protocoltype protocol;
+	int poll_user_info1;
+	int poll_user_info2;
+	int format;
+	int speed;
+	int mode;
+	int min_separation;
+	int delay_rts_on;
+	int max_send;
+	int delay_rts_off;
+	int max_reply;
+	int min_error;
+	int max_retry;
+	int reply_len;
+	int poll_error_count;
+};
+typedef struct fep_poll_info fep_poll_info;
+
+struct fep_poll_short_msg {
+	int message_len;
+	char message[MAXSHORTMESSAGELEN];
+};
+typedef struct fep_poll_short_msg fep_poll_short_msg;
+
+struct fep_shortpoll {
+	fep_poll_info info;
+	fep_poll_short_msg msg;
+};
+typedef struct fep_shortpoll fep_shortpoll;
+
+struct fep_shortpoll_list {
+	int count;
+	fep_shortpoll polls[MAXSHORTPOLLS];
+};
+typedef struct fep_shortpoll_list fep_shortpoll_list;
+
+struct fep_poll_long_msg {
+	int message_len;
+	char message[MAXLONGMESSAGELEN];
+};
+typedef struct fep_poll_long_msg fep_poll_long_msg;
+
+struct fep_longpoll {
+	fep_poll_info info;
+	fep_poll_long_msg msg;
+};
+typedef struct fep_longpoll fep_longpoll;
+
+struct fep_longpoll_list {
+	int count;
+	fep_longpoll polls[MAXLONGPOLLS];
+};
+typedef struct fep_longpoll_list fep_longpoll_list;
+
+enum poll_length {
+	SHORTPOLL = 0,
+	LONGPOLL = 1,
+};
+typedef enum poll_length poll_length;
+
+struct fep_poll_list {
+	int size;
+	union {
+		fep_shortpoll_list shortp;
+		fep_longpoll_list longp;
+	} fep_poll_list_u;
+};
+typedef struct fep_poll_list fep_poll_list;
+
+enum polltype {
+	POLL = 0,
+	COMMAND = 1,
+	TIMESYNC = 2,
+};
+typedef enum polltype polltype;
+
+enum commandtype {
+	AFTERPOLL = 0,
+	BEFOREPOLL = 1,
+	IMMEDIATE = 2,
+};
+typedef enum commandtype commandtype;
+
+enum schedulestatus {
+	IDLE = 0,
+	ACTIVE = 1,
+	COMPLETE = 2,
+};
+typedef enum schedulestatus schedulestatus;
+
+struct fep_schedule {
+	int schedule;
+	int lineinfo;
+	polltype kind;
+	commandtype priority;
+	protocoltype protocol;
+	fep_std_time time;
+	int interval;
+	long at_time;
+	int user_info1;
+	int user_info2;
+	int system_key;
+	int next;
+	int previous;
+	int report;
+	int sequence;
+	int status;
+	int retry;
+	fep_poll_list fep_polls;
+};
+typedef struct fep_schedule fep_schedule;
+
+enum answererror {
+	ERR_BSCF_ERR = -1,
+	ERR_NONE = 0,
+	ERR_MSG_LEN = 2,
+	ERR_MSG_HDR = 3,
+	ERR_MSG_CHKSUM = 4,
+	ERR_MSG_TRAILER = 5,
+};
+typedef enum answererror answererror;
+
+struct fep_pollerror {
+	answererror msgerror;
+	Polling_FSM_States state;
+	int perrno;
+	int termination;
+	int count;
+};
+typedef struct fep_pollerror fep_pollerror;
+
+enum replystatus {
+	FAILURE = 2,
+	DONE = 1,
+	UNUSED = 3,
+};
+typedef enum replystatus replystatus;
+
+struct fep_answer_info {
+	long poll_time;
+	replystatus status;
+	int poll_user_info1;
+	int poll_user_info2;
+	int retries;
+	int poll_error_count;
+	fep_pollerror pollerror[MAXPOLLRETRY];
+};
+typedef struct fep_answer_info fep_answer_info;
+
+struct fep_answer_short_msg {
+	int message_len;
+	char message[MAXSHORTREPLYLEN];
+};
+typedef struct fep_answer_short_msg fep_answer_short_msg;
+
+struct fep_shortanswer {
+	fep_answer_info info;
+	fep_answer_short_msg msg;
+};
+typedef struct fep_shortanswer fep_shortanswer;
+
+struct fep_shortanswer_list {
+	int count;
+	fep_shortanswer answers[MAXSHORTPOLLS];
+};
+typedef struct fep_shortanswer_list fep_shortanswer_list;
+
+struct fep_answer_long_msg {
+	int message_len;
+	char message[MAXLONGREPLYLEN];
+};
+typedef struct fep_answer_long_msg fep_answer_long_msg;
+
+struct fep_longanswer {
+	fep_answer_info info;
+	fep_answer_long_msg msg;
+};
+typedef struct fep_longanswer fep_longanswer;
+
+struct fep_longanswer_list {
+	int count;
+	fep_longanswer answers[MAXLONGPOLLS];
+};
+typedef struct fep_longanswer_list fep_longanswer_list;
+
+struct fep_answer_list {
+	int size;
+	union {
+		fep_shortanswer_list shortp;
+		fep_longanswer_list longp;
+	} fep_answer_list_u;
+};
+typedef struct fep_answer_list fep_answer_list;
+
+enum replykind {
+	POLLREPLY = 0,
+	SCHEDNEW = 1,
+	SCHEDDONE = 2,
+};
+typedef enum replykind replykind;
+
+struct fep_reply {
+	int reply;
+	int schedule;
+	int lineinfo;
+	polltype kind;
+	replykind flag;
+	int schedule_sequence;
+	int global_sequence;
+	long schedule_time;
+	int user_info1;
+	int user_info2;
+	int system_key;
+	struct fep_answer_list answers;
+};
+typedef struct fep_reply fep_reply;
+
+struct schedule_ret {
+	errorstatus status;
+	union {
+		fep_schedule info;
+	} schedule_ret_u;
+};
+typedef struct schedule_ret schedule_ret;
+
+struct fep_reply_request {
+	int schedule;
+	int sequence;
+	int block;
+};
+typedef struct fep_reply_request fep_reply_request;
+
+struct reply_ret {
+	errorstatus status;
+	union {
+		fep_reply info;
+	} reply_ret_u;
+};
+typedef struct reply_ret reply_ret;
+
+struct init_form {
+	char host[10];
+	int config;
+};
+typedef struct init_form init_form;
+
+struct fep_setschedule {
+	int lineinfo;
+	int schedule;
+	int debug;
+};
+typedef struct fep_setschedule fep_setschedule;
+
+enum statusflags {
+	ENABLED_FLAG = 1,
+	POLL_FLAG = 2,
+	TIME_FLAG = 4,
+	CMD_FLAG = 8,
+};
+typedef enum statusflags statusflags;
+
+struct fep_lineop {
+	int lineinfo;
+	int flags;
+	int modem_signals;
+};
+typedef struct fep_lineop fep_lineop;
+
+enum ipprotocol {
+	TCPPROT = 0,
+	UDPPROT = 1,
+};
+typedef enum ipprotocol ipprotocol;
+
+enum action {
+	REP = 0,
+	LOG = 1,
+};
+typedef enum action action;
+
+enum portstatus {
+	NOCONNECTION = 0,
+	CONNECTION = 1,
+	FAILED = 2,
+};
+typedef enum portstatus portstatus;
+
+struct fep_report {
+	int report;
+	char dest[MAXADDRLEN];
+	char logfile[MAXADDRLEN];
+	char monitor[MAXADDRLEN];
+	int port;
+	ipprotocol protocol;
+	int update;
+	action action;
+	int reconnect;
+	portstatus status;
+	int perrno;
+	int debug;
+	int pid;
+	int semaphore;
+};
+typedef struct fep_report fep_report;
+
+struct report_ret {
+	errorstatus status;
+	union {
+		fep_report info;
+	} report_ret_u;
+};
+typedef struct report_ret report_ret;
+#define fep_getlineinfocount fep_getlineinfocount ## _ ## 32
+#define fep_getlineinfo fep_getlineinfo ## _ ## 32
+#define fep_getlineinfovalue fep_getlineinfovalue ## _ ## 32
+#define fep_sendlineinfo fep_sendlineinfo ## _ ## 32
+#define fep_gettime fep_gettime ## _ ## 32
+#define fep_settime fep_settime ## _ ## 32
+#define fep_advancetime fep_advancetime ## _ ## 32
+#define fep_getschedulecount fep_getschedulecount ## _ ## 32
+#define fep_getschedule fep_getschedule ## _ ## 32
+#define fep_getschedulevalue fep_getschedulevalue ## _ ## 32
+#define fep_sendschedule fep_sendschedule ## _ ## 32
+#define fep_setlinemgr_schedule fep_setlinemgr_schedule ## _ ## 32
+#define fep_free_schedule fep_free_schedule ## _ ## 32
+#define fep_updateschedule fep_updateschedule ## _ ## 32
+#define fep_idleline fep_idleline ## _ ## 32
+#define fep_modemsignals fep_modemsignals ## _ ## 32
+#define fep_getreply fep_getreply ## _ ## 32
+#define fep_clearreply fep_clearreply ## _ ## 32
+#define fep_getreportcount fep_getreportcount ## _ ## 32
+#define fep_getreport fep_getreport ## _ ## 32
+#define fep_getreportvalue fep_getreportvalue ## _ ## 32
+#define fep_sendreport fep_sendreport ## _ ## 32
+#define fep_reply_xfer fep_reply_xfer ## _ ## 32
+#define fep_schedule_xfer fep_schedule_xfer ## _ ## 32
+#define fep_fake_reply fep_fake_reply ## _ ## 32
+#define fep_set_debug fep_set_debug ## _ ## 32
+#define fep_get_stack_left fep_get_stack_left ## _ ## 32
+#define fep_setlmdebug fep_setlmdebug ## _ ## 32
+#define fep_shutdown fep_shutdown ## _ ## 32
+#define fep_initsystem fep_initsystem ## _ ## 32
+#define fep_initrealix fep_initrealix ## _ ## 32
+/* RPC HDR test */
+#endif
+
+#define FEP_PROGRAM 100090
+#define FEP_VERSION 32
+
+#if defined(__STDC__) || defined(__cplusplus)
+#define FEP_GETLINEINFOCOUNT 1
+extern  int * fep_getlineinfocount_32(void *, CLIENT *);
+extern  int * fep_getlineinfocount_32_svc(void *, struct svc_req *);
+#define FEP_GETLINEINFO 2
+extern  lineinfo_ret * fep_getlineinfo_32(int *, CLIENT *);
+extern  lineinfo_ret * fep_getlineinfo_32_svc(int *, struct svc_req *);
+#define FEP_GETLINEINFOVALUE 3
+extern  lineinfo_ret * fep_getlineinfovalue_32(int *, CLIENT *);
+extern  lineinfo_ret * fep_getlineinfovalue_32_svc(int *, struct svc_req *);
+#define FEP_SENDLINEINFO 4
+extern  lineinfo_ret * fep_sendlineinfo_32(fep_lineinfo *, CLIENT *);
+extern  lineinfo_ret * fep_sendlineinfo_32_svc(fep_lineinfo *, struct svc_req *);
+#define FEP_GETTIME 5
+extern  std_time_ret * fep_gettime_32(void *, CLIENT *);
+extern  std_time_ret * fep_gettime_32_svc(void *, struct svc_req *);
+#define FEP_SETTIME 6
+extern  std_time_ret * fep_settime_32(fep_std_time *, CLIENT *);
+extern  std_time_ret * fep_settime_32_svc(fep_std_time *, struct svc_req *);
+#define FEP_ADVANCETIME 7
+extern  std_time_ret * fep_advancetime_32(int *, CLIENT *);
+extern  std_time_ret * fep_advancetime_32_svc(int *, struct svc_req *);
+#define FEP_GETSCHEDULECOUNT 8
+extern  int * fep_getschedulecount_32(void *, CLIENT *);
+extern  int * fep_getschedulecount_32_svc(void *, struct svc_req *);
+#define FEP_GETSCHEDULE 9
+extern  schedule_ret * fep_getschedule_32(int *, CLIENT *);
+extern  schedule_ret * fep_getschedule_32_svc(int *, struct svc_req *);
+#define FEP_GETSCHEDULEVALUE 10
+extern  schedule_ret * fep_getschedulevalue_32(int *, CLIENT *);
+extern  schedule_ret * fep_getschedulevalue_32_svc(int *, struct svc_req *);
+#define FEP_SENDSCHEDULE 11
+extern  schedule_ret * fep_sendschedule_32(fep_schedule *, CLIENT *);
+extern  schedule_ret * fep_sendschedule_32_svc(fep_schedule *, struct svc_req *);
+#define FEP_SETLINEMGR_SCHEDULE 12
+extern  errorstatus * fep_setlinemgr_schedule_32(fep_setschedule *, CLIENT *);
+extern  errorstatus * fep_setlinemgr_schedule_32_svc(fep_setschedule *, struct svc_req *);
+#define FEP_FREE_SCHEDULE 13
+extern  errorstatus * fep_free_schedule_32(int *, CLIENT *);
+extern  errorstatus * fep_free_schedule_32_svc(int *, struct svc_req *);
+#define FEP_IDLELINE 14
+extern  errorstatus * fep_idleline_32(fep_lineop *, CLIENT *);
+extern  errorstatus * fep_idleline_32_svc(fep_lineop *, struct svc_req *);
+#define FEP_MODEMSIGNALS 15
+extern  errorstatus * fep_modemsignals_32(fep_lineop *, CLIENT *);
+extern  errorstatus * fep_modemsignals_32_svc(fep_lineop *, struct svc_req *);
+#define FEP_GETREPLY 16
+extern  reply_ret * fep_getreply_32(fep_reply_request *, CLIENT *);
+extern  reply_ret * fep_getreply_32_svc(fep_reply_request *, struct svc_req *);
+#define FEP_CLEARREPLY 17
+extern  errorstatus * fep_clearreply_32(void *, CLIENT *);
+extern  errorstatus * fep_clearreply_32_svc(void *, struct svc_req *);
+#define FEP_UPDATESCHEDULE 18
+extern  schedule_ret * fep_updateschedule_32(fep_schedule *, CLIENT *);
+extern  schedule_ret * fep_updateschedule_32_svc(fep_schedule *, struct svc_req *);
+#define FEP_GETREPORTCOUNT 20
+extern  int * fep_getreportcount_32(void *, CLIENT *);
+extern  int * fep_getreportcount_32_svc(void *, struct svc_req *);
+#define FEP_GETREPORT 21
+extern  report_ret * fep_getreport_32(int *, CLIENT *);
+extern  report_ret * fep_getreport_32_svc(int *, struct svc_req *);
+#define FEP_GETREPORTVALUE 22
+extern  report_ret * fep_getreportvalue_32(int *, CLIENT *);
+extern  report_ret * fep_getreportvalue_32_svc(int *, struct svc_req *);
+#define FEP_SENDREPORT 23
+extern  report_ret * fep_sendreport_32(fep_report *, CLIENT *);
+extern  report_ret * fep_sendreport_32_svc(fep_report *, struct svc_req *);
+#define FEP_REPLY_XFER 30
+extern  void * fep_reply_xfer_32(fep_reply *, CLIENT *);
+extern  void * fep_reply_xfer_32_svc(fep_reply *, struct svc_req *);
+#define FEP_SET_DEBUG 36
+extern  errorstatus * fep_set_debug_32(int *, CLIENT *);
+extern  errorstatus * fep_set_debug_32_svc(int *, struct svc_req *);
+#define FEP_GET_STACK_LEFT 37
+extern  int * fep_get_stack_left_32(void *, CLIENT *);
+extern  int * fep_get_stack_left_32_svc(void *, struct svc_req *);
+#define FEP_SETLMDEBUG 38
+extern  errorstatus * fep_setlmdebug_32(fep_setschedule *, CLIENT *);
+extern  errorstatus * fep_setlmdebug_32_svc(fep_setschedule *, struct svc_req *);
+#define FEP_SHUTDOWN 39
+extern  errorstatus * fep_shutdown_32(void *, CLIENT *);
+extern  errorstatus * fep_shutdown_32_svc(void *, struct svc_req *);
+#define FEP_INITSYSTEM 40
+extern  int * fep_initsystem_32(int *, CLIENT *);
+extern  int * fep_initsystem_32_svc(int *, struct svc_req *);
+#define FEP_INITREALIX 41
+extern  int * fep_initrealix_32(init_form *, CLIENT *);
+extern  int * fep_initrealix_32_svc(init_form *, struct svc_req *);
+extern int fep_program_32_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+#else /* K&R C */
+#define FEP_GETLINEINFOCOUNT 1
+extern  int * fep_getlineinfocount_32();
+extern  int * fep_getlineinfocount_32_svc();
+#define FEP_GETLINEINFO 2
+extern  lineinfo_ret * fep_getlineinfo_32();
+extern  lineinfo_ret * fep_getlineinfo_32_svc();
+#define FEP_GETLINEINFOVALUE 3
+extern  lineinfo_ret * fep_getlineinfovalue_32();
+extern  lineinfo_ret * fep_getlineinfovalue_32_svc();
+#define FEP_SENDLINEINFO 4
+extern  lineinfo_ret * fep_sendlineinfo_32();
+extern  lineinfo_ret * fep_sendlineinfo_32_svc();
+#define FEP_GETTIME 5
+extern  std_time_ret * fep_gettime_32();
+extern  std_time_ret * fep_gettime_32_svc();
+#define FEP_SETTIME 6
+extern  std_time_ret * fep_settime_32();
+extern  std_time_ret * fep_settime_32_svc();
+#define FEP_ADVANCETIME 7
+extern  std_time_ret * fep_advancetime_32();
+extern  std_time_ret * fep_advancetime_32_svc();
+#define FEP_GETSCHEDULECOUNT 8
+extern  int * fep_getschedulecount_32();
+extern  int * fep_getschedulecount_32_svc();
+#define FEP_GETSCHEDULE 9
+extern  schedule_ret * fep_getschedule_32();
+extern  schedule_ret * fep_getschedule_32_svc();
+#define FEP_GETSCHEDULEVALUE 10
+extern  schedule_ret * fep_getschedulevalue_32();
+extern  schedule_ret * fep_getschedulevalue_32_svc();
+#define FEP_SENDSCHEDULE 11
+extern  schedule_ret * fep_sendschedule_32();
+extern  schedule_ret * fep_sendschedule_32_svc();
+#define FEP_SETLINEMGR_SCHEDULE 12
+extern  errorstatus * fep_setlinemgr_schedule_32();
+extern  errorstatus * fep_setlinemgr_schedule_32_svc();
+#define FEP_FREE_SCHEDULE 13
+extern  errorstatus * fep_free_schedule_32();
+extern  errorstatus * fep_free_schedule_32_svc();
+#define FEP_IDLELINE 14
+extern  errorstatus * fep_idleline_32();
+extern  errorstatus * fep_idleline_32_svc();
+#define FEP_MODEMSIGNALS 15
+extern  errorstatus * fep_modemsignals_32();
+extern  errorstatus * fep_modemsignals_32_svc();
+#define FEP_GETREPLY 16
+extern  reply_ret * fep_getreply_32();
+extern  reply_ret * fep_getreply_32_svc();
+#define FEP_CLEARREPLY 17
+extern  errorstatus * fep_clearreply_32();
+extern  errorstatus * fep_clearreply_32_svc();
+#define FEP_UPDATESCHEDULE 18
+extern  schedule_ret * fep_updateschedule_32();
+extern  schedule_ret * fep_updateschedule_32_svc();
+#define FEP_GETREPORTCOUNT 20
+extern  int * fep_getreportcount_32();
+extern  int * fep_getreportcount_32_svc();
+#define FEP_GETREPORT 21
+extern  report_ret * fep_getreport_32();
+extern  report_ret * fep_getreport_32_svc();
+#define FEP_GETREPORTVALUE 22
+extern  report_ret * fep_getreportvalue_32();
+extern  report_ret * fep_getreportvalue_32_svc();
+#define FEP_SENDREPORT 23
+extern  report_ret * fep_sendreport_32();
+extern  report_ret * fep_sendreport_32_svc();
+#define FEP_REPLY_XFER 30
+extern  void * fep_reply_xfer_32();
+extern  void * fep_reply_xfer_32_svc();
+#define FEP_SET_DEBUG 36
+extern  errorstatus * fep_set_debug_32();
+extern  errorstatus * fep_set_debug_32_svc();
+#define FEP_GET_STACK_LEFT 37
+extern  int * fep_get_stack_left_32();
+extern  int * fep_get_stack_left_32_svc();
+#define FEP_SETLMDEBUG 38
+extern  errorstatus * fep_setlmdebug_32();
+extern  errorstatus * fep_setlmdebug_32_svc();
+#define FEP_SHUTDOWN 39
+extern  errorstatus * fep_shutdown_32();
+extern  errorstatus * fep_shutdown_32_svc();
+#define FEP_INITSYSTEM 40
+extern  int * fep_initsystem_32();
+extern  int * fep_initsystem_32_svc();
+#define FEP_INITREALIX 41
+extern  int * fep_initrealix_32();
+extern  int * fep_initrealix_32_svc();
+extern int fep_program_32_freeresult ();
+#endif /* K&R C */
+
+/* the xdr functions */
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern  bool_t xdr_errorstatus (XDR *, errorstatus*);
+extern  bool_t xdr_Polling_FSM_States (XDR *, Polling_FSM_States*);
+extern  bool_t xdr_fep_lineinfo (XDR *, fep_lineinfo*);
+extern  bool_t xdr_lineinfo_ret (XDR *, lineinfo_ret*);
+extern  bool_t xdr_fep_std_time (XDR *, fep_std_time*);
+extern  bool_t xdr_std_time_ret (XDR *, std_time_ret*);
+extern  bool_t xdr_protocoltype (XDR *, protocoltype*);
+extern  bool_t xdr_duplex (XDR *, duplex*);
+extern  bool_t xdr_fep_poll_info (XDR *, fep_poll_info*);
+extern  bool_t xdr_fep_poll_short_msg (XDR *, fep_poll_short_msg*);
+extern  bool_t xdr_fep_shortpoll (XDR *, fep_shortpoll*);
+extern  bool_t xdr_fep_shortpoll_list (XDR *, fep_shortpoll_list*);
+extern  bool_t xdr_fep_poll_long_msg (XDR *, fep_poll_long_msg*);
+extern  bool_t xdr_fep_longpoll (XDR *, fep_longpoll*);
+extern  bool_t xdr_fep_longpoll_list (XDR *, fep_longpoll_list*);
+extern  bool_t xdr_poll_length (XDR *, poll_length*);
+extern  bool_t xdr_fep_poll_list (XDR *, fep_poll_list*);
+extern  bool_t xdr_polltype (XDR *, polltype*);
+extern  bool_t xdr_commandtype (XDR *, commandtype*);
+extern  bool_t xdr_schedulestatus (XDR *, schedulestatus*);
+extern  bool_t xdr_fep_schedule (XDR *, fep_schedule*);
+extern  bool_t xdr_answererror (XDR *, answererror*);
+extern  bool_t xdr_fep_pollerror (XDR *, fep_pollerror*);
+extern  bool_t xdr_replystatus (XDR *, replystatus*);
+extern  bool_t xdr_fep_answer_info (XDR *, fep_answer_info*);
+extern  bool_t xdr_fep_answer_short_msg (XDR *, fep_answer_short_msg*);
+extern  bool_t xdr_fep_shortanswer (XDR *, fep_shortanswer*);
+extern  bool_t xdr_fep_shortanswer_list (XDR *, fep_shortanswer_list*);
+extern  bool_t xdr_fep_answer_long_msg (XDR *, fep_answer_long_msg*);
+extern  bool_t xdr_fep_longanswer (XDR *, fep_longanswer*);
+extern  bool_t xdr_fep_longanswer_list (XDR *, fep_longanswer_list*);
+extern  bool_t xdr_fep_answer_list (XDR *, fep_answer_list*);
+extern  bool_t xdr_replykind (XDR *, replykind*);
+extern  bool_t xdr_fep_reply (XDR *, fep_reply*);
+extern  bool_t xdr_schedule_ret (XDR *, schedule_ret*);
+extern  bool_t xdr_fep_reply_request (XDR *, fep_reply_request*);
+extern  bool_t xdr_reply_ret (XDR *, reply_ret*);
+extern  bool_t xdr_init_form (XDR *, init_form*);
+extern  bool_t xdr_fep_setschedule (XDR *, fep_setschedule*);
+extern  bool_t xdr_statusflags (XDR *, statusflags*);
+extern  bool_t xdr_fep_lineop (XDR *, fep_lineop*);
+extern  bool_t xdr_ipprotocol (XDR *, ipprotocol*);
+extern  bool_t xdr_action (XDR *, action*);
+extern  bool_t xdr_portstatus (XDR *, portstatus*);
+extern  bool_t xdr_fep_report (XDR *, fep_report*);
+extern  bool_t xdr_report_ret (XDR *, report_ret*);
+
+#else /* K&R C */
+extern bool_t xdr_errorstatus ();
+extern bool_t xdr_Polling_FSM_States ();
+extern bool_t xdr_fep_lineinfo ();
+extern bool_t xdr_lineinfo_ret ();
+extern bool_t xdr_fep_std_time ();
+extern bool_t xdr_std_time_ret ();
+extern bool_t xdr_protocoltype ();
+extern bool_t xdr_duplex ();
+extern bool_t xdr_fep_poll_info ();
+extern bool_t xdr_fep_poll_short_msg ();
+extern bool_t xdr_fep_shortpoll ();
+extern bool_t xdr_fep_shortpoll_list ();
+extern bool_t xdr_fep_poll_long_msg ();
+extern bool_t xdr_fep_longpoll ();
+extern bool_t xdr_fep_longpoll_list ();
+extern bool_t xdr_poll_length ();
+extern bool_t xdr_fep_poll_list ();
+extern bool_t xdr_polltype ();
+extern bool_t xdr_commandtype ();
+extern bool_t xdr_schedulestatus ();
+extern bool_t xdr_fep_schedule ();
+extern bool_t xdr_answererror ();
+extern bool_t xdr_fep_pollerror ();
+extern bool_t xdr_replystatus ();
+extern bool_t xdr_fep_answer_info ();
+extern bool_t xdr_fep_answer_short_msg ();
+extern bool_t xdr_fep_shortanswer ();
+extern bool_t xdr_fep_shortanswer_list ();
+extern bool_t xdr_fep_answer_long_msg ();
+extern bool_t xdr_fep_longanswer ();
+extern bool_t xdr_fep_longanswer_list ();
+extern bool_t xdr_fep_answer_list ();
+extern bool_t xdr_replykind ();
+extern bool_t xdr_fep_reply ();
+extern bool_t xdr_schedule_ret ();
+extern bool_t xdr_fep_reply_request ();
+extern bool_t xdr_reply_ret ();
+extern bool_t xdr_init_form ();
+extern bool_t xdr_fep_setschedule ();
+extern bool_t xdr_statusflags ();
+extern bool_t xdr_fep_lineop ();
+extern bool_t xdr_ipprotocol ();
+extern bool_t xdr_action ();
+extern bool_t xdr_portstatus ();
+extern bool_t xdr_fep_report ();
+extern bool_t xdr_report_ret ();
+
+#endif /* K&R C */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_FEP_H_RPCGEN */
Index: branches/fep_client_cpp/fep_client.cpp
===================================================================
--- branches/fep_client_cpp/fep_client.cpp	(revision 70)
+++ branches/fep_client_cpp/fep_client.cpp	(revision 71)
@@ -32,5 +32,5 @@
 {
 	int i, j; // i == line_index, j == lds_index
-
+	void *rv;
 	// Send one reply for every "line" in the FEP
 	for (i = 0; i < lines_size; i++)
@@ -40,6 +40,6 @@
 		// populate reply
 		fepReply.reply = SHORTPOLL;
-		fepReply.schedule = fepLine[i].schedule;
-		fepReply.lineinfo = fepLine[i].lineInfo;
+		fepReply.schedule = lines[i].schedule;
+		fepReply.lineinfo = lines[i].lineInfo;
 		fepReply.kind = (enum polltype) 0;
 		fepReply.flag = (enum replykind) 0;
@@ -47,10 +47,10 @@
 		/***********************************
 			 This is an update to an extern, this should happen on the Java driver side?? 
-		fepLine[i].schedleSeq += 1;
-		fepLine[i].globalSeq += 51;
+		lines[i].schedleSeq += 1;
+		lines[i].globalSeq += 51;
 		*/
 
-		fepReply.schedule_sequence = fepLine[i].schedleSeq;
-		fepReply.global_sequence = fepLine[i].globalSeq;
+		fepReply.schedule_sequence = lines[i].schedleSeq;
+		fepReply.global_sequence = lines[i].globalSeq;
 		/************************************
 			 Need to find out what appropriate schedule time is: look at uci_unix_simulation_time src code		
@@ -58,7 +58,7 @@
 			uci_unix_simulation_time(uci_simulation_time());	// GMT time
 		*/
-		fepReply.user_info1 = fepLine[i].lineNum;
-		fepReply.user_info2 = fepLine[i].lineNum;
-		fepReply.system_key = fepLine[i].systemKey;
+		fepReply.user_info1 = lines[i].lineNum;
+		fepReply.user_info2 = lines[i].lineNum;
+		fepReply.system_key = lines[i].systemKey;
 
 		fepReply.answers.size = 1;
@@ -66,8 +66,8 @@
 		
 		/* for each LDS in the Line.... (constructs the short_answer message) */
-		for (j = 0; j < fepLine[i].ldsNum; j++)
+		for (j = 0; j < lines[i].ldsNum; j++)
 		{
 			fep_shortanswer fsa;
-			int index = fepLine[i].ldsIndex[j];
+			int index = lines[i].ldsIndex[j];
 
 			// msg: oa, od, ldsMap[index].dataPack, od, ff
@@ -90,5 +90,5 @@
 			fsa.info.poll_user_info2 = 1;	//always 1
 			fsa.info.retries = 0;
-			fsa.info.status = REPLY_DONE;
+			fsa.info.status = (enum replystatus) 1;
 			
 			//fepReply.answers.fep_answer_list_u.shortp.answers[j] = fsa;	
@@ -96,5 +96,5 @@
 			
 			// send out data
-			printf("line=%d, lds=%d\n", fepLine[i].lineNum, ldsMap[index].drop);
+			printf("line=%d, lds=%d\n", lines[i].lineNum, ldsMap[index].drop);
 			rv = fep_reply_xfer_32(&fepReply, clnt);
 
@@ -107,5 +107,5 @@
 
 /* Creates an RPC Client which communicates with the ATMS through RPC Calls */
-CLIENT * create_client()
+CLIENT * create_client(char *host)
 {
 	CLIENT *clnt;
@@ -131,13 +131,17 @@
 void update_ATMS(char *host)
 {
-	CLIENT *clnt = create_client();
+	CLIENT *clnt = create_client(host);
 	
 	/* Load data to be xfered to ATMS */
-	FEP_LINE_LDS *lines;
-	int lines_size = load_lines(&lines, "./lines_atms.txt");
-	FEP_LDS *ldsMap = load_lds("./lds_atms.txt");
+	int lines_size;
+	FEP_LINE_LDS *lines = load_lines(&lines_size, "./lines_atms.txt");
+	LDS_LOOP *ldsMap = load_lds("./lds_atms.txt");
 
 	/* Transfer data to ATMS */
 	xfer_replys(clnt, lines, lines_size, ldsMap);
+
+	/* Free allocated memory */
+	free(lines);
+	free(ldsMap);
 
 	/* Destroy client */
