Subject: I can't compile an sctp code from a book

From: Isaac Fernandez Baca <[email-masked]>
Date: Sat, 13 Oct 2007 22:50:41 -0500

Dear SCTP's experts:

I try to compile an sctp code from this book "Stevens R., UNIX Network 
Programming Volume 1, The Sockets Networking API, Addison Wesley, Third 
Edition, 2003."

I'm using Ubuntu 7.10 feisty with kernel 2.6.20-15-generic

I thought was the Makefile so I remade by myself, and also I still 
having the same problem.

The problem is "error: redefinition of ‘struct in_pktinfo’" and I don't 
know how to fix that.
Please help me

isaac@isaac-laptop:~/unpv13e/sctp$ make
gcc -g -Wuninitialized -O3 -Wunused -W -Wall -Wstrict-prototypes 
-Wimplicit-function-declaration -c -o sctpserv01.o sctpserv01.c
In file included from sctpserv01.c:1:
unp.h:115: error: redefinition of ‘struct in_pktinfo’
sctpserv01.c: In function ‘main’:
sctpserv01.c:33: warning: implicit declaration of function ‘Sctp_recvmsg’
sctpserv01.c:38: warning: implicit declaration of function 
‘sctp_get_no_strms’
sctpserv01.c:41: warning: implicit declaration of function ‘Sctp_sendmsg’
make: *** [sctpserv01.o] Error 1
isaac@isaac-laptop:~/unpv13e/sctp$

Thanks a lot!!!
Isaac from Peru

---

From: Vlad Yasevich <[email-masked]>
Date: Sun, 14 Oct 2007 19:25:02 -0400

> The problem is "error: redefinition of ‘struct in_pktinfo’" and I don't 

struct in_pktinfo is already defined in linux.  You can either change
the name you use, or use the structure provided.  (in_pktinfo is defined
as part of <netinet/in.h>).

> make: *** [sctpserv01.o] Error 1

The API defines "sctp_sendmsg" (small 's').  SCTP API does not define
sctp_get_no_strms() function.

-vlad

---

From: Bachelor Isaac Fernandez Baca <[email-masked]>
Date: Mon, 15 Oct 2007 21:25:17 -0500

Vlad Yasevich escribió:
>> I try to compile an sctp code from this book "Stevens R., UNIX 
>> Network Programming Volume 1, The Sockets Networking API, Addison 
>> Wesley, Third Edition, 2003."
>>
>> The problem is "error: redefinition of ‘struct in_pktinfo’" and I 
>> don't know how to fix that.
>
Dear  Vlad,

I put #include <netinet/.in.h>  but still the same, and also I changed 
the name of capital letters and now I have this

isaac@isaac-laptop:~/workspace/unp/sctp$ make
gcc -I../lib -g -O2 -D_REENTRANT -Wall -g -c -o sctpserv01.o sctpserv01.c
In file included from sctpserv01.c:1:
unp.h:115: *error: redefinition of ‘struct in_pktinfo*’
sctpserv01.c: In function ‘main’:
sctpserv01.c:39: warning: implicit declaration of function 
‘sctp_get_no_strms’
make: *** [sctpserv01.o] Error 1
isaac@isaac-laptop:~/workspace/unp/sctp$

-- 
Sincerely,

Isaac Fernandez Baca

Bachelor of Telecommunications Engineering

Pontificia Universidad Catolica del Peru

+511 9 709 0306

---

From: Randall Stewart <[email-masked]>
Date: Mon, 15 Oct 2007 22:26:06 -0400

Vlad Yasevich wrote:
>> Programming Volume 1, The Sockets Networking API, Addison Wesley, 
>> Third Edition, 2003."
>>

the cap S in stevens books usually as to do with a macro somewhere
that does an error check..

I believe the Sctp_recvmsg/sendmsg should be a macro in some code... 
possibly the make is not including the right include???

R

-- 
Randall Stewart
NSSTG - Cisco Systems Inc.
803-345-0369 <or> 803-317-4952 (cell)

---

From: Vlad Yasevich <[email-masked]>
Date: Tue, 16 Oct 2007 13:11:05 -0400

> unp.h:115: *error: redefinition of ‘struct in_pktinfo*’

Your file is still defining your structure.  Either remove your definition
or rename it.

> sctpserv01.c:39: warning: implicit declaration of function

You need to declare a prototype for this function.

-vlad