Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iproute: route_dump() and route_load() functionality #1247

Merged
merged 5 commits into from
Jan 15, 2025
Merged

Conversation

svinota
Copy link
Owner

@svinota svinota commented Jan 14, 2025

A proof of concept of a binary stream dumper.

  • ipr.route_dump(fd, family=AF_UNSPEC) -- save routes to a file object; it can be an open file, BytesIO() or like that
  • ipr.route_dumps(family=AF_UNSPEC) -- return routes as a binary string

Bug-Url: #1203

@svinota svinota changed the title iproute: draft route_dump() & route_dumps() [WIP] iproute: draft route_dump() & route_dumps() Jan 14, 2025
@svinota svinota force-pushed the 1203-iproute-save branch 3 times, most recently from 6cb1f3d to 7f71887 Compare January 14, 2025 19:35
@svinota svinota marked this pull request as draft January 14, 2025 20:57
A proof of concept of a binary stream dumper.

* ipr.route_dump(fd, family=AF_UNSPEC) -- save routes to a
  file object; it can be an open file, BytesIO() or like that
* ipr.route_dumps(family=AF_UNSPEC) -- return routes as a binary
  string

Bug-Url: #1203
@svinota svinota changed the title [WIP] iproute: draft route_dump() & route_dumps() [WIP] iproute: route_dump() and route_load() functionality Jan 14, 2025
* ipr.route_load(fd, fmt='iproute2') -- load a dump from
  a file object; compatible with `iproute2 routes save` files
* ipr.route_load(data, fmt='iproute2') -- load a dump from
  a bytes object

Bug-Url: #1203
In some tools and in the fixtures, to be continued eventually
@svinota svinota marked this pull request as ready for review January 15, 2025 12:26
@svinota svinota changed the title [WIP] iproute: route_dump() and route_load() functionality iproute: route_dump() and route_load() functionality Jan 15, 2025
@svinota svinota merged commit 899fc58 into master Jan 15, 2025
23 checks passed
@svinota svinota deleted the 1203-iproute-save branch January 15, 2025 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant