Add Bonds, Slaves, and Flows
This commit is contained in:
parent
de9cfbe9b0
commit
a50e8e9878
31 changed files with 4898 additions and 1966 deletions
|
@ -55,8 +55,6 @@ LinuxNetLink::LinuxNetLink()
|
|||
{
|
||||
// set socket timeout to 1 sec so we're not permablocking recv() calls
|
||||
_setSocketTimeout(_fd, 1);
|
||||
int yes=1;
|
||||
setsockopt(_fd,SOL_SOCKET,SO_REUSEADDR,(char*)&yes,sizeof(yes));
|
||||
|
||||
_la.nl_family = AF_NETLINK;
|
||||
_la.nl_pid = 0; //getpid()+1;
|
||||
|
@ -430,8 +428,6 @@ void LinuxNetLink::_linkDeleted(struct nlmsghdr *nlp)
|
|||
void LinuxNetLink::_requestIPv4Routes()
|
||||
{
|
||||
int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
|
||||
int yes=1;
|
||||
setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(char*)&yes,sizeof(yes));
|
||||
if (fd == -1) {
|
||||
fprintf(stderr, "Error opening RTNETLINK socket: %s\n", strerror(errno));
|
||||
return;
|
||||
|
@ -485,8 +481,6 @@ void LinuxNetLink::_requestIPv4Routes()
|
|||
void LinuxNetLink::_requestIPv6Routes()
|
||||
{
|
||||
int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
|
||||
int yes=1;
|
||||
setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(char*)&yes,sizeof(yes));
|
||||
if (fd == -1) {
|
||||
fprintf(stderr, "Error opening RTNETLINK socket: %s\n", strerror(errno));
|
||||
return;
|
||||
|
@ -540,8 +534,6 @@ void LinuxNetLink::_requestIPv6Routes()
|
|||
void LinuxNetLink::_requestInterfaceList()
|
||||
{
|
||||
int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
|
||||
int yes=1;
|
||||
setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(char*)&yes,sizeof(yes));
|
||||
if (fd == -1) {
|
||||
fprintf(stderr, "Error opening RTNETLINK socket: %s\n", strerror(errno));
|
||||
return;
|
||||
|
@ -595,8 +587,6 @@ void LinuxNetLink::addRoute(const InetAddress &target, const InetAddress &via, c
|
|||
if (!target) return;
|
||||
|
||||
int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
|
||||
int yes=1;
|
||||
setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(char*)&yes,sizeof(yes));
|
||||
if (fd == -1) {
|
||||
fprintf(stderr, "Error opening RTNETLINK socket: %s\n", strerror(errno));
|
||||
return;
|
||||
|
@ -713,8 +703,6 @@ void LinuxNetLink::delRoute(const InetAddress &target, const InetAddress &via, c
|
|||
if (!target) return;
|
||||
|
||||
int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
|
||||
int yes=1;
|
||||
setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(char*)&yes,sizeof(yes));
|
||||
if (fd == -1) {
|
||||
fprintf(stderr, "Error opening RTNETLINK socket: %s\n", strerror(errno));
|
||||
return;
|
||||
|
@ -828,8 +816,6 @@ void LinuxNetLink::delRoute(const InetAddress &target, const InetAddress &via, c
|
|||
void LinuxNetLink::addAddress(const InetAddress &addr, const char *iface)
|
||||
{
|
||||
int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
|
||||
int yes=1;
|
||||
setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(char*)&yes,sizeof(yes));
|
||||
if (fd == -1) {
|
||||
fprintf(stderr, "Error opening RTNETLINK socket: %s\n", strerror(errno));
|
||||
return;
|
||||
|
@ -948,8 +934,6 @@ void LinuxNetLink::addAddress(const InetAddress &addr, const char *iface)
|
|||
void LinuxNetLink::removeAddress(const InetAddress &addr, const char *iface)
|
||||
{
|
||||
int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
|
||||
int yes=1;
|
||||
setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(char*)&yes,sizeof(yes));
|
||||
if (fd == -1) {
|
||||
fprintf(stderr, "Error opening RTNETLINK socket: %s\n", strerror(errno));
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue