What's the rtnetlink behavior if adding or removing ethernet?


 
Thread Tools Search this Thread
Special Forums IP Networking What's the rtnetlink behavior if adding or removing ethernet?
# 1  
Old 03-12-2017
What's the rtnetlink behavior if adding or removing ethernet?

Hello All,

While I am studying on RTNETLINK, I understand that the kernel will send RTM_ADDLINK or RTM_DELLINK if interface is added/removed at kernel space. However, I have a question regarding to the RTNETLINK message if adding or removing ethernet to/from bridge? Since adding or removing ethernet to / from bridge is not actually adding or removing interface, is there any RTNETLINK message actually transferring in between?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Fixed with file- removing leading zeros and adding the space

Hi All, i have a fixed width file , where each line is 3200 length. File: 1ABC 1111 2222 3333 000012341 1001 2ABC 1111 2222 3333 000012342 1002 3ABC 1111 2222 3333 000112343 1003 1DEF 5555 4444 9696 000012344 1004 2DEF 5555 2323 8686 000012345 1005 3DEF 5555 1212 7676 000012346 1006 ... (1 Reply)
Discussion started by: mechvijays
1 Replies

2. Shell Programming and Scripting

Adding and removing blocks of text from file

Hello all, short story: I'm writing a script to add and remove dns records in dns files. Its on a RHEL 5.5 So far i've locked up the basic operations in a couple of functions: - validate the parameters - search for existant ip in file when adding - search for existant name records in... (6 Replies)
Discussion started by: maverick72
6 Replies

3. Shell Programming and Scripting

sed adding/removing comment in crontab

I have a requirement where I want to add a comment '#' in my crontab, run a process, than remove the '#' I added. Example cron #5,10 * * * * ls -lt /tmp 10,5 * * * * ls -lt /var I would like to be able use sed or awk to add a '#' at the begining of each line. After the command... (4 Replies)
Discussion started by: BeefStu
4 Replies

4. Shell Programming and Scripting

bash hell , removing " and adding from a strings

I'm writing a bash script and i'm stuck the out put of a dialog menu is echo $select "foo" "bar" "lemon" cheese" while I need $foo $bar $lemon $cheese to reuse them as strings later in the script and very new to bash scripting and i've no idea how to do this any help would be... (2 Replies)
Discussion started by: xpd259
2 Replies

5. Shell Programming and Scripting

Adding Leading Zero with Right Justified and Removing Duplicates

hello everyone. I'm hoping someone can help me out here. I have 2 files. It looks like this: File 1: abc1, defg, 50.00, mno,990 abc2, cats, 100.00, pops,991 abc3, dogs, 1.00, treat,992 File 2: 990, airplanes, runway, doctor 991, jets, birds, much 990,... (13 Replies)
Discussion started by: crazyhpux
13 Replies

6. UNIX for Dummies Questions & Answers

User Name and Password List/adding and removing users.

Hello everyone and let me start off by thanking anyone who can help with this. I work for a company that uses Unix as one of their servers. I'm not at all familar with Unix beyond logging after I restart the server:rolleyes: I'm looking for some command that will bring me up a list of current... (3 Replies)
Discussion started by: disgracedsaint
3 Replies

7. Solaris

Adding and removing ZFS filesystems in Zones

I have a Solaris 10 container that is running on ZFS filesystems being presented from the Global Zone. I have a filesystem presented to the Local zone and my user wants me to remove it. It there any way I can remove this while the zone is running? I tried unmounting it from the local zone... (0 Replies)
Discussion started by: BG_JrAdmin
0 Replies

8. Programming

reg adding Users into at.allow and removing from at.allow

Hi , Thanks for your time . I am working on a application , which adds unix user through useradd and deletes user through userdel . both are admin commands . My requirement is i have to add a user into at.allow whenver a unix user is added through my application and the user should be... (4 Replies)
Discussion started by: naren_chella
4 Replies

