Skip to content

Commit

Permalink
update process_map.py
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Lungaroni <[email protected]>
  • Loading branch information
plungaroni committed May 3, 2023
1 parent 67d7718 commit 9058bd0
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions process_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,29 @@ def read(self):
if result == 0 :
for my_obj in pm.map_as_array :
print (my_obj)


###################

pm = ProcessMap('chaddr','routingpaolo','paolo_chaddr')
result = pm.read()
if result == 0 :
for my_obj in pm.map_as_array :
print (my_obj)

#experiment to add an entry to the map
ip6 = ipaddress.IPv6Address('2001:db8:555:666:777:888::')
cal.cal_map_update(pm.map_path, ht.u16(2), ip6)

pm = ProcessMap('usid_params','routingpaolo','paolo_adv_usid')
result = pm.read()
if result == 0 :
for my_obj in pm.map_as_array :
print (my_obj)

#experiment to update a key value pair
#print (pm.map_path)
cal.bpftool_map_update(pm.map_path, ["01", "00", "00", "00"], ["04", "00", "00", "00"], map_reference_type="pinned", value_type="hex")
cal.cal_map_update(pm.map_path, ht.u32(2), ht.u32(2))


0 comments on commit 9058bd0

Please sign in to comment.