#lib_LIBRARIES = fwp
-#CFLAGS = -Wall -D_REENTRANT -g
+CFLAGS = -Wall -D_REENTRANT -g -D_FWP_INTERNALS_
#LDFLAGS = -lpthread -lrt
#fwp_SOURCES = fwp_util.c fwp_vres.c fwp_msgb.c fwp_msgq.c\
fwp_endpoint.c
#include "fwp_endpoint.h"
-#include "fwp_util.h"
#include "fwp_msgb.h"
typedef enum {
#ifndef _FWP_ENDPOINT_H
#define _FWP_ENDPOINT_H
-
#define FWP_ANY_NODE INADDR_ANY
typedef enum {
/* queueing policy*/
} fwp_endpoint_attr_t;
+#include "fwp_util.h"
+#include "fwp_util.h"
#include "fwp_vres.h"
#include <string.h>
#include "fwp_vres.h"
#include "fwp_endpoint.h"
#include "fwp_mngt.h"
-#include "fwp_contract.h"
-#include "fwp_contract_table.h"
static inline int fwp_init()
{
#lib_LIBRARIES = fwpmngt
-CFLAGS = -Wall -D_REENTRANT -g -D_FWP_INTERNALS_=1
+CFLAGS = -Wall -D_REENTRANT -g -D_FWP_INTERNALS_
#LDFLAGS = -lpthread -lrt
#fwpmngt_SOURCES = fwp_msg.c fwp_mngt.c
#include "fwp_mngt.h"
#include <stdlib.h>
+
+static int fwp_contract_is_reserved(fwp_contract_d_t contract)
+{
+ return (contract->status == FWP_CONT_RESERVED);
+}
+
+static int fwp_contract_is_negotiated(fwp_contract_d_t contract)
+{
+ return (contract->status == FWP_CONT_NEGOTIATED);
+}
+
/**
* Negotiates contract for application. Negotiation request is sent to
* fwp agent and then waits for response.
int period_usec; /**< all time units are in microseconds */
} fwp_contract_t;
-typedef fwp_vres_id_t fwp_contract_id_t;
-
struct fwp_contract_data;
typedef struct fwp_contract_data* fwp_contract_d_t;
#ifdef _FWP_INTERNALS_
+typedef fwp_vres_id_t fwp_contract_id_t;
+
/**
* FWP contract.
* It is an internal representation of contract.
sizeof(fwp_contract_data_t));
}
-static inline int fwp_contract_is_reserved(fwp_contract_d_t contract)
-{
- return (contract->status == FWP_CONT_RESERVED);
-}
-
-static inline int fwp_contract_is_negotiated(fwp_contract_d_t contract)
-{
- return (contract->status == FWP_CONT_NEGOTIATED);
-}
+int fwp_contract_reserve(fwp_contract_d_t contractd);
+int fwp_contract_commit(fwp_contract_d_t contractd, fwp_vres_d_t *vresdp);
#endif
fwp_contract_d_t fwp_contract_create(fwp_contract_t *contract);
-int fwp_contract_reserve(fwp_contract_d_t contractd);
-int fwp_contract_commit(fwp_contract_d_t contractd, fwp_vres_d_t *vresdp);
-
int fwp_contract_negotiate(fwp_contract_d_t contract, fwp_vres_d_t *vresdp);
+
#endif /*_FWP_CONTRACT_H */
#define FWP_MNGT_DISCOVERY_STREAM_ID 3000
#define FWP_MNGT_RELIABILITY FWP_EPOINT_RELIABLE
+/**< Pointer to participant of this application*/
extern fwp_participant_t *fwp_participant_this;
+/**< Pointer to manager participant record*/
extern fwp_participant_t *fwp_participant_mngr;
int fwp_mngt_send(fwp_msg_type_t type,fwp_msgb_t *msgb,
#include "fwp_confdefs.h"
#include "fwp.h"
+#include "fwp_contract_table.h"
#include "fwp_participant_table.h"
#include "fwp_admctrl.h"
+#include "fwp_mngt.h"
#define FWP_MTU 2346
#define BUFFSIZE FWP_MTU
-#include "fwp_participant.h"
-#include <stdlib.h>
+//#include "ul_list.h"
+//#include "ul_gavlcust.h"
+#include "fwp_participant_table.h"
+#include <pthread.h>
+//#include <stdlib.h>
typedef
struct {
pthread_mutex_unlock(&fwp_participant_table.lock);
}
-fwp_participant_t* fwp_participant_table_find(fwp_participant_t *participant)
+fwp_participant_t* fwp_participant_table_find(fwp_participant_id_t *participant_id)
{
- return _fwp_participant_table_find(&fwp_participant_table, &participant->id);
+ return _fwp_participant_table_find(&fwp_participant_table, participant_id);
}
int fwp_participant_table_delete(fwp_participant_t *participant)
#ifndef _FWP_PARTICIPANT_TABLE_H
#define _FWP_PARTICIPANT_TABLE_H
-#include "fwp.h"
-
-#include "ul_list.h"
-#include "ul_gavlcust.h"
+#include "fwp_participant.h"
void fwp_participant_table_insert(fwp_participant_t *participant);
fwp_participant_t* fwp_participant_table_find(fwp_participant_id_t *participant_id);