srv6-mobile: Update GTP4/6.D function

GTP4/6.D behavior is updated as shown below.
1. When receiving GTP-U message or IPv6 linklocal destination in inner IP, GTP packet is tnralated to SRv6.
2. When receiving T-PDU packet, OuterIP/UDP/GTP headers are stripped off and Inner IP is encapsulated into SRv6 based on L3VPN SRv6 manner.

Type: feature

Signed-off-by: Tetsuya Murakami <tetsuya.mrk@gmail.com>
Change-Id: I6092c98ea80236d54017f84c5b35cca0b645f034
Signed-off-by: Tetsuya Murakami <tetsuya.mrk@gmail.com>
diff --git a/test/test_srv6_mobile.py b/test/test_srv6_mobile.py
index a695c9d..e617ace 100644
--- a/test/test_srv6_mobile.py
+++ b/test/test_srv6_mobile.py
@@ -69,9 +69,10 @@
         pkts = self.create_packets([("A::1", "B::1"), ("C::1", "D::1")])
 
         self.vapi.cli(
-            "sr localsid address {} behavior end.m.gtp4.e v4src_position 64"
-            .format(pkts[0]['IPv6'].dst))
-        self.logger.info(self.vapi.cli("show sr localsids"))
+            "sr localsid address {} behavior end.m.gtp4.e "
+            .format(pkts[0]['IPv6'].dst) +
+            "v4src_position 64 fib-table 0")
+        self.logger.info(self.vapi.cli("show sr localsid"))
 
         self.vapi.cli("clear errors")
 
@@ -150,8 +151,8 @@
         self.vapi.cli("set sr encaps source addr A1::1")
         self.vapi.cli("sr policy add bsid D4:: next D2:: next D3::")
         self.vapi.cli(
-            "sr policy add bsid D5:: behavior t.m.gtp4.d"
-            "D4::/32 v6src_prefix C1::/64 nhtype ipv6")
+            "sr policy add bsid D5:: behavior t.m.gtp4.d D4::/32 " +
+            "v6src_prefix C1::/64 nhtype ipv6 fib-table 0 drop-in")
         self.vapi.cli("sr steer l3 {}/32 via bsid D5::".format(self.ip4_dst))
         self.vapi.cli("ip route add D2::/32 via {}".format(self.ip6_dst))
 
@@ -236,11 +237,11 @@
         pkts = self.create_packets([("A::1", "B::1"), ("C::1", "D::1")])
 
         self.vapi.cli(
-            "sr localsid prefix {}/64 behavior end.m.gtp6.e"
+            "sr localsid prefix {}/64 behavior end.m.gtp6.e fib-table 0"
             .format(pkts[0]['IPv6'].dst))
         self.vapi.cli(
             "ip route add a1::/64 via {}".format(self.ip6_nhop))
-        self.logger.info(self.vapi.cli("show sr localsids"))
+        self.logger.info(self.vapi.cli("show sr localsid"))
 
         self.vapi.cli("clear errors")
 
@@ -316,10 +317,12 @@
         self.vapi.cli("set sr encaps source addr A1::1")
         self.vapi.cli("sr policy add bsid D4:: next D2:: next D3::")
         self.vapi.cli(
-            "sr localsid prefix 2001::/64 behavior end.m.gtp6.d D4::/64")
+            "sr localsid prefix 2001::/64 behavior end.m.gtp6.d " +
+            "D4::/64 fib-table 0 drop-in")
         self.vapi.cli("ip route add D2::/64 via {}".format(self.ip6_nhop))
 
         self.logger.info(self.vapi.cli("show sr policies"))
+        self.logger.info(self.vapi.cli("show sr localsid"))
 
         self.vapi.cli("clear errors")
 
@@ -334,7 +337,11 @@
 
         for pkt in capture:
             self.logger.info(pkt.show2(dump=True))
-            self.logger.info("GTP6.D Address={}".format(
+            self.logger.info("GTP6.D SID0={}".format(
                 str(pkt[IPv6ExtHdrSegmentRouting].addresses[0])))
+            self.logger.info("GTP6.D SID1={}".format(
+                str(pkt[IPv6ExtHdrSegmentRouting].addresses[1])))
             self.assertEqual(
-                str(pkt[IPv6ExtHdrSegmentRouting].addresses[0]), "d4::c800:0")
+                str(pkt[IPv6ExtHdrSegmentRouting].addresses[0]), "2001::1")
+            self.assertEqual(
+                str(pkt[IPv6ExtHdrSegmentRouting].addresses[1]), "d4::c800:0")