{"id":121,"date":"2014-07-04T12:04:20","date_gmt":"2014-07-04T12:04:20","guid":{"rendered":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?page_id=121"},"modified":"2015-02-24T12:38:46","modified_gmt":"2015-02-24T12:38:46","slug":"the-ovm_var_t-universal-type-2","status":"publish","type":"page","link":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?page_id=121","title":{"rendered":"The ovm_var_t universal type"},"content":{"rendered":"<p>The OrchIDS virtual machine only handles one data type, <code>ovm_var_t<\/code>.<\/p>\n<p>This is defined in <tt>src\/lang.h<\/tt>:<\/p>\n<pre>typedef struct ovm_var_s ovm_var_t;\r\nstruct ovm_var_s\r\n{\r\n  gc_header_t gc;\r\n  uint8_t  data[STR_PAD_LEN];\r\n};<\/pre>\n<p>The <code>data<\/code> array is just a stub. There is no <code>ovm_var_t<\/code> object per se in OrchIDS. All of them are of one of the standard data types, such as <code>ovm_int_t<\/code>. The list of standard data types used by the OrchIDS virtual machine is:<\/p>\n<ul>\n<li><a title=\"The ovm_int_t type\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=21\"><code>ovm_int_t<\/code><\/a> (machine integers)<\/li>\n<li><a title=\"The ovm_uint_t type\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=33\"><code>ovm_uint_t<\/code><\/a> (unsigned machine integers)<\/li>\n<li><a title=\"The ovm_float_t type\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=106\"><code>ovm_float_t<\/code><\/a> (floating-point numbers)<\/li>\n<li><a title=\"The ovm_bstr_t type\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=38\"><code>ovm_bstr_t<\/code><\/a> (binary strings)<\/li>\n<li><a title=\"The ovm_vbstr_t type\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=43\"><code>ovm_vbstr_t<\/code><\/a> (virtual binary strings)<\/li>\n<li><a title=\"The ovm_str_t type\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=50\"><code>ovm_str_t<\/code><\/a> (character strings)<\/li>\n<li><a title=\"The ovm_vstr_t type\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=53\"><code>ovm_vstr_t<\/code><\/a> (virtual character strings)<\/li>\n<li><a title=\"The ovm_ctime_t type\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=58\"><code>ovm_ctime_t<\/code><\/a> (times)<\/li>\n<li><a title=\"The ovm_timeval_t type\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=93\"><code>ovm_timeval_t<\/code><\/a> (durations and times)<\/li>\n<li><a title=\"The ovm_ipv4_t type\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=89\"><code>ovm_ipv4_t<\/code><\/a> (IPv4 addresses)<\/li>\n<li><a title=\"The ovm_ipv6_t type\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=230\"><code>ovm_ipv6_t<\/code><\/a> (IPv6 addresses)<\/li>\n<li><a title=\"The ovm_regex_t type\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=99\"><code>ovm_regex_t<\/code><\/a> (regular expression matchers)<\/li>\n<li><a title=\"The ovm_snmpoid_t type\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=140\"><code>ovm_snmpoid_t<\/code><\/a> (SNMP object identifiers)<\/li>\n<li><a title=\"The ovm_extern_t type\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=143\"><code>ovm_extern_t<\/code><\/a> (foreign data)<\/li>\n<\/ul>\n<p>One point to be careful about is the following. An object of type <code>ovm_var_t *<\/code>, handled by OrchIDS, can be a pointer to an object of one of the above types, <strong>or<\/strong> the value <code>NULL<\/code>. 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 <code>ovm_var_t *<\/code>, one should first check whether it is <code>NULL<\/code> before accessing it.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-121","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/pages\/121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=121"}],"version-history":[{"count":6,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/pages\/121\/revisions"}],"predecessor-version":[{"id":233,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/pages\/121\/revisions\/233"}],"wp:attachment":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}