2 *------------------------------------------------------------------
3 * Copyright (c) 2017 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *------------------------------------------------------------------
19 #include <sys/socket.h>
20 #include <sys/types.h>
26 #include <sys/ioctl.h>
29 #include <sys/prctl.h>
35 #include <memif_private.h>
37 /* sends msg to socket */
39 memif_msg_send_from_queue (memif_control_channel_t *cc)
41 struct msghdr mh = { 0 };
43 char ctl[CMSG_SPACE (sizeof (int))];
44 int rv, err = MEMIF_ERR_SUCCESS; /* 0 */
45 memif_msg_queue_elt_t *e;
47 /* Pick the first message */
48 e = TAILQ_FIRST(&cc->msg_queue);
50 return MEMIF_ERR_SUCCESS;
52 /* Construct the message */
53 iov[0].iov_base = (void *) &e->msg;
54 iov[0].iov_len = sizeof (memif_msg_t);
61 memset (&ctl, 0, sizeof (ctl));
63 mh.msg_controllen = sizeof (ctl);
64 cmsg = CMSG_FIRSTHDR (&mh);
65 cmsg->cmsg_len = CMSG_LEN (sizeof (int));
66 cmsg->cmsg_level = SOL_SOCKET;
67 cmsg->cmsg_type = SCM_RIGHTS;
68 memcpy (CMSG_DATA (cmsg), &e->fd, sizeof (int));
70 rv = sendmsg (cc->fd, &mh, 0);
72 err = memif_syscall_error_handler (errno);
73 DBG ("Message type %u sent", e->msg.type);
75 /* If sent successfully, remove the msg from queue */
76 if (err == MEMIF_ERR_SUCCESS) {
77 TAILQ_REMOVE(&cc->msg_queue, e, next);
78 cc->sock->args.free(e);
84 static memif_msg_queue_elt_t *
85 memif_msg_enq (memif_control_channel_t *cc)
87 memif_msg_queue_elt_t *e;
89 e = cc->sock->args.alloc(sizeof(*e));
94 TAILQ_INSERT_TAIL(&cc->msg_queue, e, next);
100 memif_msg_enq_hello (memif_control_channel_t *cc)
102 memif_msg_hello_t *h;
103 memif_msg_queue_elt_t *e = memif_msg_enq(cc);
106 return MEMIF_ERR_NOMEM;
108 e->msg.type = MEMIF_MSG_TYPE_HELLO;
111 h->min_version = MEMIF_VERSION;
112 h->max_version = MEMIF_VERSION;
113 h->max_s2m_ring = MEMIF_MAX_S2M_RING;
114 h->max_m2s_ring = MEMIF_MAX_M2S_RING;
115 h->max_region = MEMIF_MAX_REGION;
116 h->max_log2_ring_size = MEMIF_MAX_LOG2_RING_SIZE;
118 strncpy ((char *) h->name, (char *) cc->sock->args.app_name,
121 return MEMIF_ERR_SUCCESS;
124 /* response from memif master - master is ready to handle next message */
126 memif_msg_enq_ack (memif_control_channel_t *cc)
128 memif_msg_queue_elt_t *e = memif_msg_enq(cc);
131 return MEMIF_ERR_NOMEM;
133 e->msg.type = MEMIF_MSG_TYPE_ACK;
136 return MEMIF_ERR_SUCCESS; /* 0 */
139 /* send id and secret (optional) for interface identification */
141 memif_msg_enq_init (memif_control_channel_t *cc)
143 memif_msg_queue_elt_t *e = memif_msg_enq(cc);
146 return MEMIF_ERR_NOMEM;
148 memif_msg_init_t *i = &e->msg.init;
150 e->msg.type = MEMIF_MSG_TYPE_INIT;
152 i->version = MEMIF_VERSION;
153 i->id = cc->conn->args.interface_id;
154 i->mode = cc->conn->args.mode;
156 strncpy ((char *) i->name, (char *) cc->sock->args.app_name,
158 if (strlen ((char *) cc->conn->args.secret) > 0)
159 strncpy ((char *) i->secret, (char *) cc->conn->args.secret, sizeof (i->secret));
161 return MEMIF_ERR_SUCCESS; /* 0 */
164 /* send information about region specified by region_index */
166 memif_msg_enq_add_region (memif_control_channel_t *cc, uint8_t region_index)
168 memif_region_t *mr = &cc->conn->regions[region_index];
169 memif_msg_queue_elt_t *e = memif_msg_enq(cc);
172 return MEMIF_ERR_NOMEM;
174 memif_msg_add_region_t *ar = &e->msg.add_region;
176 e->msg.type = MEMIF_MSG_TYPE_ADD_REGION;
178 ar->index = region_index;
179 ar->size = mr->region_size;
181 return MEMIF_ERR_SUCCESS; /* 0 */
184 /* send information about ring specified by direction (S2M | M2S) and index */
186 memif_msg_enq_add_ring (memif_control_channel_t *cc, uint8_t index, uint8_t dir)
188 memif_msg_queue_elt_t *e = memif_msg_enq(cc);
191 return MEMIF_ERR_NOMEM;
193 memif_msg_add_ring_t *ar = &e->msg.add_ring;
195 e->msg.type = MEMIF_MSG_TYPE_ADD_RING;
197 /* TODO: support multiple rings */
199 if (dir == MEMIF_RING_M2S)
200 mq = &cc->conn->rx_queues[index];
202 mq = &cc->conn->tx_queues[index];
206 ar->offset = mq->offset;
207 ar->region = mq->region;
208 ar->log2_ring_size = mq->log2_ring_size;
209 ar->flags = (dir == MEMIF_RING_S2M) ? MEMIF_MSG_ADD_RING_FLAG_S2M : 0;
210 ar->private_hdr_size = 0;
212 return MEMIF_ERR_SUCCESS; /* 0 */
215 /* used as connection request from slave */
217 memif_msg_enq_connect (memif_control_channel_t *cc)
219 memif_msg_queue_elt_t *e = memif_msg_enq(cc);
222 return MEMIF_ERR_NOMEM;
224 memif_msg_connect_t *cm = &e->msg.connect;
226 e->msg.type = MEMIF_MSG_TYPE_CONNECT;
228 strncpy ((char *) cm->if_name, (char *) cc->conn->args.interface_name,
229 sizeof(cm->if_name));
231 return MEMIF_ERR_SUCCESS; /* 0 */
234 /* used as confirmation of connection by master */
236 memif_msg_enq_connected (memif_control_channel_t *cc)
238 memif_msg_queue_elt_t *e = memif_msg_enq(cc);
241 return MEMIF_ERR_NOMEM;
243 memif_msg_connected_t *cm = &e->msg.connected;
245 e->msg.type = MEMIF_MSG_TYPE_CONNECTED;
247 strncpy ((char *) cm->if_name, (char *) cc->conn->args.interface_name,
248 sizeof(cm->if_name));
250 return MEMIF_ERR_SUCCESS; /* 0 */
254 memif_msg_enq_disconnect (memif_control_channel_t *cc, uint8_t * err_string, uint32_t err_code)
256 memif_msg_queue_elt_t *e;
258 e = cc->sock->args.alloc(sizeof(*e));
260 return MEMIF_ERR_NOMEM;
263 /* Insert disconenct message at the top of the msg queue */
264 TAILQ_INSERT_HEAD(&cc->msg_queue, e, next);
266 memif_msg_disconnect_t *d = &e->msg.disconnect;
268 e->msg.type = MEMIF_MSG_TYPE_DISCONNECT;
270 uint16_t l = sizeof(d->string);
273 DBG ("Disconnect string too long. Sending first 96 characters.");
276 strncpy ((char *) d->string, (char *) err_string, l);
278 return MEMIF_ERR_SUCCESS;
282 memif_msg_parse_hello (memif_control_channel_t *cc, memif_msg_t * msg)
284 memif_msg_hello_t *h = &msg->hello;
285 memif_connection_t *c = cc->conn;
287 if (msg->hello.min_version > MEMIF_VERSION ||
288 msg->hello.max_version < MEMIF_VERSION)
290 DBG ("incompatible protocol version");
291 return MEMIF_ERR_PROTO;
294 c->run_args.num_s2m_rings = memif_min (h->max_s2m_ring + 1,
295 c->args.num_s2m_rings);
296 c->run_args.num_m2s_rings = memif_min (h->max_m2s_ring + 1,
297 c->args.num_m2s_rings);
298 c->run_args.log2_ring_size = memif_min (h->max_log2_ring_size,
299 c->args.log2_ring_size);
300 c->run_args.buffer_size = c->args.buffer_size;
301 strncpy ((char *) c->remote_name, (char *) h->name,
302 sizeof(c->remote_name));
304 return MEMIF_ERR_SUCCESS; /* 0 */
307 /* handle interface identification (id, secret (optional)) */
309 memif_msg_parse_init (memif_control_channel_t *cc, memif_msg_t * msg)
311 memif_msg_init_t *i = &msg->init;
312 memif_connection_t *c = NULL;
313 uint8_t err_string[96];
314 memset (err_string, 0, sizeof (char) * 96);
315 int err = MEMIF_ERR_SUCCESS; /* 0 */
317 /* Check compatible meimf version */
318 if (i->version != MEMIF_VERSION)
320 DBG ("MEMIF_VER_ERR");
321 memif_msg_enq_disconnect(cc, MEMIF_VER_ERR, 0);
322 return MEMIF_ERR_PROTO;
325 /* Find endpoint on the socket */
326 TAILQ_FOREACH(c, &cc->sock->master_interfaces, next)
328 /* Match interface id */
329 if (c->args.interface_id != i->id)
331 /* If control channel is present, interface is connected (or connecting) */
332 if (c->control_channel != NULL)
334 memif_msg_enq_disconnect(cc, "Already connected", 0);
335 return MEMIF_ERR_ALRCONN;
338 if (c->args.secret[0] != '\0') {
339 if (strncmp((char *) c->args.secret, (char *) i->secret, 24) != 0)
341 memif_msg_enq_disconnect(cc, "Incorrect secret", 0);
342 return MEMIF_ERR_SECRET;
346 /* Assign the control channel to this interface */
347 c->control_channel = cc;
350 strncpy ((char *) c->remote_name, (char *) i->name,
351 sizeof(c->remote_name));
357 /* receive region information and add new region to connection (if possible) */
359 memif_msg_parse_add_region (memif_control_channel_t *cc, memif_msg_t * msg,
362 memif_msg_add_region_t *ar = &msg->add_region;
364 memif_connection_t *c = cc->conn;
367 return MEMIF_ERR_NO_SHMFD;
369 if (ar->index > MEMIF_MAX_REGION)
370 return MEMIF_ERR_MAXREG;
373 (memif_region_t *) cc->sock->args.realloc (c->regions,
374 sizeof (memif_region_t) *
377 return memif_syscall_error_handler (errno);
378 memset (mr + ar->index, 0, sizeof (memif_region_t));
380 c->regions[ar->index].fd = fd;
381 c->regions[ar->index].region_size = ar->size;
382 c->regions[ar->index].addr = NULL;
383 /* region 0 is never external */
384 if (cc->sock->get_external_region_addr && (ar->index != 0))
385 c->regions[ar->index].is_external = 1;
387 return MEMIF_ERR_SUCCESS; /* 0 */
390 /* receive ring information and add new ring to connection queue
391 (based on direction S2M | M2S) */
393 memif_msg_parse_add_ring (memif_control_channel_t *cc, memif_msg_t * msg, int fd)
395 memif_msg_add_ring_t *ar = &msg->add_ring;
396 memif_connection_t *c = cc->conn;
401 return MEMIF_ERR_NO_INTFD;
403 if (ar->private_hdr_size != 0)
404 return MEMIF_ERR_PRIVHDR;
406 if (ar->flags & MEMIF_MSG_ADD_RING_FLAG_S2M)
408 if (ar->index > MEMIF_MAX_S2M_RING)
409 return MEMIF_ERR_MAXRING;
410 if (ar->index >= c->args.num_s2m_rings)
411 return MEMIF_ERR_MAXRING;
414 (memif_queue_t *) cc->sock->args.realloc (c->rx_queues,
415 sizeof (memif_queue_t) *
416 (++c->rx_queues_num));
417 memset (mq + ar->index, 0, sizeof (memif_queue_t));
419 return memif_syscall_error_handler (errno);
421 c->rx_queues[ar->index].int_fd = fd;
422 c->rx_queues[ar->index].log2_ring_size = ar->log2_ring_size;
423 c->rx_queues[ar->index].region = ar->region;
424 c->rx_queues[ar->index].offset = ar->offset;
425 c->run_args.num_s2m_rings++;
429 if (ar->index > MEMIF_MAX_M2S_RING)
430 return MEMIF_ERR_MAXRING;
431 if (ar->index >= c->args.num_m2s_rings)
432 return MEMIF_ERR_MAXRING;
435 (memif_queue_t *) cc->sock->args.realloc (c->tx_queues,
436 sizeof (memif_queue_t) *
437 (++c->tx_queues_num));
438 memset (mq + ar->index, 0, sizeof (memif_queue_t));
440 return memif_syscall_error_handler (errno);
442 c->tx_queues[ar->index].int_fd = fd;
443 c->tx_queues[ar->index].log2_ring_size = ar->log2_ring_size;
444 c->tx_queues[ar->index].region = ar->region;
445 c->tx_queues[ar->index].offset = ar->offset;
446 c->run_args.num_m2s_rings++;
449 return MEMIF_ERR_SUCCESS; /* 0 */
453 memif_configure_rx_interrupt (memif_connection_t *c)
455 memif_socket_t *ms = (memif_socket_t *) c->args.socket;
456 memif_interrupt_t *idata;
457 memif_fd_event_t fde;
458 memif_fd_event_data_t *fdata;
462 if (c->on_interrupt != NULL)
464 for (i = 0; i < c->run_args.num_m2s_rings; i++)
466 /* Allocate fd event data */
467 fdata = ms->args.alloc(sizeof(*fdata));
469 memif_msg_enq_disconnect(c->control_channel, "Internal error", 0);
470 return MEMIF_ERR_NOMEM;
472 /* Allocate interrupt data */
473 idata = ms->args.alloc(sizeof(*fdata));
475 ms->args.free(fdata);
476 memif_msg_enq_disconnect(c->control_channel, "Internal error", 0);
477 return MEMIF_ERR_NOMEM;
480 /* configure interrupt data */
483 /* configure fd event data */
484 fdata->event_handler = memif_interrupt_handler;
485 fdata->private_ctx = idata;
486 fde.fd = c->rx_queues[i].int_fd;
487 fde.type = MEMIF_FD_EVENT_READ;
488 fde.private_ctx = fdata;
490 /* Start listening for events */
491 ctx = ms->epfd != -1 ? ms : ms->private_ctx;
492 ms->args.on_control_fd_update(fde, ctx);
496 return MEMIF_ERR_SUCCESS;
499 /* slave -> master */
501 memif_msg_parse_connect (memif_control_channel_t *cc, memif_msg_t * msg)
503 memif_msg_connect_t *cm = &msg->connect;
504 memif_connection_t *c = cc->conn;
507 err = memif_connect1 (c);
508 if (err != MEMIF_ERR_SUCCESS)
511 strncpy ((char *) c->remote_if_name, (char *) cm->if_name,
512 sizeof(c->remote_if_name));
514 err = memif_configure_rx_interrupt(c);
515 if (err != MEMIF_ERR_SUCCESS)
518 c->on_connect ((void *) c, c->private_ctx);
523 /* master -> slave */
525 memif_msg_parse_connected (memif_control_channel_t *cc, memif_msg_t * msg)
527 memif_msg_connect_t *cm = &msg->connect;
528 memif_connection_t *c = cc->conn;
531 err = memif_connect1 (c);
532 if (err != MEMIF_ERR_SUCCESS)
535 strncpy ((char *) c->remote_if_name, (char *) cm->if_name,
536 sizeof(c->remote_if_name));
538 err = memif_configure_rx_interrupt(c);
539 if (err != MEMIF_ERR_SUCCESS)
542 c->on_connect ((void *) c, c->private_ctx);
548 memif_msg_parse_disconnect (memif_control_channel_t *cc, memif_msg_t * msg)
550 memif_msg_disconnect_t *d = &msg->disconnect;
551 memif_connection_t *c = cc->conn;
553 memset (c->remote_disconnect_string, 0,
554 sizeof (c->remote_disconnect_string));
555 strncpy ((char *) c->remote_disconnect_string, (char *) d->string,
556 sizeof(c->remote_disconnect_string));
558 /* on returning error, handle function will call memif_disconnect () */
559 DBG ("disconnect received: %s, mode: %d",
560 c->remote_disconnect_string, c->args.mode);
561 return MEMIF_ERR_DISCONNECT;
565 memif_msg_receive_and_parse (memif_control_channel_t *cc)
567 char ctl[CMSG_SPACE (sizeof (int)) +
568 CMSG_SPACE (sizeof (struct ucred))] = { 0 };
569 struct msghdr mh = { 0 };
571 memif_msg_t msg = { 0 };
573 int err = MEMIF_ERR_SUCCESS; /* 0 */
576 memif_socket_t *ms = NULL;
578 iov[0].iov_base = (void *) &msg;
579 iov[0].iov_len = sizeof (memif_msg_t);
582 mh.msg_control = ctl;
583 mh.msg_controllen = sizeof (ctl);
585 DBG ("recvmsg fd %d", cc->fd);
586 size = recvmsg (cc->fd, &mh, 0);
587 if (size != sizeof (memif_msg_t))
590 return MEMIF_ERR_DISCONNECTED;
592 return MEMIF_ERR_MFMSG;
595 struct cmsghdr *cmsg;
597 cmsg = CMSG_FIRSTHDR (&mh);
600 if (cmsg->cmsg_level == SOL_SOCKET)
602 if (cmsg->cmsg_type == SCM_CREDENTIALS)
606 else if (cmsg->cmsg_type == SCM_RIGHTS)
608 int *fdp = (int *) CMSG_DATA (cmsg);
612 cmsg = CMSG_NXTHDR (&mh, cmsg);
615 DBG ("Message type %u received", msg.type);
619 case MEMIF_MSG_TYPE_ACK:
622 case MEMIF_MSG_TYPE_HELLO:
623 if ((err = memif_msg_parse_hello (cc, &msg)) != MEMIF_ERR_SUCCESS)
625 if ((err = memif_init_regions_and_queues (cc->conn)) != MEMIF_ERR_SUCCESS)
627 if ((err = memif_msg_enq_init (cc)) != MEMIF_ERR_SUCCESS)
629 for (i = 0; i < cc->conn->regions_num; i++)
631 if ((err = memif_msg_enq_add_region (cc, i)) != MEMIF_ERR_SUCCESS)
634 for (i = 0; i < cc->conn->run_args.num_s2m_rings; i++)
637 memif_msg_enq_add_ring (cc, i,
638 MEMIF_RING_S2M)) != MEMIF_ERR_SUCCESS)
641 for (i = 0; i < cc->conn->run_args.num_m2s_rings; i++)
644 memif_msg_enq_add_ring (cc, i,
645 MEMIF_RING_M2S)) != MEMIF_ERR_SUCCESS)
648 if ((err = memif_msg_enq_connect (cc)) != MEMIF_ERR_SUCCESS)
652 case MEMIF_MSG_TYPE_INIT:
653 if ((err = memif_msg_parse_init (cc, &msg)) != MEMIF_ERR_SUCCESS)
655 /* c->remote_pid = cr->pid */
656 /* c->remote_uid = cr->uid */
657 /* c->remote_gid = cr->gid */
658 if ((err = memif_msg_enq_ack (cc)) != MEMIF_ERR_SUCCESS)
662 case MEMIF_MSG_TYPE_ADD_REGION:
664 memif_msg_parse_add_region (cc, &msg, fd)) != MEMIF_ERR_SUCCESS)
666 if ((err = memif_msg_enq_ack (cc)) != MEMIF_ERR_SUCCESS)
670 case MEMIF_MSG_TYPE_ADD_RING:
672 memif_msg_parse_add_ring (cc, &msg, fd)) != MEMIF_ERR_SUCCESS)
674 if ((err = memif_msg_enq_ack (cc)) != MEMIF_ERR_SUCCESS)
678 case MEMIF_MSG_TYPE_CONNECT:
679 if ((err = memif_msg_parse_connect (cc, &msg)) != MEMIF_ERR_SUCCESS)
681 if ((err = memif_msg_enq_connected (cc)) != MEMIF_ERR_SUCCESS)
685 case MEMIF_MSG_TYPE_CONNECTED:
686 if ((err = memif_msg_parse_connected (cc, &msg)) != MEMIF_ERR_SUCCESS)
690 case MEMIF_MSG_TYPE_DISCONNECT:
691 if ((err = memif_msg_parse_disconnect (cc, &msg)) != MEMIF_ERR_SUCCESS)
696 return MEMIF_ERR_UNKNOWN_MSG;;
700 return MEMIF_ERR_SUCCESS; /* 0 */
704 memif_delete_control_channel (memif_control_channel_t *cc)
706 memif_msg_queue_elt_t *e, *next;
707 memif_socket_t *ms = cc->sock;
708 memif_fd_event_t fde;
712 fde.type = MEMIF_FD_EVENT_DEL;
713 ctx = ms->epfd != -1 ? ms : ms->private_ctx;
714 cc->sock->args.on_control_fd_update(fde, ctx);
719 /* Clear control message queue */
720 for (e = TAILQ_FIRST(&cc->msg_queue); e != NULL; e = next) {
721 next = TAILQ_NEXT(e, next);
722 TAILQ_REMOVE(&cc->msg_queue, e, next);
723 cc->sock->args.free(e);
726 /* remove reference */
727 if (cc->conn != NULL)
728 cc->conn->control_channel = NULL;
730 cc->sock->args.free(cc);
737 memif_control_channel_handler (memif_fd_event_type_t type, void *private_ctx)
739 memif_control_channel_t *cc = (memif_control_channel_t *) private_ctx;
742 /* Receive the message, parse the message and
743 * enqueue next message(s).
745 err = memif_msg_receive_and_parse(cc);
746 /* Can't assign to endpoint */
747 if (cc->conn == NULL) {
748 /* A disconnect message is already in the queue */
749 memif_msg_send_from_queue(cc);
750 memif_delete_control_channel(cc);
752 return MEMIF_ERR_SUCCESS;
754 /* error in memif_msg_receive */
755 if (err != MEMIF_ERR_SUCCESS)
758 /* Continue connecting, send next message from the queue */
759 err = memif_msg_send_from_queue(cc);
760 if (err != MEMIF_ERR_SUCCESS)
763 return MEMIF_ERR_SUCCESS;
766 memif_disconnect_internal(cc->conn);
767 return MEMIF_ERR_SUCCESS;
771 memif_listener_handler (memif_fd_event_type_t type, void *private_ctx)
773 memif_socket_t *ms = (memif_socket_t *) private_ctx;
774 memif_control_channel_t *cc;
775 memif_fd_event_t fde;
776 memif_fd_event_data_t *fdata;
777 struct sockaddr_un un;
778 int err, sockfd, addr_len = sizeof(un);
782 return MEMIF_ERR_INVAL_ARG;
784 if (type & MEMIF_FD_EVENT_READ) {
785 /* Accept connection to the listener socket */
786 sockfd = accept(ms->listener_fd, (struct sockaddr *)&un, (socklen_t *)&addr_len);
788 return memif_syscall_error_handler(errno);
791 /* Create new control channel */
792 cc = ms->args.alloc(sizeof(*cc));
794 err = MEMIF_ERR_NOMEM;
799 /* The connection will be assigned after parsing MEMIF_MSG_TYPE_INIT msg */
802 TAILQ_INIT(&cc->msg_queue);
804 /* Create memif fd event */
805 fdata = ms->args.alloc(sizeof(*fdata));
807 err = MEMIF_ERR_NOMEM;
811 fdata->event_handler = memif_control_channel_handler;
812 fdata->private_ctx = cc;
815 fde.type = MEMIF_FD_EVENT_READ;
816 fde.private_ctx = fdata;
818 /* Start listenning for events on the new control channel */
819 ctx = ms->epfd != -1 ? ms : ms->private_ctx;
820 ms->args.on_control_fd_update(fde, ctx);
822 /* enqueue HELLO msg */
823 err = memif_msg_enq_hello(cc);
824 if (err != MEMIF_ERR_SUCCESS)
828 err = memif_msg_send_from_queue(cc);
829 if (err != MEMIF_ERR_SUCCESS)
833 return MEMIF_ERR_SUCCESS;
841 ms->args.free(fdata);