pcp
[Top] [All Lists]

[Bug 1106] pmdalinux / pmdaroot container problems

To: pcp@xxxxxxxxxxx
Subject: [Bug 1106] pmdalinux / pmdaroot container problems
From: bugzilla-daemon@xxxxxxxxxxx
Date: Fri, 01 May 2015 02:15:29 +0000
Auto-submitted: auto-generated
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <bug-1106-835@xxxxxxxxxxxxxxxx/bugzilla/>
References: <bug-1106-835@xxxxxxxxxxxxxxxx/bugzilla/>

Comment # 3 on bug 1106 from
for network.interface.inet_addr (at least) you can walk /proc/net/dev (using
the net namespace) and then use code like the following :

#include <stdio.h>
#include <unistd.h>
#include <string.h>

#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <net/if.h>
#include <arpa/inet.h>

int
main(int argc, char *argv[])
{
    int i, fd;
    struct ifreq ifr;

    fd = socket(AF_INET, SOCK_DGRAM, 0);
    ifr.ifr_addr.sa_family = AF_INET;

    for (i=1; i < argc; i++) {
        strncpy(ifr.ifr_name, argv[i], IFNAMSIZ-1);
        if (ioctl(fd, SIOCGIFADDR, &ifr) == 0)
            printf("%s %s\n", inet_ntoa(((struct sockaddr_in
*)&ifr.ifr_addr)->sin_addr), argv[i]);
    }

    close(fd);
    return 0;
}

With the above code, the NET_ADDR_INDOM and NET_DEV_INDOM indoms could be
combined couldn't they?


You are receiving this mail because:
  • You are on the CC list for the bug.
  • You are the assignee for the bug.
<Prev in Thread] Current Thread [Next in Thread>