The OrchIDS virtual machine only handles one data type, ovm_var_t
.
This is defined in src/lang.h:
typedef struct ovm_var_s ovm_var_t; struct ovm_var_s { gc_header_t gc; uint8_t data[STR_PAD_LEN]; };
The data
array is just a stub. There is no ovm_var_t
object per se in OrchIDS. All of them are of one of the standard data types, such as ovm_int_t
. The list of standard data types used by the OrchIDS virtual machine is:
ovm_int_t
(machine integers)ovm_uint_t
(unsigned machine integers)ovm_float_t
(floating-point numbers)ovm_bstr_t
(binary strings)ovm_vbstr_t
(virtual binary strings)ovm_str_t
(character strings)ovm_vstr_t
(virtual character strings)ovm_ctime_t
(times)ovm_timeval_t
(durations and times)ovm_ipv4_t
(IPv4 addresses)ovm_ipv6_t
(IPv6 addresses)ovm_regex_t
(regular expression matchers)ovm_snmpoid_t
(SNMP object identifiers)ovm_extern_t
(foreign data)
One point to be careful about is the following. An object of type ovm_var_t *
, handled by OrchIDS, can be a pointer to an object of one of the above types, or the value NULL
. The latter is usually indicative of a run-time error. One implication of this is that, when writing a function that works on objects of type ovm_var_t *
, one should first check whether it is NULL
before accessing it.