<p>lynxis lazus has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/19418">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pcuif_proto: version 0xa: add support for NSVC IPv6 support<br><br>Introduce a remote_proto to define the given protocol.<br>IPPROTO is more universal than address_family and is defined by an RFC.<br>IPPROTO_IPIP is used for IPv4, IPPROTO_IPV6 for IPv6. 0 means unset or<br>unused entry.<br><br>The remote_ip is network byte order, the default encoding for in_addr and in6_addr.<br><br>Change-Id: I4067b1af041b2cdad60d6fb16c9caee98bc218dd<br>---<br>M include/osmo-bts/pcuif_proto.h<br>M src/common/pcu_sock.c<br>2 files changed, 11 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/19418/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h</span><br><span>index e977914..9e3b801 100644</span><br><span>--- a/include/osmo-bts/pcuif_proto.h</span><br><span>+++ b/include/osmo-bts/pcuif_proto.h</span><br><span>@@ -2,10 +2,11 @@</span><br><span> #define _PCUIF_PROTO_H</span><br><span> </span><br><span> #include <osmocom/gsm/l1sap.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <arpa/inet.h></span><br><span> </span><br><span> #define PCU_SOCK_DEFAULT    "/tmp/pcu_bts"</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-#define PCU_IF_VERSION              0x09</span><br><span style="color: hsl(120, 100%, 40%);">+#define PCU_IF_VERSION            0x0a</span><br><span> #define TXT_MAX_LEN     128</span><br><span> </span><br><span> /* msg_type */</span><br><span>@@ -155,7 +156,13 @@</span><br><span>     uint16_t        nsvci[2];</span><br><span>    uint16_t        local_port[2];</span><br><span>       uint16_t        remote_port[2];</span><br><span style="color: hsl(0, 100%, 40%);">- uint32_t        remote_ip[2];</span><br><span style="color: hsl(120, 100%, 40%);">+ /* use IP PROTOCOL instead of address_family, because address_family is</span><br><span style="color: hsl(120, 100%, 40%);">+        * OS dependent. IPIP => v4, IPV6 => v6, 0 => unused */</span><br><span style="color: hsl(120, 100%, 40%);">+      uint8_t         remote_proto[2];</span><br><span style="color: hsl(120, 100%, 40%);">+      union {</span><br><span style="color: hsl(120, 100%, 40%);">+               struct in_addr ipv4;</span><br><span style="color: hsl(120, 100%, 40%);">+          struct in6_addr ipv6;</span><br><span style="color: hsl(120, 100%, 40%);">+ } remote_ip[2];</span><br><span> } __attribute__ ((packed));</span><br><span> </span><br><span> struct gsm_pcu_if_act_req {</span><br><span>diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c</span><br><span>index 5fa0e19..a983d88 100644</span><br><span>--- a/src/common/pcu_sock.c</span><br><span>+++ b/src/common/pcu_sock.c</span><br><span>@@ -210,7 +210,8 @@</span><br><span>             info_ind->nsvci[i] = nsvc->nsvci;</span><br><span>              info_ind->local_port[i] = nsvc->local_port;</span><br><span>            info_ind->remote_port[i] = nsvc->remote_port;</span><br><span style="color: hsl(0, 100%, 40%);">-             info_ind->remote_ip[i] = nsvc->remote_ip;</span><br><span style="color: hsl(120, 100%, 40%);">+               info_ind->remote_ip[i].ipv4.s_addr = htonl(nsvc->remote_ip);</span><br><span style="color: hsl(120, 100%, 40%);">+            info_ind->remote_proto[i] = IPPROTO_IPIP;</span><br><span>         }</span><br><span> </span><br><span>        for (i = 0; i < 8; i++) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/19418">change 19418</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-bts/+/19418"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bts </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I4067b1af041b2cdad60d6fb16c9caee98bc218dd </div>
<div style="display:none"> Gerrit-Change-Number: 19418 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: lynxis lazus <lynxis@fe80.eu> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>