}
FWP_DEBUG("FWP Send endpoint created.\n");
+
+#ifndef FWP_CONTNEGT
+ /* Create vres with default parameters */
+ if (fwp_vres_create(&fwp_vres_params_default, &fwp_epoint->vresd)) {
+ goto err;
+ }
+#endif
+
*epoint = fwp_epoint;
return 0;
err:
addr->sin_family = AF_INET;
/* TODO: set listen interface, maybe through config struct*/
addr->sin_addr.s_addr = INADDR_ANY;
- addr->sin_port = htons(port);
+ fwp_epoint->port = addr->sin_port = htons(port);
fwp_epoint->peer.addrlen = sizeof(struct sockaddr_in);
if (fwp_epoint->attr.reliability == FWP_EPOINT_RELIABLE) {
*/
int fwp_send_endpoint_bind(fwp_endpoint_t *epoint, fwp_vres_d_t vresd)
{
- int rv ;
+ int rv;
fwp_endpoint_t *fwp_epoint = epoint;
+#ifndef FWP_CONTNEGT
+ FWP_DEBUG("Empty bind\n");
+ rv = fwp_vres_bind(fwp_epoint->vresd, fwp_epoint->sockd);
+#else
fwp_epoint->vresd = vresd;
rv = fwp_vres_bind(vresd, fwp_epoint->sockd);
/* if send endpoint is already bound
if (epoint->type == FWP_EPOINT_BOUND) {
fwp_send_endpoint_unbind(epoint);
}*/
-
+#endif
return rv;
}
if (FD_ISSET(fwp_epoint->sockd, &fdset)) { /* is it listen socket? */
fwp_receive_endpoint_accept(fwp_epoint);
- FWP_DEBUG("After accepted\n");
continue;
}
int fwp_vres_bind(fwp_vres_d_t vresd, int sockd);
int fwp_vres_unbind(fwp_vres_d_t vresd);
+extern fwp_vres_params_t fwp_vres_params_default;
+
#endif /* _FWP_INTERNALS_ */
#endif /* _FWP_VRES_H */
node = (unsigned int) endpoint->destination;
port = (unsigned int) endpoint->stream_id;
- attr = (fwp_endpoint_attr_t*) endpoint->protocol_info.body;
+ attr = (fwp_endpoint_attr_t*) endpoint->endpoint_protocol_info.send.body;
rv = fwp_send_endpoint_create(node, port, attr, &fwp_epoint);
if (rv)
return rv;
int fwp_fna_send_endpoint_bind(fna_endpoint_data_t *endpoint, fna_vres_id_t vres)
{
return fwp_send_endpoint_bind(endpoint->protocol_info.body,
- (fwp_vres_t*) vres);
+ (fwp_endpoint_t*) vres);
}
int fwp_fna_send_endpoint_unbind(fna_endpoint_data_t *endpoint)