Re: lug-bg: IP_HDRINCL ?????????
- Subject: Re: lug-bg: IP_HDRINCL ?????????
- From: kay@xxxxxxxxxxxx (kay)
- Date: Thu, 12 Aug 1999 16:00:42 +0300 (EEST)
On Thu, 12 Aug 1999, skk wrote:
> hi,
>
> niakoj znaiach na C++ moje li da mi pomogne s dilemata mi?
(na C move li? :-) )
> zashto pod NT ne moga da otwariam socket i da mu setna
> opciata IP_HDRINCL? pod linux se kompilira otlichno i
> raboti.
> pod NT sushto se kompilira otlichno, no pri izpulnenie
> otkazwa da ia setne :((( wupreki che sam s
> Administrator login...
>
> .....
>
> s = socket (AF_INET, SOCK_RAW, 0);
> if (s == INVALID_SOCKET)
> {
> // tuk niama problem! inicializira se ok!
> }
>
> BOOL value = //true or false - whatever!
> int result = setsockopt(aSocket, IPPROTO_IP,
> IP_HDRINCL, (char *)&value, sizeof(value));
> if (result==-1)
> {
> // MAMA MU SHA IBA NA TUPOTO NT!!!!!!!!!!!! WINAGI
> E -1!!!
> }
Mnogo prosto - Micro$oft kato sa kopirali BSD API-to za soketi sa go
podkastrili dosta. Interesno mi e kak izobshto socket() wryshta waliden
deskriptor pri tip SOCK_RAW i protokol 0 (sirech IPv4). Ot winsock 2.0
(ili maj beshe 2.2?) nagore ima SOCK_RAW, no samo za IPPROTO_ICMP.
A IP_HDRINCL soket opciqta (towa e razlichno pri razlichnite OS - naprimer
pri Linux towa e po default) kara sistemata da ti dawa paketa zapochwajki
ot IPv4 (ili syotwetniq drug protokol) hedyra nadolu.
Kolkoto do "istinski" RAW soketi pod Windows - towa e wyzmovno s NT device
driver ili VxD pod 9x.
--
kay <kay@xxxxxxxxxxxx> Bits/KeyID: 1024/BFFC4015
DA FA 10 7D 6A 05 45 11 37 E1 E1 2B B4 34 2E 83
==================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers)
For more send to lug-bg-request@xxxxxxxxxxxx a single word 'info'
==================================================================
|