ssize_t len;
msgb = fwp_msgb_alloc(sizeof(struct fwp_msg_header) +
- sizeof(struct fwp_msg_contract));
+ sizeof(struct fwp_msg_vres_params)/*FWP_MTU*/);
if (!msgb)
return -ENOMEM;
fwp_msgb_pull(msgb, sizeof(struct fwp_msg_vres_params));
fwp_msgb_free(msgb);
-
+ FWP_DEBUG("status = %d\n", status);
if (status == FWP_CONT_NEGOTIATED) {
FWP_DEBUG("Contract negotiated\n");
if ((rc = fwp_vres_open(&vparams)) < 0){
#include "fwp_util.h"
#include "fwp_msgq.h"
#include "fwp_msg.h"
+#include "fwp_contract.h"
#include "fwp_vres.h"
{
fwp_handshake_t *handshake;
struct sockaddr_un *unsock;
-
+ fwp_contract_status_t status;
+ fwp_vres_params_t vparams;
+
handshake = hashtbl_get(&handshake_tbl, hid);
if (!handshake) {
return -EINVAL;
}
+ fwp_msg_vres_params_inflate(msgb->data, &status, &vparams);
fwp_msgb_push(msgb, sizeof(struct fwp_msg_header));
+ FWP_DEBUG("status = %d\n", status);
FWP_DEBUG("hid = %d\n", hid);
FWP_DEBUG("id = %d\n", handshake->id);
FWP_DEBUG("len = %d\n", handshake->peer.addrlen);
msgb->peer = &contdata->source;
/* add sending to local app through unix socket */
fwp_vres_send(service_vres_id, msgb);
-
+ FWP_DEBUG("len = %d", msgb->len);
return 0;
}
fwp_init();
rc = fwp_contract_negotiate(&cnt1, &vres_id);
- if (rc == FWP_CONT_NEGOTIATED) {
+ if (rc == FWP_CONTNEGT_ACCEPTED) {
printf("Contract 1 negotiated\n");
} else
printf("Contract 1 rejected.\n");
rc = fwp_contract_negotiate(&cnt2, &vres_id);
- if (rc == FWP_CONT_NEGOTIATED) {
+ if (rc == FWP_CONTNEGT_ACCEPTED) {
printf("Contract 2 negotiated\n");
} else
printf("Contract 2 rejected.\n");