thombashi / tcconfig

A tc command wrapper. Make it easy to set up traffic control of network bandwidth/latency/packet-loss/packet-corruption/etc. to a network-interface/Docker-container(veth).
https://tcconfig.rtfd.io/
MIT License
790 stars 84 forks source link

tcconfig from python #140

Closed V4Vendetta97 closed 4 years ago

V4Vendetta97 commented 4 years ago

hey! is there any documentation now about using tcset directly from python code?

V4Vendetta97 commented 4 years ago

i find it difficult to understand the source code

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

thombashi commented 4 years ago

Unfortunately, there is no documentation for that usage

V4Vendetta97 commented 4 years ago

Unfortunately, there is no documentation for that usage

I need just one simple example please, how can i transform this line to python code please.

tcset enp0s3 --dst-network 192.168.0.0 --rate 2400kbps

If i have just one example then i will be able to undertand how the whole thing works

thombashi commented 4 years ago

How about executing the command from your python code by subprocess call That would be much more easier.

V4Vendetta97 commented 4 years ago

Thank your for your reply.. I am already using it as subprocess calls and it works very well. But for some reasons, i must use it from my python code and i must not use subprocess call. I really hope you can help me.

thombashi commented 4 years ago

But for some reasons, i must use it from my python code and i must not use subprocess call.

Why and for what reasons?

tcconfig does not support as library usage for now and not recommended for such use cases. The internal interface will change from time to time and that will corrupt backward compatibility of your code.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.