Add support to install multicast rules (#289)
This commit is contained in:
@@ -133,6 +133,18 @@ class SwitchConnection(object):
|
||||
yield response
|
||||
|
||||
|
||||
def WriteMulticastGroupEntry(self, mc_entry, dry_run=False):
|
||||
request = p4runtime_pb2.WriteRequest()
|
||||
request.device_id = self.device_id
|
||||
request.election_id.low = 1
|
||||
update = request.updates.add()
|
||||
update.type = p4runtime_pb2.Update.INSERT
|
||||
update.entity.packet_replication_engine_entry.CopyFrom(mc_entry)
|
||||
if dry_run:
|
||||
print "P4Runtime Write:", request
|
||||
else:
|
||||
self.client_stub.Write(request)
|
||||
|
||||
class GrpcRequestLogger(grpc.UnaryUnaryClientInterceptor,
|
||||
grpc.UnaryStreamClientInterceptor):
|
||||
"""Implementation of a gRPC interceptor that logs request to a file"""
|
||||
|
||||
Reference in New Issue
Block a user