VOL-788: Fix size of max-frame-size attribute
Added option flag and constraints to the bridge_ip_ind attribute

Change-Id: I8a01cba88a5efbe3bc7d581f91c47e9f12d16eec
diff --git a/tests/utests/voltha/extensions/omci/test_me_frame.py b/tests/utests/voltha/extensions/omci/test_me_frame.py
index e188048..c616de1 100644
--- a/tests/utests/voltha/extensions/omci/test_me_frame.py
+++ b/tests/utests/voltha/extensions/omci/test_me_frame.py
@@ -267,6 +267,19 @@
 
         self.assertGeneratedFrameEquals(frame, ref)
 
+    def test_set_pptp_ethernet_uni_frame(self):
+        ref = '0000480A000B020109000005EE000000' \
+              '00000000000000000000000000000000' \
+              '000000000000000000000028'
+        data = dict(
+            administrative_state=0,  # 0 - Unlock
+            max_frame_size=1518      # two-octet field
+        )
+        frame = PptpEthernetUniFrame(0x201,
+                                     attributes=data).set()
+
+        self.assertGeneratedFrameEquals(frame, ref)
+
     def test_constraint_errors(self):
         self.assertTrue(True)  # TODO Also test some attribute constraint failures
 
diff --git a/voltha/extensions/omci/omci_entities.py b/voltha/extensions/omci/omci_entities.py
index 65e5359..a7cec7d 100644
--- a/voltha/extensions/omci/omci_entities.py
+++ b/voltha/extensions/omci/omci_entities.py
@@ -319,11 +319,12 @@
             range_check=lambda x: 0 <= x <= 1, optional=True, avc=True),
         ECA(ByteField("config_ind", 0), {AA.R},
             range_check=lambda x: x in [0, 1, 2, 3, 4, 0x11, 0x12, 0x13]),
-        ECA(ByteField("max_frame_size", 1518), {AA.R, AA.W}, optional=True),
+        ECA(ShortField("max_frame_size", 1518), {AA.R, AA.W}, optional=True),
         ECA(ByteField("dte_dce_ind", 0), {AA.R, AA.W},
             range_check=lambda x: 0 <= x <= 2),
         ECA(ShortField("pause_time", 0), {AA.R, AA.W}, optional=True),
-        ECA(ByteField("bridged_ip_ind", 2), {AA.R, AA.W}),
+        ECA(ByteField("bridged_ip_ind", 2), {AA.R, AA.W},
+            optional=True, range_check=lambda x: 0 <= x <= 2),
         ECA(ByteField("arc", 0), {AA.R, AA.W}, optional=True,
             range_check=lambda x: 0 <= x <= 1, avc=True),
         ECA(ByteField("arc_interval", 0), {AA.R, AA.W}, optional=True),