1
/* $Id: net_raw.c 61 2006-05-19 18:32:14Z steve-beattie $ */
4
* Copyright (C) 2002-2005 Novell/SUSE
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License as
8
* published by the Free Software Foundation, version 2 of the
12
/* Basic tcp networking test. */
19
//#include <netinet/in.h>
20
#include <netpacket/packet.h>
21
#include <net/ethernet.h>
22
#include <sys/select.h>
23
#include <sys/socket.h>
25
#include <sys/types.h>
27
#include <arpa/inet.h>
30
#define HOSTIP "127.0.0.1"
33
#define WAITLEN 1 /* number of seconds for select to wait */
34
#define DATASOURCE "/dev/urandom"
39
main (int argc, char * argv[]) {
43
if ((sockfd = socket (PF_PACKET, SOCK_RAW, htons(ETH_P_ALL))) < 0) {
44
perror ("FAIL: Server: can't open raw socket");