9. Programming

Removing empty spaces and adding commas

I have a file which contains numbers as follows: 1234 9876 6789 5677 3452 9087 4562 1367 2678 7891 I need to remove the empty spaces and add commas between the numbers like: 1234,9876,6789,5677,3452, 9087,4562,1367,2678,7891 Can anyone tell me the command to do... (4 Replies)
Discussion started by: jazz
4 Replies

10. UNIX for Dummies Questions & Answers

Adding new Ethernet cards

Hi there, I just installed a Sparc 4-port Ethernet adapter on my sparc 10 and was wondering how on earth I find out what the names of the ports are. It looks like on startup that on SBus1 there is something called qec qe qe qe qe. So I tried to do an IFCONFIG qe0...but had no success. Can anyone... (3 Replies)
Discussion started by: jskillet
3 Replies
Login or Register to Ask a Question
RTNETLINK(3)						     Linux Programmer's Manual						      RTNETLINK(3)

NAME
rtnetlink - macros to manipulate rtnetlink messages SYNOPSIS
#include <asm/types.h> #include <linux/netlink.h> #include <linux/rtnetlink.h> #include <sys/socket.h> rtnetlink_socket = socket(AF_NETLINK, int socket_type, NETLINK_ROUTE); int RTA_OK(struct rtattr *rta, int rtabuflen); void *RTA_DATA(struct rtattr *rta); unsigned int RTA_PAYLOAD(struct rtattr *rta); struct rtattr *RTA_NEXT(struct rtattr *rta, unsigned int rtabuflen); unsigned int RTA_LENGTH(unsigned int length); unsigned int RTA_SPACE(unsigned int length); DESCRIPTION
All rtnetlink(7) messages consist of a netlink(7) message header and appended attributes. The attributes should be only manipulated using the macros provided here. RTA_OK(rta, attrlen) returns true if rta points to a valid routing attribute; attrlen is the running length of the attribute buffer. When not true then you must assume there are no more attributes in the message, even if attrlen is nonzero. RTA_DATA(rta) returns a pointer to the start of this attribute's data. RTA_PAYLOAD(rta) returns the length of this attribute's data. RTA_NEXT(rta, attrlen) gets the next attribute after rta. Calling this macro will update attrlen. You should use RTA_OK to check the validity of the returned pointer. RTA_LENGTH(len) returns the length which is required for len bytes of data plus the header. RTA_SPACE(len) returns the amount of space which will be needed in a message with len bytes of data. CONFORMING TO
These macros are nonstandard Linux extensions. BUGS
This manual page is incomplete. EXAMPLE
Creating a rtnetlink message to set the MTU of a device: #include <linux/rtnetlink.h> ... struct { struct nlmsghdr nh; struct ifinfomsg if; char attrbuf[512]; } req; struct rtattr *rta; unsigned int mtu = 1000; int rtnetlink_sk = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE); memset(&req, 0, sizeof(req)); req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)); req.nh.nlmsg_flags = NLM_F_REQUEST; req.nh.nlmsg_type = RTM_NEWLINK; req.if.ifi_family = AF_UNSPEC; req.if.ifi_index = INTERFACE_INDEX; req.if.ifi_change = 0xffffffff; /* ??? */ rta = (struct rtattr *)(((char *) &req) + NLMSG_ALIGN(req.nh.nlmsg_len)); rta->rta_type = IFLA_MTU; rta->rta_len = RTA_LENGTH(sizeof(unsigned int)); req.n.nlmsg_len = NLMSG_ALIGN(req.nh.nlmsg_len) + RTA_LENGTH(sizeof(mtu)); memcpy(RTA_DATA(rta), &mtu, sizeof(mtu)); send(rtnetlink_sk, &req, req.nh.nlmsg_len); SEE ALSO
netlink(3), netlink(7), rtnetlink(7) COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
2012-03-24 RTNETLINK(3)