c - Programmatically enable/disable UNIX network interface -


there lot of similar questions posted, windows - want know how (if possible) can have c program (run root, on linux) disable network interface no longer receiving packets.

if can tell me functions need this, great, better if can link me example script or tutorial somewhere (exempli gratia) turns network interface off , on again.

for linux, doable mnl , knowledge of rtnl protocol:

http://git.netfilter.org/cgi-bin/gitweb.cgi?p=libmnl.git;a=blob;f=examples/rtnl/rtnl-link-set.c;hb=head

on unices or other operating systems, os-specific call and/or archaic ioctl call available, latter of cannot express linux multiple addresses per interface properly, serious programs not make use of on platform.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -