Lines Matching defs:msg

81 static int process_sckm_req(int fd, sckm_ioctl_getreq_t *msg);
82 static int send_sckm_status(int fd, sckm_ioctl_status_t *msg);
85 static int convert_pfkey_msg(struct sadb_msg *msg);
101 sckm_ioctl_getreq_t msg;
187 (void) memset(&msg, 0, sizeof (sckm_ioctl_getreq_t));
188 msg.buf = (caddr_t)msg_buf;
190 msg.buf_len = SCKMD_MAX_MSG_SIZE;
193 if (ioctl(fd, SCKM_IOCTL_GETREQ, &msg) == -1) {
200 if (process_sckm_req(fd, &msg) == -1) {
220 process_sckm_req(int fd, sckm_ioctl_getreq_t *msg)
230 if (msg == NULL) {
237 reply.transid = msg->transid;
240 if (msg->type != SCKM_IOCTL_REQ_SADB) {
242 msg->type);
248 if (msg->buf_len < sizeof (struct sadb_msg)) {
255 pfkey_msg = (struct sadb_msg *)msg->buf;
343 send_sckm_status(int fd, sckm_ioctl_status_t *msg)
345 if (ioctl(fd, SCKM_IOCTL_STATUS, msg) == -1) {
375 struct sadb_msg *msg;
417 msg = read_pfkey_msg();
419 if (msg == NULL) {
425 if (msg->sadb_msg_seq == req_seq &&
426 msg->sadb_msg_pid == mypid) {
445 if (msg->sadb_msg_type != req_type) {
447 msg->sadb_msg_type);
458 if ((msg->sadb_msg_errno != 0) && !((msg->sadb_msg_errno == ESRCH) &&
459 (msg->sadb_msg_type == SADB_DELETE))) {
469 if (msg->sadb_msg_type >= arr_sz) {
472 msg->sadb_msg_type);
477 diagnostic_str = keysock_diag(msg->sadb_x_msg_diagnostic);
482 pfkey_msg_type[msg->sadb_msg_type],
483 msg->sadb_msg_errno, strerror(msg->sadb_msg_errno),
484 msg->sadb_x_msg_diagnostic, diagnostic_str);
487 errno = msg->sadb_msg_errno;
557 convert_pfkey_msg(struct sadb_msg *msg)
561 switch (msg->sadb_msg_version) {
571 "PF_KEY version %d\n", msg->sadb_msg_version);