Hi folks,
ich versuche mich immer noch daran per socket.handle IP Parameter, wie
den TOS Wert, zusetzen. Nur leider finde ich die Beschreibungen dazu
bei RB sehr dürftig. Wie kann ich von RB aus auf die Socket Parameter
bei Mac OSX zugreifen? Hat jemand ein Beispiel oder eine Beschreibung
für mich?? Das einige was ich zu dem Thema bei Apple gefunden habe,
habe ich unten angehängt.
bye
Klemens
#include <sys/socket.h>
#include <netinet/in.h>
int socket(AF_INET, SOCK_RAW, proto);
DESCRIPTION IP is the transport layer protocol used by the
Internet protocol family. Options may be set at the IP level when
using higher-level protocols that are based on IP (such as TCP and
UDP). It may also be accessed through a ``raw socket'' when
developing new protocols, or special-purpose applica-applications.
tions. There are several IP-level setsockopt(2) /getsockopt(2)
options. IP_OPTIONS may be used to provide IP options to be
transmitted in the IP header of each outgoing packet or to examine
the header options on incom-incoming ing packets. IP options may
be used with any socket type in the Internet family. The format
of IP options to be sent is that specified by the IP protocol
specification (RFC-791), with one exception: the list of addresses
for Source Route options must include the first-hop gateway at the
beginning of the list of gateways. The first-hop gateway address
will be extracted from the option list and the size adjusted
accordingly before use. To disable previously specified options,
use a zero-length buffer:
setsockopt(s, IPPROTO_IP, IP_OPTIONS, NULL, 0);
IP_TOS and IP_TTL may be used to set the type-of-service and
time-to-live fields in the IP header for SOCK_STREAM and SOCK_DGRAM
sockets.
int tos = IPTOS_LOWDELAY; /* see <netinet/in.h> */
setsockopt(s, IPPROTO_IP, IP_TOS, &tos, sizeof(tos));
int ttl = 60; /* max = 255 */ setsockopt(s,
IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl));