]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
Clean-up header files
authorMartin Molnar <molnar@sum.(none)>
Wed, 18 Jun 2008 16:05:34 +0000 (18:05 +0200)
committerMartin Molnar <molnar@sum.(none)>
Wed, 18 Jun 2008 16:05:34 +0000 (18:05 +0200)
fwp/lib/core/Makefile.omk
fwp/lib/core/fwp_endpoint.c
fwp/lib/core/fwp_endpoint.h
fwp/lib/fwp.h
fwp/lib/mngt/Makefile.omk
fwp/lib/mngt/fwp_contract.c
fwp/lib/mngt/fwp_contract.h
fwp/lib/mngt/fwp_mngt.h
fwp/mngr/fwp_mngr.c
fwp/mngr/fwp_participant_table.c
fwp/mngr/fwp_participant_table.h

index 0aeb53b47e919421c0c8dcde74f12e6725ddadec..db5014be705fd5a2abb52b3f03e21ea8b73b1811 100644 (file)
@@ -1,5 +1,5 @@
 #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
index e5bba4d0bce668f596adf45dafd3b93cd0c08e47..b43abce893a49556477529042bfaa41dee975ed0 100644 (file)
@@ -1,6 +1,5 @@
 #include "fwp_endpoint.h"
 
-#include "fwp_util.h"
 #include "fwp_msgb.h"
 
 typedef enum {
index c2bfb82a02eb2225716c2b2fd112150d41529ca4..ac8ee62f423446448f7cc97cff165d0240167b04 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _FWP_ENDPOINT_H
 #define _FWP_ENDPOINT_H
 
-
 #define FWP_ANY_NODE INADDR_ANY
 
 typedef enum {
@@ -23,6 +22,8 @@ struct fwp_endpoint_attr {
        /* queueing policy*/
 } fwp_endpoint_attr_t;
 
+#include "fwp_util.h"
+#include "fwp_util.h"
 #include "fwp_vres.h"
 #include <string.h>
 
index 3f1ac256cf247d86b56b7a9bb07914a4ab5ac249..e1da8142ec2aa1fb291d5a01c1573be0484c90f1 100644 (file)
@@ -5,8 +5,6 @@
 #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()
 {
index 901f694e8b85168de2623ba2f08b739b86b7f7df..38b3644cb4b75b1ed6de79325217963d5b4b8c68 100644 (file)
@@ -1,5 +1,5 @@
 #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  
 
index 7731a549df68eda3bb82a6b9ad9e6f0dbee67c3d..e1f70322780c8ce5abdd7e4fab55ba231dab891c 100644 (file)
@@ -4,6 +4,17 @@
 #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.
index e243928412fd90592170a8bfea99fd729009abf0..58cc79c73d3cd760cb4e45a6731926b67cde2968 100644 (file)
@@ -46,12 +46,12 @@ struct fwp_contract {
        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.
@@ -82,22 +82,13 @@ static inline fwp_contract_data_t* fwp_contract_data_new()
                        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 */ 
index c963f730aa7f51626691a66d14202504e0f5c9a5..dcb6ef07ad482458f31daf8151bc63afd3cf2465 100644 (file)
@@ -14,7 +14,9 @@
 #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,
index c89d06e69fb85e2dc84ae112262d1b6bb49fab15..6971679051596bcabc643c062ec556876271c047 100644 (file)
@@ -3,8 +3,10 @@
 
 #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 
index 456ebdc84ac6edbdef38355be973e611e2a092af..1a9906f1d01256437c40bfe681fb7ffdd77fb3f2 100644 (file)
@@ -1,5 +1,8 @@
-#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 {
@@ -48,9 +51,9 @@ void fwp_participant_table_insert(fwp_participant_t *participant)
        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)
index fd8c81036e5822fe15b06264033a1e75326b9c11..1c9364a3ce6b8b6afa8be4260d8d49f53914b5a8 100644 (file)
@@ -1,10 +1,7 @@
 #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);