mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
added some ideas for OPAL interface configuration
git-svn-id: https://zerberus.eonerc.rwth-aachen.de:8443/svn/s2ss/trunk@143 8ec27952-4edc-4aab-86aa-e87bb2611832
This commit is contained in:
parent
f6b061cb10
commit
975048d88e
1 changed files with 18 additions and 0 deletions
18
clients/opal/models/AsyncIP_sl/interface.c
Normal file
18
clients/opal/models/AsyncIP_sl/interface.c
Normal file
|
@ -0,0 +1,18 @@
|
|||
|
||||
|
||||
int if_setup(const char *op, const char *iface, const char *addr)
|
||||
{
|
||||
char cmd[256];
|
||||
|
||||
/* Setup remote address */
|
||||
snprintf(cmd, 256, "ip addr %s %s/32 dev %s", op, addr, iface);
|
||||
if (system(cmd))
|
||||
OpalPrint("Failed to add local address to interface");
|
||||
|
||||
/* Setup route for single IP address */
|
||||
snprintf(cmd, 256, "ip route %s %s/32 dev %s", op, addr, iface);
|
||||
if (system(cmd))
|
||||
OpalPrint("Failed to add route for remote address")
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Reference in a new issue