E
estantep
Hi,
I have been struggling and googling with no success. I am trying to
code a program to use raw sockets under FreeBSD, but I am getting the
following error when running cc:
$ cc raw.c
raw.c:28: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '.' token
raw.c:29: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '.' token
#define SRC_IP "1.1.1.1"
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/igmp.h>
#include <netinet/igmp_var.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <string.h>
/*#include <arpa/inet.h>*/
#define BUF_LEN 1400
int my_socket;
char buffer[BUF_LEN];
struct ip *iph = (struct ip *) buffer;
struct sockaddr_in s_in;
s_in.sin_family = PF_INET; /* line 28 */
s_in.sin_addr.s_addr = inet_addr(SRC_IP); /* line 29 */
/* eof */
Thank you
I have been struggling and googling with no success. I am trying to
code a program to use raw sockets under FreeBSD, but I am getting the
following error when running cc:
$ cc raw.c
raw.c:28: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '.' token
raw.c:29: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '.' token
#define SRC_IP "1.1.1.1"
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/igmp.h>
#include <netinet/igmp_var.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <string.h>
/*#include <arpa/inet.h>*/
#define BUF_LEN 1400
int my_socket;
char buffer[BUF_LEN];
struct ip *iph = (struct ip *) buffer;
struct sockaddr_in s_in;
s_in.sin_family = PF_INET; /* line 28 */
s_in.sin_addr.s_addr = inet_addr(SRC_IP); /* line 29 */
/* eof */
Thank you