ChrisDiRulli
ChrisDiRulli

Reputation: 1512

A C daemon that does traffic shaping

I'm working on a C daemon that monitors a configuration file (updated using a web interface) and then uses the Linux "tc" (traffic control) command to update the systems traffic shaping configuration.

What's a good way to actually invoke the tc program? Should I use the exec family? Is there a library I can use that would be a bit more elegant? Using exec or system just seems a bit hacky to me.

Any ideas?

Upvotes: 2

Views: 859

Answers (2)

hiena
hiena

Reputation: 955

Look at popen http://linux.die.net/man/3/popen

Upvotes: 1

lothar
lothar

Reputation: 20209

Why don't you look at the source code of the tc program and figure out how to modify the systems traffic shaping configuration directly from your deamon? That would save you calling tc and parsing it's output.

Upvotes: 1

Related Questions