vcl: move binary api and cfg to separate files
[vpp.git] / src / vcl / vcl_cfg.c
1 /*
2  * Copyright (c) 2018 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this
5  * You may obtain a copy of the License at:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 #include <vcl/vcl_private.h>
17
18 /* NOTE: _vppcom_main is only used until the heap is allocated.
19  *       Do not access it directly -- use vcm which will point to
20  *       the heap allocated copy after init.
21  */
22 static vppcom_main_t _vppcom_main = {
23   .debug = VPPCOM_DEBUG_INIT,
24   .my_client_index = ~0
25 };
26
27 vppcom_main_t *vcm = &_vppcom_main;
28
29 void
30 vppcom_cfg_init (vppcom_cfg_t * vcl_cfg)
31 {
32   char *env_var_str;
33
34   ASSERT (vcl_cfg);
35
36   vcl_cfg->heapsize = (256ULL << 20);
37   vcl_cfg->vpp_api_q_length = 1024;
38   vcl_cfg->segment_baseva = 0x200000000ULL;
39   vcl_cfg->segment_size = (256 << 20);
40   vcl_cfg->add_segment_size = (128 << 20);
41   vcl_cfg->preallocated_fifo_pairs = 8;
42   vcl_cfg->rx_fifo_size = (1 << 20);
43   vcl_cfg->tx_fifo_size = (1 << 20);
44   vcl_cfg->event_queue_size = 2048;
45   vcl_cfg->listen_queue_size = CLIB_CACHE_LINE_BYTES / sizeof (u32);
46   vcl_cfg->app_timeout = 10 * 60.0;
47   vcl_cfg->session_timeout = 10 * 60.0;
48   vcl_cfg->accept_timeout = 60.0;
49   vcl_cfg->event_ring_size = (128 << 10);
50   vcl_cfg->event_log_path = "/dev/shm";
51
52   env_var_str = getenv (VPPCOM_ENV_DEBUG);
53   if (env_var_str)
54     {
55       u32 tmp;
56       if (sscanf (env_var_str, "%u", &tmp) != 1)
57         clib_warning ("VCL<%d>: WARNING: Invalid debug level specified in the"
58                       " environment variable " VPPCOM_ENV_DEBUG " (%s)!\n",
59                       getpid (), env_var_str);
60       else
61         {
62           vcm->debug = tmp;
63           VDBG (0, "VCL<%d>: configured VCL debug level (%u) from "
64                 VPPCOM_ENV_DEBUG "!", getpid (), vcm->debug);
65         }
66     }
67 }
68
69 void
70 vppcom_cfg_heapsize (char *conf_fname)
71 {
72   vppcom_cfg_t *vcl_cfg = &vcm->cfg;
73   FILE *fp;
74   char inbuf[4096];
75   int argc = 1;
76   char **argv = NULL;
77   char *arg = NULL;
78   char *p;
79   int i;
80   u8 *sizep;
81   u32 size;
82   void *vcl_mem;
83   void *heap;
84
85   fp = fopen (conf_fname, "r");
86   if (fp == NULL)
87     {
88       VDBG (0, "VCL<%d>: using default heapsize %lld (0x%llx)", getpid (),
89             vcl_cfg->heapsize, vcl_cfg->heapsize);
90       goto defaulted;
91     }
92
93   argv = calloc (1, sizeof (char *));
94   if (argv == NULL)
95     {
96       VDBG (0, "VCL<%d>: calloc failed, using default heapsize %lld (0x%llx)",
97             getpid (), vcl_cfg->heapsize, vcl_cfg->heapsize);
98       goto defaulted;
99     }
100
101   while (1)
102     {
103       if (fgets (inbuf, 4096, fp) == 0)
104         break;
105       p = strtok (inbuf, " \t\n");
106       while (p != NULL)
107         {
108           if (*p == '#')
109             break;
110           argc++;
111           char **tmp = realloc (argv, argc * sizeof (char *));
112           if (tmp == NULL)
113             {
114               VDBG (0, "VCL<%d>: realloc failed, using default heapsize %lld "
115                     "(0x%llx)", getpid (), vcl_cfg->heapsize,
116                     vcl_cfg->heapsize);
117               goto defaulted;
118             }
119           argv = tmp;
120           arg = strndup (p, 1024);
121           if (arg == NULL)
122             {
123               VDBG (0, "VCL<%d>: strndup failed, using default heapsize %lld "
124                     "(0x%llx)", getpid (), vcl_cfg->heapsize,
125                     vcl_cfg->heapsize);
126               goto defaulted;
127             }
128           argv[argc - 1] = arg;
129           p = strtok (NULL, " \t\n");
130         }
131     }
132
133   fclose (fp);
134   fp = NULL;
135
136   char **tmp = realloc (argv, (argc + 1) * sizeof (char *));
137   if (tmp == NULL)
138     {
139       VDBG (0, "VCL<%d>: realloc failed, using default heapsize %lld "
140             "(0x%llx)", getpid (), vcl_cfg->heapsize, vcl_cfg->heapsize);
141       goto defaulted;
142     }
143   argv = tmp;
144   argv[argc] = NULL;
145
146   /*
147    * Look for and parse the "heapsize" config parameter.
148    * Manual since none of the clib infra has been bootstrapped yet.
149    *
150    * Format: heapsize <nn>[mM][gG]
151    */
152
153   for (i = 1; i < (argc - 1); i++)
154     {
155       if (!strncmp (argv[i], "heapsize", 8))
156         {
157           sizep = (u8 *) argv[i + 1];
158           size = 0;
159           while (*sizep >= '0' && *sizep <= '9')
160             {
161               size *= 10;
162               size += *sizep++ - '0';
163             }
164           if (size == 0)
165             {
166               VDBG (0, "VCL<%d>: parse error '%s %s', using default "
167                     "heapsize %lld (0x%llx)", getpid (), argv[i], argv[i + 1],
168                     vcl_cfg->heapsize, vcl_cfg->heapsize);
169               goto defaulted;
170             }
171
172           if (*sizep == 'g' || *sizep == 'G')
173             vcl_cfg->heapsize = size << 30;
174           else if (*sizep == 'm' || *sizep == 'M')
175             vcl_cfg->heapsize = size << 20;
176           else
177             {
178               VDBG (0, "VCL<%d>: parse error '%s %s', using default "
179                     "heapsize %lld (0x%llx)", getpid (), argv[i], argv[i + 1],
180                     vcl_cfg->heapsize, vcl_cfg->heapsize);
181               goto defaulted;
182             }
183         }
184     }
185
186 defaulted:
187   if (fp != NULL)
188     fclose (fp);
189   if (argv != NULL)
190     free (argv);
191
192   vcl_mem = mmap (0, vcl_cfg->heapsize, PROT_READ | PROT_WRITE,
193                   MAP_SHARED | MAP_ANONYMOUS, -1, 0);
194   if (vcl_mem == MAP_FAILED)
195     {
196       clib_unix_error ("VCL<%d>: ERROR: mmap(0, %lld == 0x%llx, "
197                        "PROT_READ | PROT_WRITE,MAP_SHARED | MAP_ANONYMOUS, "
198                        "-1, 0) failed!",
199                        getpid (), vcl_cfg->heapsize, vcl_cfg->heapsize);
200       ASSERT (vcl_mem != MAP_FAILED);
201       return;
202     }
203   heap = clib_mem_init (vcl_mem, vcl_cfg->heapsize);
204   if (!heap)
205     {
206       clib_warning ("VCL<%d>: ERROR: clib_mem_init() failed!", getpid ());
207       ASSERT (heap);
208       return;
209     }
210   vcl_mem = clib_mem_alloc (sizeof (_vppcom_main));
211   if (!vcl_mem)
212     {
213       clib_warning ("VCL<%d>: ERROR: clib_mem_alloc() failed!", getpid ());
214       ASSERT (vcl_mem);
215       return;
216     }
217
218   clib_memcpy (vcl_mem, &_vppcom_main, sizeof (_vppcom_main));
219   vcm = vcl_mem;
220
221   VDBG (0, "VCL<%d>: allocated VCL heap = %p, size %lld (0x%llx)", getpid (),
222         heap, vcl_cfg->heapsize, vcl_cfg->heapsize);
223 }
224
225 void
226 vppcom_cfg_read_file (char *conf_fname)
227 {
228   vppcom_cfg_t *vcl_cfg = &vcm->cfg;
229   int fd;
230   unformat_input_t _input, *input = &_input;
231   unformat_input_t _line_input, *line_input = &_line_input;
232   u8 vc_cfg_input = 0;
233   u8 *chroot_path;
234   struct stat s;
235   u32 uid, gid, q_len;
236
237   fd = open (conf_fname, O_RDONLY);
238   if (fd < 0)
239     {
240       VDBG (0, "VCL<%d>: using default configuration.", getpid (),
241             conf_fname);
242       goto file_done;
243     }
244
245   if (fstat (fd, &s) < 0)
246     {
247       VDBG (0, "VCL<%d>: failed to stat `%s', using default configuration",
248             getpid (), conf_fname);
249       goto file_done;
250     }
251
252   if (!(S_ISREG (s.st_mode) || S_ISLNK (s.st_mode)))
253     {
254       VDBG (0, "VCL<%d>: not a regular file `%s', using default "
255             "configuration", getpid (), conf_fname);
256       goto file_done;
257     }
258
259   unformat_init_clib_file (input, fd);
260
261   while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
262     {
263       (void) unformat_user (input, unformat_line_input, line_input);
264       unformat_skip_white_space (line_input);
265
266       if (unformat (line_input, "vcl {"))
267         {
268           vc_cfg_input = 1;
269           continue;
270         }
271
272       if (vc_cfg_input)
273         {
274           if (unformat (line_input, "heapsize %s", &chroot_path))
275             {
276               vec_terminate_c_string (chroot_path);
277               VDBG (0, "VCL<%d>: configured heapsize %s, actual heapsize %lld"
278                     " (0x%llx)", getpid (), chroot_path, vcl_cfg->heapsize,
279                     vcl_cfg->heapsize);
280               vec_free (chroot_path);
281             }
282           else if (unformat (line_input, "api-prefix %s", &chroot_path))
283             {
284               vec_terminate_c_string (chroot_path);
285               if (vcl_cfg->vpp_api_filename)
286                 vec_free (vcl_cfg->vpp_api_filename);
287               vcl_cfg->vpp_api_filename = format (0, "/%s-vpe-api%c",
288                                                   chroot_path, 0);
289               vl_set_memory_root_path ((char *) chroot_path);
290
291               VDBG (0, "VCL<%d>: configured api-prefix (%s) and api filename"
292                     " (%s)", getpid (), chroot_path,
293                     vcl_cfg->vpp_api_filename);
294               chroot_path = 0;  /* Don't vec_free() it! */
295             }
296           else if (unformat (line_input, "vpp-api-q-length %d", &q_len))
297             {
298               if (q_len < vcl_cfg->vpp_api_q_length)
299                 {
300                   clib_warning ("VCL<%d>: ERROR: configured vpp-api-q-length "
301                                 "(%u) is too small! Using default: %u ",
302                                 getpid (), q_len, vcl_cfg->vpp_api_q_length);
303                 }
304               else
305                 {
306                   vcl_cfg->vpp_api_q_length = q_len;
307
308                   VDBG (0, "VCL<%d>: configured vpp-api-q-length %u",
309                         getpid (), vcl_cfg->vpp_api_q_length);
310                 }
311             }
312           else if (unformat (line_input, "uid %d", &uid))
313             {
314               vl_set_memory_uid (uid);
315               VDBG (0, "VCL<%d>: configured uid %d", getpid (), uid);
316             }
317           else if (unformat (line_input, "gid %d", &gid))
318             {
319               vl_set_memory_gid (gid);
320               VDBG (0, "VCL<%d>: configured gid %d", getpid (), gid);
321             }
322           else if (unformat (line_input, "segment-baseva 0x%lx",
323                              &vcl_cfg->segment_baseva))
324             {
325               VDBG (0, "VCL<%d>: configured segment_baseva 0x%lx", getpid (),
326                     vcl_cfg->segment_baseva);
327             }
328           else if (unformat (line_input, "segment-size 0x%lx",
329                              &vcl_cfg->segment_size))
330             {
331               VDBG (0, "VCL<%d>: configured segment_size 0x%lx (%ld)",
332                     getpid (), vcl_cfg->segment_size, vcl_cfg->segment_size);
333             }
334           else if (unformat (line_input, "segment-size %ld",
335                              &vcl_cfg->segment_size))
336             {
337               VDBG (0, "VCL<%d>: configured segment_size %ld (0x%lx)",
338                     getpid (), vcl_cfg->segment_size, vcl_cfg->segment_size);
339             }
340           else if (unformat (line_input, "add-segment-size 0x%lx",
341                              &vcl_cfg->add_segment_size))
342             {
343               VDBG (0, "VCL<%d>: configured add_segment_size 0x%lx (%ld)",
344                     getpid (), vcl_cfg->add_segment_size,
345                     vcl_cfg->add_segment_size);
346             }
347           else if (unformat (line_input, "add-segment-size %ld",
348                              &vcl_cfg->add_segment_size))
349             {
350               VDBG (0, "VCL<%d>: configured add_segment_size %ld (0x%lx)",
351                     getpid (), vcl_cfg->add_segment_size,
352                     vcl_cfg->add_segment_size);
353             }
354           else if (unformat (line_input, "preallocated-fifo-pairs %d",
355                              &vcl_cfg->preallocated_fifo_pairs))
356             {
357               VDBG (0, "VCL<%d>: configured preallocated_fifo_pairs %d "
358                     "(0x%x)", getpid (), vcl_cfg->preallocated_fifo_pairs,
359                     vcl_cfg->preallocated_fifo_pairs);
360             }
361           else if (unformat (line_input, "rx-fifo-size 0x%lx",
362                              &vcl_cfg->rx_fifo_size))
363             {
364               VDBG (0, "VCL<%d>: configured rx_fifo_size 0x%lx (%ld)",
365                     getpid (), vcl_cfg->rx_fifo_size, vcl_cfg->rx_fifo_size);
366             }
367           else if (unformat (line_input, "rx-fifo-size %ld",
368                              &vcl_cfg->rx_fifo_size))
369             {
370               VDBG (0, "VCL<%d>: configured rx_fifo_size %ld (0x%lx)",
371                     getpid (), vcl_cfg->rx_fifo_size, vcl_cfg->rx_fifo_size);
372             }
373           else if (unformat (line_input, "tx-fifo-size 0x%lx",
374                              &vcl_cfg->tx_fifo_size))
375             {
376               VDBG (0, "VCL<%d>: configured tx_fifo_size 0x%lx (%ld)",
377                     getpid (), vcl_cfg->tx_fifo_size, vcl_cfg->tx_fifo_size);
378             }
379           else if (unformat (line_input, "tx-fifo-size %ld",
380                              &vcl_cfg->tx_fifo_size))
381             {
382               VDBG (0, "VCL<%d>: configured tx_fifo_size %ld (0x%lx)",
383                     getpid (), vcl_cfg->tx_fifo_size, vcl_cfg->tx_fifo_size);
384             }
385           else if (unformat (line_input, "event-queue-size 0x%lx",
386                              &vcl_cfg->event_queue_size))
387             {
388               VDBG (0, "VCL<%d>: configured event_queue_size 0x%lx (%ld)",
389                     getpid (), vcl_cfg->event_queue_size,
390                     vcl_cfg->event_queue_size);
391             }
392           else if (unformat (line_input, "event-queue-size %ld",
393                              &vcl_cfg->event_queue_size))
394             {
395               VDBG (0, "VCL<%d>: configured event_queue_size %ld (0x%lx)",
396                     getpid (), vcl_cfg->event_queue_size,
397                     vcl_cfg->event_queue_size);
398             }
399           else if (unformat (line_input, "listen-queue-size 0x%lx",
400                              &vcl_cfg->listen_queue_size))
401             {
402               VDBG (0, "VCL<%d>: configured listen_queue_size 0x%lx (%ld)",
403                     getpid (), vcl_cfg->listen_queue_size,
404                     vcl_cfg->listen_queue_size);
405             }
406           else if (unformat (line_input, "listen-queue-size %ld",
407                              &vcl_cfg->listen_queue_size))
408             {
409               VDBG (0, "VCL<%d>: configured listen_queue_size %ld (0x%lx)",
410                     getpid (), vcl_cfg->listen_queue_size,
411                     vcl_cfg->listen_queue_size);
412             }
413           else if (unformat (line_input, "app-timeout %f",
414                              &vcl_cfg->app_timeout))
415             {
416               VDBG (0, "VCL<%d>: configured app_timeout %f",
417                     getpid (), vcl_cfg->app_timeout);
418             }
419           else if (unformat (line_input, "session-timeout %f",
420                              &vcl_cfg->session_timeout))
421             {
422               VDBG (0, "VCL<%d>: configured session_timeout %f",
423                     getpid (), vcl_cfg->session_timeout);
424             }
425           else if (unformat (line_input, "accept-timeout %f",
426                              &vcl_cfg->accept_timeout))
427             {
428               VDBG (0, "VCL<%d>: configured accept_timeout %f",
429                     getpid (), vcl_cfg->accept_timeout);
430             }
431           else if (unformat (line_input, "app-proxy-transport-tcp"))
432             {
433               vcl_cfg->app_proxy_transport_tcp = 1;
434               VDBG (0, "VCL<%d>: configured app_proxy_transport_tcp (%d)",
435                     getpid (), vcl_cfg->app_proxy_transport_tcp);
436             }
437           else if (unformat (line_input, "app-proxy-transport-udp"))
438             {
439               vcl_cfg->app_proxy_transport_udp = 1;
440               VDBG (0, "VCL<%d>: configured app_proxy_transport_udp (%d)",
441                     getpid (), vcl_cfg->app_proxy_transport_udp);
442             }
443           else if (unformat (line_input, "app-scope-local"))
444             {
445               vcl_cfg->app_scope_local = 1;
446               VDBG (0, "VCL<%d>: configured app_scope_local (%d)",
447                     getpid (), vcl_cfg->app_scope_local);
448             }
449           else if (unformat (line_input, "app-scope-global"))
450             {
451               vcl_cfg->app_scope_global = 1;
452               VDBG (0, "VCL<%d>: configured app_scope_global (%d)",
453                     getpid (), vcl_cfg->app_scope_global);
454             }
455           else if (unformat (line_input, "namespace-secret %lu",
456                              &vcl_cfg->namespace_secret))
457             {
458               VDBG (0, "VCL<%d>: configured namespace_secret %lu (0x%lx)",
459                     getpid (), vcl_cfg->namespace_secret,
460                     vcl_cfg->namespace_secret);
461             }
462           else if (unformat (line_input, "namespace-id %v",
463                              &vcl_cfg->namespace_id))
464             {
465               u32 max_nsid_vec_len = vcl_max_nsid_len ();
466               u32 nsid_vec_len = vec_len (vcl_cfg->namespace_id);
467               if (nsid_vec_len > max_nsid_vec_len)
468                 {
469                   _vec_len (vcl_cfg->namespace_id) = max_nsid_vec_len;
470                   VDBG (0, "VCL<%d>: configured namespace_id is too long,"
471                         " truncated to %d characters!",
472                         getpid (), max_nsid_vec_len);
473                 }
474
475               VDBG (0, "VCL<%d>: configured namespace_id %v",
476                     getpid (), vcl_cfg->namespace_id);
477             }
478           else if (unformat (line_input, "}"))
479             {
480               vc_cfg_input = 0;
481               VDBG (0, "VCL<%d>: completed parsing vppcom config!",
482                     getpid ());
483               goto input_done;
484             }
485           else
486             {
487               if (line_input->buffer[line_input->index] != '#')
488                 {
489                   clib_warning ("VCL<%d>: Unknown vppcom config option: '%s'",
490                                 getpid (), (char *)
491                                 &line_input->buffer[line_input->index]);
492                 }
493             }
494         }
495     }
496
497 input_done:
498   unformat_free (input);
499
500 file_done:
501   if (fd >= 0)
502     close (fd);
503 }
504
505 void
506 vppcom_cfg (vppcom_cfg_t * vcl_cfg)
507 {
508   char *conf_fname, *env_var_str;
509
510   vppcom_cfg_init (vcl_cfg);
511   env_var_str = getenv (VPPCOM_ENV_DEBUG);
512   if (env_var_str)
513     {
514       u32 tmp;
515       if (sscanf (env_var_str, "%u", &tmp) != 1)
516         clib_warning ("VCL<%d>: WARNING: Invalid debug level specified "
517                       "in the environment variable " VPPCOM_ENV_DEBUG
518                       " (%s)!\n", getpid (), env_var_str);
519       else
520         {
521           vcm->debug = tmp;
522           VDBG (0, "VCL<%d>: configured VCL debug level (%u) from "
523                 VPPCOM_ENV_DEBUG "!", getpid (), vcm->debug);
524         }
525     }
526   conf_fname = getenv (VPPCOM_ENV_CONF);
527   if (!conf_fname)
528     conf_fname = VPPCOM_CONF_DEFAULT;
529   vppcom_cfg_heapsize (conf_fname);
530   vppcom_cfg_read_file (conf_fname);
531
532   env_var_str = getenv (VPPCOM_ENV_API_PREFIX);
533   if (env_var_str)
534     {
535       if (vcl_cfg->vpp_api_filename)
536         vec_free (vcl_cfg->vpp_api_filename);
537       vcl_cfg->vpp_api_filename = format (0, "/%s-vpe-api%c", env_var_str, 0);
538       vl_set_memory_root_path ((char *) env_var_str);
539
540       VDBG (0, "VCL<%d>: configured api prefix (%s) and filename (%s) "
541             "from " VPPCOM_ENV_API_PREFIX "!",
542             getpid (), env_var_str, vcl_cfg->vpp_api_filename);
543     }
544   env_var_str = getenv (VPPCOM_ENV_APP_NAMESPACE_ID);
545   if (env_var_str)
546     {
547       u32 ns_id_vec_len = strlen (env_var_str);
548
549       vec_reset_length (vcm->cfg.namespace_id);
550       vec_validate (vcm->cfg.namespace_id, ns_id_vec_len - 1);
551       clib_memcpy (vcm->cfg.namespace_id, env_var_str, ns_id_vec_len);
552
553       VDBG (0, "VCL<%d>: configured namespace_id (%v) from "
554             VPPCOM_ENV_APP_NAMESPACE_ID "!", getpid (),
555             vcm->cfg.namespace_id);
556     }
557   env_var_str = getenv (VPPCOM_ENV_APP_NAMESPACE_SECRET);
558   if (env_var_str)
559     {
560       u64 tmp;
561       if (sscanf (env_var_str, "%lu", &tmp) != 1)
562         clib_warning ("VCL<%d>: WARNING: Invalid namespace secret "
563                       "specified in the environment variable "
564                       VPPCOM_ENV_APP_NAMESPACE_SECRET
565                       " (%s)!\n", getpid (), env_var_str);
566       else
567         {
568           vcm->cfg.namespace_secret = tmp;
569           VDBG (0, "VCL<%d>: configured namespace secret (%lu) from "
570                 VPPCOM_ENV_APP_NAMESPACE_SECRET "!", getpid (),
571                 vcm->cfg.namespace_secret);
572         }
573     }
574   if (getenv (VPPCOM_ENV_APP_PROXY_TRANSPORT_TCP))
575     {
576       vcm->cfg.app_proxy_transport_tcp = 1;
577       VDBG (0, "VCL<%d>: configured app_proxy_transport_tcp (%u) from "
578             VPPCOM_ENV_APP_PROXY_TRANSPORT_TCP "!", getpid (),
579             vcm->cfg.app_proxy_transport_tcp);
580     }
581   if (getenv (VPPCOM_ENV_APP_PROXY_TRANSPORT_UDP))
582     {
583       vcm->cfg.app_proxy_transport_udp = 1;
584       VDBG (0, "VCL<%d>: configured app_proxy_transport_udp (%u) from "
585             VPPCOM_ENV_APP_PROXY_TRANSPORT_UDP "!", getpid (),
586             vcm->cfg.app_proxy_transport_udp);
587     }
588   if (getenv (VPPCOM_ENV_APP_SCOPE_LOCAL))
589     {
590       vcm->cfg.app_scope_local = 1;
591       VDBG (0, "VCL<%d>: configured app_scope_local (%u) from "
592             VPPCOM_ENV_APP_SCOPE_LOCAL "!", getpid (),
593             vcm->cfg.app_scope_local);
594     }
595   if (getenv (VPPCOM_ENV_APP_SCOPE_GLOBAL))
596     {
597       vcm->cfg.app_scope_global = 1;
598       VDBG (0, "VCL<%d>: configured app_scope_global (%u) from "
599             VPPCOM_ENV_APP_SCOPE_GLOBAL "!", getpid (),
600             vcm->cfg.app_scope_global);
601     }
602 }
603
604 /*
605  * fd.io coding-style-patch-verification: ON
606  *
607  * Local Variables:
608  * eval: (c-set-style "gnu")
609  * End:
610  */