Exemple #1
0
 def buildMulticastGroup(self, mgid=None, ports=None):
     group = p4runtime_pb2.MulticastGroupEntry()
     group.multicast_group_id = mgid
     replicas = ReplicaMgr(group)
     for i, port in enumerate(ports):
         replicas.append(port, i)
     return group
 def buildMCEntry(self, mc_group_id, replicas=None):
     mc_group_entry = p4runtime_pb2.MulticastGroupEntry()
     mc_group_entry.multicast_group_id = mc_group_id
     if replicas:
         mc_group_entry.replicas.extend([
             self.get_replicas_pb(egress_port, instance)
             for egress_port, instance in replicas.iteritems()
         ])
     return mc_group_entry
Exemple #3
0
    def buildMulticastEntry(self, mcast_group_id, member_ports):
        multicast_entry = p4runtime_pb2.MulticastGroupEntry()

        multicast_entry.multicast_group_id = mcast_group_id

        for i in member_ports:
            replica = p4runtime_pb2.Replica()
            replica.egress_port = i
            replica.instance = 1
            multicast_entry.replicas.extend([replica])

        return multicast_entry
Exemple #4
0
    def buildMulticastEntry(self, mcast_group_id, member_ports):
        """
        See documentation at beginning of document.
        """
        multicast_entry = p4runtime_pb2.MulticastGroupEntry()

        multicast_entry.multicast_group_id = mcast_group_id

        for i in member_ports:
            replica = p4runtime_pb2.Replica()
            replica.egress_port = i
            replica.instance = 1
            multicast_entry.replicas.extend([replica])

        return multicast_entry