struct fwp_vres{
struct fwp_contract contract;
/* consideration: move tx_queue to endpoint */
- struct fwp_msgq tx_queue; /**< queue for messages to send */
- struct fwp_endpoint *epoint; /**< endpoint bounded to this vres */
+ struct fwp_msgq tx_queue; /**< queue for messages to send */
+ struct fwp_endpoint *epoint; /**< endpoint bounded to this vres */
pthread_t tx_thread;
pthread_attr_t tx_thread_attr;
fwp_vres_status_t status;
vres->status = FWP_VRES_CLOSING;
/* unbind endpoint */
- fwp_endpoint_unbind(vres->epoint);
+ vres->epoint->status = FWP_EPOINT_UNBOUND;
pthread_cancel(vres->tx_thread);
return NULL;
}
-inline void fwp_vres_endpoint_bind(unsigned int id, struct endpoint *epoint)
+inline void fwp_vres_endpoint_bind(unsigned int vres_id,
+ struct fwp_endpoint *epoint)
{
- fwp_vres_table[id].epoint = epoint;
+ fwp_vres_table[vres_id].epoint = epoint;
}
-inline void fwp_vres_endpoint_unbind(unsigned int id)
+inline void fwp_vres_endpoint_unbind(unsigned int vres_id)
{
- struct fwp_vres *vres = &fwp_vres_table[id];
+ struct fwp_vres *vres = &fwp_vres_table[vres_id];
vres->epoint = NULL;
/* TODO: consider what to do with pending messages */