# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: onos/stratum/p4_role_config.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import List

import betterproto


@dataclass(eq=False, repr=False)
class P4RoleConfig(betterproto.Message):
    """
    The P4RoleConfig message conists of these fields:  exclusive_p4_ids - A
    list of P4 entities for which this role exclusivly may      issue Write
    updates. Those entities are also filtered out of Read      responses.
    shared_p4_ids - A list of P4 entities for which this role may issue Write
    updates. Access to those entities is shared with other roles. Those
    entities are also filtered out of Read responses.  packet_in_filter - A
    single PacketFilter that is applied to incoming packets      to determine
    whether this role should receive them. An empty list      results in no
    filtering. This is a positive filter, a packet must      contain the exact
    specified value to be forwarded.  receives_packet_ins - A toggle to set if
    this role should receive PacketIns.  can_push_pipeline - Determines if this
    role is allowed to push a pipeline.
    """

    exclusive_p4_ids: List[int] = betterproto.uint32_field(1)
    shared_p4_ids: List[int] = betterproto.uint32_field(2)
    packet_in_filter: "P4RoleConfigPacketFilter" = betterproto.message_field(3)
    receives_packet_ins: bool = betterproto.bool_field(4)
    can_push_pipeline: bool = betterproto.bool_field(5)

    def __post_init__(self) -> None:
        super().__post_init__()


@dataclass(eq=False, repr=False)
class P4RoleConfigPacketFilter(betterproto.Message):
    metadata_id: int = betterproto.uint32_field(1)
    value: bytes = betterproto.bytes_field(2)

    def __post_init__(self) -> None:
        super().__post_init__()
