Type of communication

7 views
Skip to first unread message

Czarek Kowalski

unread,
Mar 18, 2020, 12:57:43 PM3/18/20
to pyroute2-dev
Hello,

could you tell me what type of communication (C interface or shell) pyroute2 uses?

Best regards
Czarek

Peter Saveliev

unread,
Mar 18, 2020, 1:24:40 PM3/18/20
to Czarek Kowalski, pyroute2-dev
Hello, Czarek!

It depends on the operating system and the functionality — it differs.
  • On Linux systems it uses AF_NETLINK sockets to communicate with the kernel. Some specific functionality is done via syscall() (netns) or ioctl() (tun/tap).
  • On BSD systems (very basic read-only support) it uses PF_ROUTE sockets to monitor the system and shell commands to retrieve network settings
  • On Windows systems (only proof of concept, not supported really) it uses WinAPI via FFI
Towards users it provides Python API and shell stdio (pyroute2-cli, only limited subset)

st 18. 3. 2020 v 17:57 odesílatel Czarek Kowalski <surr...@gmail.com> napsal:
--
You received this message because you are subscribed to the Google Groups "pyroute2-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyroute2-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyroute2-dev/fc9a62bc-ad0e-453d-847b-74316f09678b%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages