{"id":230,"date":"2015-02-24T12:36:50","date_gmt":"2015-02-24T12:36:50","guid":{"rendered":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=230"},"modified":"2015-03-27T08:50:34","modified_gmt":"2015-03-27T08:50:34","slug":"the-ovm_ipv6_t-type","status":"publish","type":"post","link":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=230","title":{"rendered":"The ovm_ipv6_t type"},"content":{"rendered":"<p>The <code>ovm_ipv6_t<\/code> type is the OrchIDS type of IPv6 addresses.<br \/>\n<!--more--><\/p>\n<p>It is defined this way in <tt>src\/lang.h<\/tt>:<\/p>\n<pre>typedef struct ovm_ipv6_s ovm_ipv6_t;\r\nstruct ovm_ipv6_s\r\n{\r\n  gc_header_t gc;\r\n  struct in6_addr ipv6addr;\r\n};<\/pre>\n<p>This is a type of <a title=\"Garbage collection\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=18\">garbage-collectable<\/a> data. To allocate a new object of type <code>ovm_ipv6_t<\/code>, use the function:<\/p>\n<pre>ovm_var_t *ovm_ipv6_new(gc_t *gc_ctx);<\/pre>\n<p>This creates a new uninitialized <code>ovm_ipv6_t<\/code> object<code><\/code>. Its return type is the universal type <a title=\"The ovm_var_t universal type\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?page_id=121\"><code>ovm_var_t<\/code><\/a> instead of <code>ovm_ipv6_t<\/code>, for practical reasons. Calling <code>res<\/code> the result, one always has <code>TYPE(res)==T_IPV6<\/code>.<\/p>\n<p>The result is created white, and much be <code>gc_touch()<\/code>ed before storing it into a garbage-collectable object.<\/p>\n<p>The returned <code>ovm_ipv6_t<\/code> object <code>res<\/code> is modifiable. One can read from or write from it by using the <code>IPV6()<\/code> macro, e.g.:<\/p>\n<pre>struct in6_addr addr;\r\nfor (i=0 ; i&lt;16 ; i++)\r\n  {\r\n    addr.s6_addr[i] = IPV6(res).s6_addr[i];\r\n    IPV6(res).s6_addr[i] = addr.s6_addr[i];\r\n  }\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The ovm_ipv6_t type is the OrchIDS type of IPv6 addresses.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-230","post","type-post","status-publish","format-standard","hentry","category-data-types","category-virtual-machine"],"_links":{"self":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/posts\/230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/types\/post"}],"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=230"}],"version-history":[{"count":2,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/posts\/230\/revisions"}],"predecessor-version":[{"id":235,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/posts\/230\/revisions\/235"}],"wp:attachment":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}