Commit 22bb98ab authored by Georgios P. Katsikas's avatar Georgios P. Katsikas
Browse files

fix: service handlers' temporal configuration

parent 5c553a4f
Loading
Loading
Loading
Loading
+32 −21
Original line number Diff line number Diff line
@@ -342,13 +342,24 @@ class P4FabricACLServiceHandler(_ServiceHandler):
        acl = [
            {
                PORT_ID: 1,
                IPV4_SRC: "10.158.72.11",
                TRN_PORT_DST: 8080,
                ACTION: ACTION_DROP
            },
            {
                PORT_ID: 2,
                TRN_PORT_SRC: 12345,
                ACTION: ACTION_DROP
            },
            {
                PORT_ID: 2,
                IPV4_DST: "10.158.72.11",
                IPV4_PREFIX_LEN: 32,
                ACTION: ACTION_DROP
            },
            {
                PORT_ID: 1,
                TRN_PORT_DST: 8080,
                PORT_ID: 2,
                IPV4_SRC: "10.158.72.12",
                IPV4_PREFIX_LEN: 32,
                ACTION: ACTION_DROP
            }
        ]
@@ -364,24 +375,24 @@ class P4FabricACLServiceHandler(_ServiceHandler):
            SWITCH_INFO: switch_info
        }

        port_map = {
            "p4-sw1": {
                "port-1": {
                    PORT_ID: 1,
                    ACL: [
                        {
                            IPV4_SRC: "10.158.72.11",
                            IPV4_PREFIX_LEN: 32,
                            ACTION: ACTION_DROP
                        },
                        {
                            TRN_PORT_DST: 8080,
                            ACTION: ACTION_DROP
                        }
                    ]
                }
            }
        }
        # port_map = {
        #     "p4-sw1": {
        #         "port-1": {
        #             PORT_ID: 1,
        #             ACL: [
        #                 {
        #                     IPV4_SRC: "10.158.72.11",
        #                     IPV4_PREFIX_LEN: 32,
        #                     ACTION: ACTION_DROP
        #                 },
        #                 {
        #                     TRN_PORT_DST: 8080,
        #                     ACTION: ACTION_DROP
        #                 }
        #             ]
        #         }
        #     }
        # }

    def _parse_settings(self):
        #TODO: Pass settings in a correct way
+28 −28
Original line number Diff line number Diff line
@@ -358,34 +358,34 @@ class P4FabricL3ServiceHandler(_ServiceHandler):
            SWITCH_INFO: switch_info
        }

        port_map = {
            "p4-sw1": {
                "port-1": {
                    PORT_ID: 1,
                    PORT_TYPE: PORT_TYPE_HOST,
                    ROUTING_LIST: [
                        {
                            IPV4_DST: "10.158.72.11",
                            IPV4_PREFIX_LEN: 32,
                            MAC_SRC: "fa:16:3e:e2:af:28",
                            MAC_DST: "fa:16:3e:75:9c:e5"
                        }
                    ]
                },
                "port-2": {
                    PORT_ID: 2,
                    PORT_TYPE: PORT_TYPE_HOST,
                    ROUTING_LIST: [
                        {
                            IPV4_DST: "172.16.10.9",
                            IPV4_PREFIX_LEN: 32,
                            MAC_SRC: "fa:16:3e:75:9c:e5",
                            MAC_DST: "fa:16:3e:e2:af:28"
                        }
                    ]
                }
            }
        }
        # port_map = {
        #     "p4-sw1": {
        #         "port-1": {
        #             PORT_ID: 1,
        #             PORT_TYPE: PORT_TYPE_HOST,
        #             ROUTING_LIST: [
        #                 {
        #                     IPV4_DST: "10.158.72.11",
        #                     IPV4_PREFIX_LEN: 32,
        #                     MAC_SRC: "fa:16:3e:e2:af:28",
        #                     MAC_DST: "fa:16:3e:75:9c:e5"
        #                 }
        #             ]
        #         },
        #         "port-2": {
        #             PORT_ID: 2,
        #             PORT_TYPE: PORT_TYPE_HOST,
        #             ROUTING_LIST: [
        #                 {
        #                     IPV4_DST: "172.16.10.9",
        #                     IPV4_PREFIX_LEN: 32,
        #                     MAC_SRC: "fa:16:3e:75:9c:e5",
        #                     MAC_DST: "fa:16:3e:e2:af:28"
        #                 }
        #             ]
        #         }
        #     }
        # }

    def _parse_settings(self):
        #TODO: Pass settings in a correct way
+4 −4
Original line number Diff line number Diff line
@@ -35,19 +35,19 @@
                                                "action": "drop"
                                            },
                                            {
                                                "port_id": 1,
                                                "port_id": 2,
                                                "trn_port_src": 12345,
                                                "action": "drop"
                                            },
                                            {
                                                "port_id": 1,
                                                "ipv4_dst": "172.16.10.10",
                                                "port_id": 2,
                                                "ipv4_dst": "10.158.72.11",
                                                "ipv4_prefix_len": 32,
                                                "action": "drop"
                                            },
                                            {
                                                "port_id": 2,
                                                "ipv4_src": "172.16.10.10",
                                                "ipv4_src": "10.158.72.12",
                                                "ipv4_prefix_len": 32,
                                                "action": "drop"
                                            }
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ ENDPOINT_RULES = 3
INT_RULES = 19
L2_RULES = 10
L3_RULES = 4
ACL_RULES = 2
ACL_RULES = 1

DATAPLANE_RULES_NB_INT_B1 = 5
DATAPLANE_RULES_NB_INT_B2 = 6