ac6928b429224eef19416dfcca0c14fca89feb08
[ric-plt/lib/rmr.git] / doc / src / library / config.im
1 .if false
2 ==================================================================================
3         Copyright (c) 2019 Nokia
4         Copyright (c) 2018-2019 AT&T Intellectual Property.
5
6    Licensed under the Apache License, Version 2.0 (the "License");
7    you may not use this file except in compliance with the License.
8    You may obtain a copy of the License at
9
10        http://www.apache.org/licenses/LICENSE-2.0
11
12    Unless required by applicable law or agreed to in writing, software
13    distributed under the License is distributed on an "AS IS" BASIS,
14    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15    See the License for the specific language governing permissions and
16    limitations under the License.
17 ==================================================================================
18 .fi
19
20 .if false
21         Mnemonic:       config.im
22         Abstract:       Major section discussing for configuration.
23         Date:           2 August 2019
24         Author:         E. Scott Daniels
25 .fi
26
27 &h1(Configuration and Control)
28 With the assumption that most RMR based applications will be executed
29 in a containerised environment, there are some underlying mechanics
30 which the developer may need to know in order to properly provide a
31 configuration specification to the container management system.  The
32 following paragraphs briefly discuss these.
33
34 .sp .1
35 &h2(TCP Ports)
36 RMR requires two (2) TCP listen ports: one for general
37 application-to-application communications and one for route-table
38 updates.  The general communication port is specified by the
39 application at the time RMR is initialised.  The port used to listen
40 for route table updates is likely to be a constant port shared by all
41 applications provided they are running in separate containers.  To
42 that end, the port number defaults to 4561, but can be configured with
43 an environment variable (see later paragraph in this section).
44
45
46 &h2(Host Names)
47 RMR is typically host name agnostic.  Route table entries may contain
48 endpoints defined either by host name or IP address.  In the container
49 world the concept of a &ital(service name) might exist, and likely is
50 different than a host name.  RMR's only requirement with respect to
51 host names is that a name used on a route table entry must be
52 resolvable via the &cw(gethostbyname) system call.
53
54
55 &h2(Environment Variables)
56 Several environment variables are recognised by RMR which, in general,
57 are used to define interfaces and listen ports (e.g. the route table
58 update listen port), or debugging information.  Generally this
59 information is system controlled and thus RMR expects this information
60 to be defined in the environment rather than provided by the
61 application.  The following is a list of the environment variables
62 which RMR recognises:
63
64 &half_space
65 &indent
66 &beg_dlist( 1.25i &ditext )
67         &ditem(RMR_BIND_IF)     The interface to bind to listen ports to. If not defined 0.0.0.0 (all interfaces) is assumed.
68
69         &ditem(RMR_RTG_SVC)     The port RMR will listen on for route manager connections. If not defined 4561 is used.
70
71         &ditem(RMR_SEED_RT)     Where RMR expects to find the name of the seed (static) route table. If not defined no static table is read.
72
73         &ditem(RMR_RTG_ISRAW)   If the value set to 0, RMR expects the route table manager messages to be messages with and RMR header.
74                                                 If this is not defined messages are assumed to be "raw" (without an RMR header.
75
76         &ditem(RMR_VCTL_FILE)   Provides a file which is used to set the verbose level of the route table collection thread.
77                                                 The first line of the file is read and expected to contain an integer value to set the verbose level.
78                                                 The value may be changed at any time and the route table thread will adjust accordingly.
79
80         &ditem(RMR_SRC_NAMEONLY) If the value of this variable is greater than 0, RMR will not permit the IP address to be
81                                                 sent as the message source. Only the host name will be sent as the source in the message header.
82 &end_dlist
83 &uindent
84 .st &textsize
85 &space
86
87 &h2(Logging)
88 RMR does &bold(not) use any logging libraries; any error or warning messages are written to standard error.
89 .if false
90  &note .sm .
91 .cn l=&cn_line_len i=0 start &atbot Times-roman 8p .7i
92         This is standard practice for container based applications as it makes error output easily available to operations.
93 .cn end
94 .fi
95 RMR messages are written with one of three prefix strings:
96
97
98 &half_space
99 &indent
100 &beg_dlist( .6i &ditext )
101         &ditem(^[CRI]) The event is of a critical nature and it is unlikely that RMR will continue to operate correctly if at all.
102                                 It is almost certain that immediate action will be needed to resolve the issue.
103
104         &ditem(^[ERR]) The event is not expected and RMR is not able to handle it.  There is a small chance that continued operation
105                                 will be negatively impacted.
106                                 Eventual action to diagnose and correct the issue will be necessary.
107
108         &ditem(^[WRN]) The event was not expected by RMR, but can be worked round. Normal operation will continue, but it is recommended
109                                 that the cause of the problem be investigated.
110 &end_dlist
111 &space
112 &uindent