🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #15691

Re: Raw sockets with winsock

#15691
From: Kjartan T. Hjorvar
Date: Mon, 16 Jun 2003 10:39
13 lines
1951 bytes
My pardons

The IP_HDRINCL option allows me to generate my own IP-header (the 20 bytes). The packet is sent to another machine on the net as defined by the header (last four bytes). The packet (01234567890123456789) is obviously not valid but should be sent regardless, any other machine seeing it must discard it immediatly.

The expected outcome was the result 0 in the first and second line, 20 in the third and 0 in the last. This implies that the opening of the socket and setting of the IP_HDRINCL option were successful (first two) and 20 bytes were sent (last two).
This is what I get when I compile with Visual C++ 6.
What happens when I build it with the borland tools I get 0,0,-1,10049. The opening and option are OK, but the sendto command fails with error 10049 (WSAEADDRNOTAVAIL).

What I'm looking for is a way to make this work in Borland builder in any way possible (all my other code is there). Any ideas about solving this problem?

Regards
  Kjartan T. Hjorvar
Technical Details
Message-ID: <3eed9e62$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3eebcb3d$1@newsgroups.borland.com> <3eec0f4d@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,37b140341e7bf2c2
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-06-16 03:41:55 PST
From: "Kjartan T. Hjorvar" <kjartant@simnet.is>
Sender: "Kjartan T. Hjorvar" <kjartant@simnet.is>
Reply-To: "Kjartan T. Hjorvar" <kjartant@simnet.is>
Subject: Re: Raw sockets with winsock
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 130.208.165.5 130.208.165.5    
X-Forwarded-For: 130.208.147.110
References: <3eebcb3d$1@newsgroups.borland.com> <3eec0f4d@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.65
Message-ID: <3eed9e62$1@newsgroups.borland.com>
Date: 16 Jun 2003 03:39:30 -0700
X-Trace: newsgroups.borland.com 1055759970 207.105.83.65 (16 Jun 2003 03:39:30 -0700)
Lines: 13
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail