/* *Structureofaninternetheader,nakedofoptions.
*/ struct ip {
u_int32_t ip_hl:4, /* header length */
ip_v:4; /* version */
u_int8_t ip_tos; /* type of service */
u_int16_t ip_len; /* total length */
u_int16_t ip_id; /* identification */
u_int16_t ip_off; /* fragment offset field */ #define IP_RF 0x8000 /* reserved fragment flag */ #define IP_DF 0x4000 /* dont fragment flag */ #define IP_MF 0x2000 /* more fragments flag */ #define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
u_int8_t ip_ttl; /* time to live */
u_int8_t ip_p; /* protocol */
u_int16_t ip_sum; /* checksum */ struct in_addr ip_src, ip_dst; /* source and dest address */
};
#define IP_MAXPACKET 65535/* maximum packet size */
/* *DefinitionsforIPtypeofservice(ip_tos)
*/ #define IPTOS_LOWDELAY 0x10 #define IPTOS_THROUGHPUT 0x08 #define IPTOS_RELIABILITY 0x04 #define IPTOS_MINCOST 0x02 #if1 /* ECN RFC3168 obsoletes RFC2481, and these will be deprecated soon. */ #define IPTOS_CE 0x01 /* congestion experienced */ #define IPTOS_ECT 0x02 /* ECN-capable transport */ #endif
/* *Internetimplementationparameters.
*/ #define MAXTTL 255/* maximum time to live (seconds) */ #define IPDEFTTL 64/* default ttl, from RFC 1340 */ #define IPFRAGTTL 60/* time to live for frags, slowhz */ #define IPTTLDEC 1/* subtracted when forwarding */
#define IP_MSS 576/* default maximum segment size */
/* *ThisistherealIPv4pseudoheader,usedforcomputingtheTCPandUDP *checksums.FortheInternetchecksum,structipovlycanbeusedinstead. *Forstrongerchecksums,therealthingmustbeused.
*/ struct ippseudo { struct in_addr ippseudo_src; /* source internet address */ struct in_addr ippseudo_dst; /* destination internet address */
u_int8_t ippseudo_pad; /* pad, must be zero */
u_int8_t ippseudo_p; /* protocol */
u_int16_t ippseudo_len; /* protocol length */
};
/* BIONIC addition: declarations matching the Linux kernel */ /* some programs expect these... */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.