* On error, negative error code is returned.
*
*/
-int fwp_send_endpoint_create(unsigned int node, unsigned int port,
+
+int fwp_send_endpoint_create(unsigned int node, unsigned int port, int flags,
fwp_endpoint_d_t *epointdp)
{
struct sockaddr_in *addr;
addr->sin_family = AF_INET;
addr->sin_addr.s_addr = node;
addr->sin_port = htons(port);
+
+ if (flags && FWP_RELIABLE) {
+ if ((sockd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
+ perror("Unable to open socket");
+ return (-errno);
+ }
+ }else{
+ if ((sockd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
+ perror("Unable to open socket");
+ return (-errno);
+ }
+
+
+
+ }
FWP_DEBUG("Send endpoint created.\n");
*epointdp = epoint;
return 0;
}
-
/**
* Creates receive endpoint
*
/* consideration: move tx_queue to endpoint */
/**< queue for messages to send */
struct fwp_msgq tx_queue;
+ int flags;
/**< endpoint bounded to this vres */
fwp_endpoint_d_t epointd;
pthread_t tx_thread; /**< tx_thread id*/
vres = fwp_vres_alloc();
if (!vres) {
- FWP_DEBUG("OK");
return -ENOMEM;
}
/* copy vres paramters into vres structure */
{
fwp_vres_t *vres = vresd;
+ /* test flags to check whether to send reliably*/
if (vres->status != FWP_VRES_INACTIVE) {
return fwp_msgq_enqueue(&vres->tx_queue, msgb);
} else