- if (unformat (line_input, "heapsize %s", &chroot_path))
- {
- vec_terminate_c_string (chroot_path);
- if (VPPCOM_DEBUG > 0)
- clib_warning ("[%d] configured heapsize %s, "
- "actual heapsize %lld (0x%llx)",
- vcm->my_pid, chroot_path, vcl_cfg->heapsize,
- vcl_cfg->heapsize);
- vec_free (chroot_path);
- }
- else if (unformat (line_input, "api-prefix %s", &chroot_path))
- {
- vec_terminate_c_string (chroot_path);
- vl_set_memory_root_path ((char *) chroot_path);
- if (VPPCOM_DEBUG > 0)
- clib_warning ("[%d] configured api-prefix %s",
- vcm->my_pid, chroot_path);
- chroot_path = 0; /* Don't vec_free() it! */
- }
- else if (unformat (line_input, "uid %d", &uid))
- {
- vl_set_memory_uid (uid);
- if (VPPCOM_DEBUG > 0)
- clib_warning ("[%d] configured uid %d", vcm->my_pid, uid);
- }
- else if (unformat (line_input, "gid %d", &gid))
- {
- vl_set_memory_gid (gid);
- if (VPPCOM_DEBUG > 0)
- clib_warning ("[%d] configured gid %d", vcm->my_pid, gid);
- }
- else if (unformat (line_input, "segment-baseva 0x%llx",
- &vcl_cfg->segment_baseva))
- {
- if (VPPCOM_DEBUG > 0)
- clib_warning ("[%d] configured segment_baseva 0x%llx",
- vcm->my_pid, vcl_cfg->segment_baseva);
- }
- else if (unformat (line_input, "segment-size 0x%lx",
- &vcl_cfg->segment_size))
- {
- if (VPPCOM_DEBUG > 0)
- clib_warning ("[%d] configured segment_size 0x%lx (%ld)",
- vcm->my_pid, vcl_cfg->segment_size,
- vcl_cfg->segment_size);
- }
- else if (unformat (line_input, "segment-size %ld",
- &vcl_cfg->segment_size))
- {
- if (VPPCOM_DEBUG > 0)
- clib_warning ("[%d] configured segment_size %ld (0x%lx)",
- vcm->my_pid, vcl_cfg->segment_size,
- vcl_cfg->segment_size);
- }
- else if (unformat (line_input, "add-segment-size 0x%lx",
- &vcl_cfg->add_segment_size))
- {
- if (VPPCOM_DEBUG > 0)
- clib_warning
- ("[%d] configured add_segment_size 0x%lx (%ld)",
- vcm->my_pid, vcl_cfg->add_segment_size,
- vcl_cfg->add_segment_size);
- }
- else if (unformat (line_input, "add-segment-size %ld",
- &vcl_cfg->add_segment_size))
- {
- if (VPPCOM_DEBUG > 0)
- clib_warning
- ("[%d] configured add_segment_size %ld (0x%lx)",
- vcm->my_pid, vcl_cfg->add_segment_size,
- vcl_cfg->add_segment_size);
- }
- else if (unformat (line_input, "preallocated-fifo-pairs %d",
- &vcl_cfg->preallocated_fifo_pairs))
- {
- if (VPPCOM_DEBUG > 0)
- clib_warning ("[%d] configured preallocated_fifo_pairs "
- "%d (0x%x)", vcm->my_pid,
- vcl_cfg->preallocated_fifo_pairs,
- vcl_cfg->preallocated_fifo_pairs);
- }
- else if (unformat (line_input, "rx-fifo-size 0x%lx",
- &vcl_cfg->rx_fifo_size))
- {
- if (VPPCOM_DEBUG > 0)
- clib_warning ("[%d] configured rx_fifo_size 0x%lx (%ld)",
- vcm->my_pid, vcl_cfg->rx_fifo_size,
- vcl_cfg->rx_fifo_size);
- }
- else if (unformat (line_input, "rx-fifo-size %ld",
- &vcl_cfg->rx_fifo_size))
- {
- if (VPPCOM_DEBUG > 0)
- clib_warning ("[%d] configured rx_fifo_size %ld (0x%lx)",
- vcm->my_pid, vcl_cfg->rx_fifo_size,
- vcl_cfg->rx_fifo_size);
- }
- else if (unformat (line_input, "tx-fifo-size 0x%lx",
- &vcl_cfg->tx_fifo_size))
- {
- if (VPPCOM_DEBUG > 0)
- clib_warning ("[%d] configured tx_fifo_size 0x%lx (%ld)",
- vcm->my_pid, vcl_cfg->tx_fifo_size,
- vcl_cfg->tx_fifo_size);
- }
- else if (unformat (line_input, "tx-fifo-size %ld",
- &vcl_cfg->tx_fifo_size))
- {
- if (VPPCOM_DEBUG > 0)
- clib_warning ("[%d] configured tx_fifo_size %ld (0x%lx)",
- vcm->my_pid, vcl_cfg->tx_fifo_size,
- vcl_cfg->tx_fifo_size);
- }
- else if (unformat (line_input, "event-queue-size 0x%lx",
- &vcl_cfg->event_queue_size))
- {
- if (VPPCOM_DEBUG > 0)
- clib_warning ("[%d] configured event_queue_size 0x%lx (%ld)",
- vcm->my_pid, vcl_cfg->event_queue_size,
- vcl_cfg->event_queue_size);
- }
- else if (unformat (line_input, "event-queue-size %ld",
- &vcl_cfg->event_queue_size))
- {
- if (VPPCOM_DEBUG > 0)
- clib_warning ("[%d] configured event_queue_size %ld (0x%lx)",
- vcm->my_pid, vcl_cfg->event_queue_size,
- vcl_cfg->event_queue_size);
- }
- else if (unformat (line_input, "listen-queue-size 0x%lx",
- &vcl_cfg->listen_queue_size))
- {
- if (VPPCOM_DEBUG > 0)
- clib_warning ("[%d] configured listen_queue_size 0x%lx (%ld)",
- vcm->my_pid, vcl_cfg->listen_queue_size,
- vcl_cfg->listen_queue_size);
- }
- else if (unformat (line_input, "listen-queue-size %ld",
- &vcl_cfg->listen_queue_size))
- {
- if (VPPCOM_DEBUG > 0)
- clib_warning ("[%d] configured listen_queue_size %ld (0x%lx)",
- vcm->my_pid, vcl_cfg->listen_queue_size,
- vcl_cfg->listen_queue_size);
- }
- else if (unformat (line_input, "app-timeout %f",
- &vcl_cfg->app_timeout))
- {
- if (VPPCOM_DEBUG > 0)
- clib_warning ("[%d] configured app_timeout %f",
- vcm->my_pid, vcl_cfg->app_timeout);
- }
- else if (unformat (line_input, "session-timeout %f",
- &vcl_cfg->session_timeout))
- {
- if (VPPCOM_DEBUG > 0)
- clib_warning ("[%d] configured session_timeout %f",
- vcm->my_pid, vcl_cfg->session_timeout);
- }
- else if (unformat (line_input, "accept-timeout %f",
- &vcl_cfg->accept_timeout))
- {
- if (VPPCOM_DEBUG > 0)
- clib_warning ("[%d] configured accept_timeout %f",
- vcm->my_pid, vcl_cfg->accept_timeout);
- }
- else if (unformat (line_input, "}"))
- {
- vc_cfg_input = 0;
- if (VPPCOM_DEBUG > 0)
- clib_warning ("[%d] completed parsing vppcom config!",
- vcm->my_pid);
- goto input_done;
- }
- else
- {
- if (line_input->buffer[line_input->index] != '#')
- {
- clib_warning ("[%d] Unknown vppcom config option: '%s'",
- vcm->my_pid, (char *)
- &line_input->buffer[line_input->index]);
- }
- }