Use of snoop(7P)
Mark Andrews
mark at alias.UUCP
Thu Feb 8 02:04:29 AEST 1990
I have been playing with the snoop(7P) protocol on a variety of
4D's (4D/60,70, 20, 25) running Irix 3.2. My program was constructed
using the examples in the manual page:
#include <sys/types.h>
#include <net/raw.h>
#include <netinet/if_ether.h>
#define ETHERHDRPAD RAW_HDRPAD(sizeof(struct ether_header))
struct etherpacket {
struct snoopheader snoop;
char pad[ETHERHDRPAD];
struct ether_header ether;
char data[ETHERMTU];
};
main()
{
int s;
struct sockaddr_raw sr;
struct snoopfilter sf;
struct etherpacket ep;
int cc, on = 1;
s = socket(AF_RAW, SOCK_RAW, RAWPROTO_SNOOP);
bzero(sr.sr_ifname, RAW_IFNAMSIZ);
/*
* If the family is not set (not specified in manual page), bind
* fails due to unsupported address family.
*/
sr.sr_family = AF_RAW;
sr.sr_port = 0;
if (bind(s, &sr, sizeof sr) < 0)
{
/* Error */
}
bzero((char *) &sf, sizeof sf);
if (ioctl(s, SIOCADDSNOOP, (struct snoopfilter *)&sf) < 0)
{
perror("Adding snoop filter");
exit(1);
}
< .... >
-----------------------------------------------------------------------------
When the program attempts to add the snoopfilter to the socket, the ioctl()
fails with the error ``Invalid argument'' and the following message appears
on the console of the machine (4D/80S in this case):
enp0: promisc. mode failed: no firmware support
Is this going to be fixed on a future release ? I was hoping to use some
of the above code to port tcpdump to Irix.
------------------------------------------------------------------------------
Mark Andrews
Systems Programmer,
Alias Research,
Toronto, Canada
Phone: (416)-362-9181
UUCP: mark%alias at csri.utoronto.ca
More information about the Comp.sys.sgi
mailing list