Add support to install clone sessions

This commit is contained in:
Daniele Moro
2020-09-15 13:07:07 +02:00
committed by Antonin Bas
parent d964079ef8
commit 4914893445
3 changed files with 37 additions and 3 deletions

View File

@@ -133,13 +133,13 @@ class SwitchConnection(object):
yield response
def WriteMulticastGroupEntry(self, mc_entry, dry_run=False):
def WritePREEntry(self, pre_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)
update.entity.packet_replication_engine_entry.CopyFrom(pre_entry)
if dry_run:
print "P4Runtime Write:", request
else: