#define _FWP_CONTRACT_H
#include "fwp_vres.h"
-#include "ul_list.h"
-#include "ul_gavlcust.h"
-#include <stdlib.h>
/*
*typedef struct mfrsh_contract_ops{
* fwp_contract_d_t (*create)(fwp_contract_t *contract);
*}
*/
-/**< Contract Status */
-/*typedef enum {
- FWP_CONT_INVALID = 0,
- FWP_CONT_REQUESTED = 1,
- FWP_CONT_REJECTED = 2,
- FWP_CONT_NEGOTIATED = 3,
- FWP_CONT_ACCEPTED = 4
-} fwp_contract_status_t;*/
-
-typedef enum {
- FWP_CONT_NOTNEGOTIATED = 0,
- FWP_CONT_RESERVED = 1,
- FWP_CONT_NEGOTIATED = 2
-} fwp_contract_status_t;
-
/**
* FWP contract.
* It is an external representation of contract intented for application
} fwp_contract_t;
struct fwp_contract_data;
-//typedef struct fwp_contract_data fwp_contract_data_t;
typedef struct fwp_contract_data* fwp_contract_d_t;
+fwp_contract_d_t fwp_contract_create(fwp_contract_t *contract);
+int fwp_contract_negotiate(fwp_contract_d_t contract, fwp_vres_d_t *vresdp);
+int fwp_contract_is_negotiated(fwp_contract_d_t contract);
+
+
#ifdef _FWP_INTERNALS_
+
+#include "ul_gavlcust.h"
+#include "ul_list.h"
+#include <stdlib.h>
+
+/**< Contract Status */
+/*typedef enum {
+ FWP_CONT_INVALID = 0,
+ FWP_CONT_REQUESTED = 1,
+ FWP_CONT_REJECTED = 2,
+ FWP_CONT_NEGOTIATED = 3,
+ FWP_CONT_ACCEPTED = 4
+} fwp_contract_status_t;*/
+
+typedef enum {
+ FWP_CONT_NOTNEGOTIATED = 0,
+ FWP_CONT_RESERVED = 1,
+ FWP_CONT_NEGOTIATED = 2
+} fwp_contract_status_t;
+
+typedef struct fwp_contract_data fwp_contract_data_t;
typedef fwp_vres_id_t fwp_contract_id_t;
/**
ul_list_node_t list_node;
gavl_node_t tree_node;
-} fwp_contract_data_t;
-
+};
static inline fwp_contract_data_t* fwp_contract_data_new()
{
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_negotiate(fwp_contract_d_t contract, fwp_vres_d_t *vresdp);
-int fwp_contract_is_negotiated(fwp_contract_d_t contract);
-
-
+#endif /*_FWP_INTERNALS_ */
#endif /*_FWP_CONTRACT_H */