I have a working code that displays an entry from a given IP address. but, how can i display the entire ARP table? like the option 'arp -a' of the standard linux program.
This is the code:
I've looked to /usr/src/linux/net/ipv4/arp.c code before posting and can't find anything that tells me how to do it.
Dear all,
We are testing two of our servers for mq series connectivity. The scenario is, when one machine is shutting down it's services there are some scripts that do a dns update, which removes the ip address and relates it to the ip address of the other node on our dns server, and the update... (7 Replies)
Dear All
i have a linux proxy server which has RHEL-5 64 bit, it has two interfaces, it has the following details
eth0=10.200.14.42
eth3=10.201.14.42
default gateway=10.201.14.254
one static route=192.168.0.0/24 gw 10.200.14.254
i am facing a problem when i ping 10.201.14.42 from... (2 Replies)
Dear Friends,
Am an newbie to this domain. I have a table which is filled with contents which i need to be updated with,so am trying to design a flow which would read the data from the table and mail it to me at regular intervals. I could make out the flow using mailx command but want to... (3 Replies)
Man page of netlink says:
---------------------------------
NETLINK_ARPD
For managing the arp table in user space.
----------------------------------
Is it possible to monitor arp table using Netlink? or it's just for manipulating? (1 Reply)
Hi
The below script working when we are sending the html as attachment can u please guide how to send thesmae data in table form direct in the mail and not in mail attachment .
cat Employee.sql
SET VERIFY OFF
SET PAGESIZE 200
SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON -
HEAD... (0 Replies)
Can someone please explain this output to me. Why doesn't ifconfig show the same info?
~ $ arp -a
? (10.71.0.1) at 00:1b:21:2b:eb:0c on eth0 (4 Replies)
I am writing some portable code to print Interface, its IP address, and its MAC (Hardware) address. It is working on three platforms (viz, Linux, Solaris and HP-UX). However, it is creating problems on AIX.
The code is as follows:
Now the problem is that when I try to execute the... (1 Reply)
My script gives the following result. Is it possible to display the same in table format ?
1.
rex_best
Latest feeds are not avaialable. The last feed was generated on 2012-05-17
File Name = ekb_best_20120517_010949_665.tar.gz
The Number of entry elements = 4209539
2.
rex_genre
Latest... (2 Replies)
I want to search a small string in a large string and find the locations of the string. For this I used grep "string" -ob <file name where the large string is stored>. Now this gives me the locations of that string. Now how do I store these locations in a text file.
Please use CODE tags as... (7 Replies)
Discussion started by: ANKIT ROY
7 Replies
LEARN ABOUT MINIX
rtnetlink
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 manipulated only 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.nh.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, 0);
SEE ALSO netlink(3), netlink(7), rtnetlink(7)COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the
latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.
GNU 2014-09-06 RTNETLINK(3)