<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace;font-size:large"><table style="width:1466.4px;border:1px solid rgb(226,226,226);border-collapse:collapse;background-color:rgb(250,250,250);color:rgb(54,0,12);font-family:verdana,sans-serif;font-size:10.8px;table-layout:auto"><tbody style="font-family:consolas,menlo,"liberation mono",courier,monospace;font-size:12px"><tr><td style="padding:0px 0px 0px 4px"></td></tr><tr><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">METHOD(child_sa_t, get_usestats, <span style="color:rgb(0,136,136);font-weight:bold">void</span>,
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L676" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">676</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">    private_child_sa_t *this, <span style="color:rgb(0,170,136);font-weight:bold">bool</span> inbound,
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L677" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">677</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">    time_t *time, uint64_t *bytes, uint64_t *packets)
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L678" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">678</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">{
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L679" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">679</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">    <span style="color:rgb(0,136,0);font-weight:bold">if</span> ((!bytes && !packets) || update_usebytes(this, inbound) != FAILED)
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L680" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">680</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">    {
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L681" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">681</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">        <span style="color:rgb(119,119,119)">/* there was traffic since last update or the kernel interface</span>
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L682" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">682</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px"><span style="color:rgb(119,119,119)">         * does not support querying the number of usebytes.</span>
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L683" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">683</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px"><span style="color:rgb(119,119,119)">         */</span>
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L684" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">684</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">        <span style="color:rgb(0,136,0);font-weight:bold">if</span> (time)
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L685" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">685</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">        {
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L686" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">686</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">            <span style="color:rgb(0,136,0);font-weight:bold">if</span> (!update_usetime(this, inbound) && !bytes && !packets)
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L687" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">687</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">            {
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L688" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">688</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">                <span style="color:rgb(119,119,119)">/* if policy query did not yield a usetime, query SAs instead */</span>
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L689" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">689</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">                update_usebytes(this, inbound);
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L690" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">690</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">            }
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L691" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">691</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">        }
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L692" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">692</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">    }
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L693" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">693</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">    <span style="color:rgb(0,136,0);font-weight:bold">if</span> (time)
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L694" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">694</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">    {
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L695" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">695</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">        *time = inbound ? this->my_usetime : this->other_usetime;
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L696" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">696</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">    }
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L697" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">697</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">    <span style="color:rgb(0,136,0);font-weight:bold">if</span> (bytes)
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L698" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">698</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">    {
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L699" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">699</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">        *bytes = inbound ? this->my_usebytes : this->other_usebytes;
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L700" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">700</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">    }
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L701" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">701</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">    <span style="color:rgb(0,136,0);font-weight:bold">if</span> (packets)
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L702" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">702</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">    {
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L703" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">703</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">        *packets = inbound ? this->my_usepackets : this->other_usepackets;
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L704" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">704</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">    }
</pre></td></tr><tr><th style="border:1px solid rgb(226,226,226);background-color:rgb(238,238,238);text-align:right;width:26.6px;padding:0px 3px 0px 0px;color:rgb(153,153,153);font-weight:normal"><a href="https://wiki.strongswan.org/projects/strongswan/repository/revisions/master/entry/src/libcharon/sa/child_sa.c#L705" target="_blank" style="color:rgb(138,0,32);text-decoration-line:none;font-weight:bold">705</a></th><td style="padding:0px 0px 0px 4px"><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px">}</pre><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px"><br></pre><pre style="white-space:pre-wrap;font-family:consolas,menlo,"liberation mono",courier,monospace;margin-top:0px;margin-bottom:0px"><br></pre></td></tr></tbody></table><br class="gmail-Apple-interchange-newline"></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:large">The above get_usestats funtion above gets called with packets, bytes as NULL. In that case is it intended that we first do update_usetime { which sends policy query to kernel } , if that fails do update_usebytes { which send sa query to kernel } ?</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:large">2) why is the order policy first if fail query sa important ? why not just query sa ?</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:large"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:large">Thanks,</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:large">Regards</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:large">Venu</div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 18 Jan 2019 at 16:53, Tobias Brunner <<a href="mailto:tobias@strongswan.org">tobias@strongswan.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Venu,<br>
<br>
Sorry, I don't understand what you are asking.  Please try to clarify<br>
what confuses you or doesn't meet your expectations.<br>
<br>
Regards,<br>
Tobias<br>
<br>
</blockquote></div></div>