Benutzer:Grey/wrapper-klassen: Unterschied zwischen den Versionen
(→IP-wrapper-Klasse) |
(→wrapper-Klassen) |
||
(6 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 6: | Zeile 6: | ||
Folgende wrapper-Klassen gibt es: | Folgende wrapper-Klassen gibt es: | ||
− | * ip_wrap.cpp | + | * ip_wrap.cpp (trunk/src/wrapper/tcp/tcp_wrap.cpp) |
− | * tcp_wrap.cpp | + | * tcp_wrap.cpp (trunk/src/wrapper/tcp/tcp_wrap.cpp) |
− | * udp_wrap.cpp | + | * udp_wrap.cpp (trunk/src/wrapper/udp/udp_wrap.cpp) |
− | * icmp_wrap.cpp | + | * icmp_wrap.cpp (trunk/src/wrapper/icmp/icmp_wrap.cpp) |
− | == IP-wrapper-Klasse == | + | === IP-wrapper-Klasse === |
− | + | ==== HEADER-Felder: ==== | |
− | === HEADER-Felder: === | ||
* IP_HEADER_VERSION | * IP_HEADER_VERSION | ||
* IP_HEADER_IHL | * IP_HEADER_IHL | ||
Zeile 36: | Zeile 35: | ||
* IP_PAYLOAD | * IP_PAYLOAD | ||
− | === So setzt man zum Beispiel drei Felder des IP-Headers: === | + | ==== So setzt man zum Beispiel drei Felder des IP-Headers: ==== |
− | + | ||
+ | ip_packet = fwt_ip.Packet(fwt_ip.defaultPacket) | ||
ip_packet.set ({ | ip_packet.set ({ | ||
fwt_ip.HEADER_PROTOCOL: 17, | fwt_ip.HEADER_PROTOCOL: 17, | ||
Zeile 45: | Zeile 45: | ||
=== TCP-wrapper-Klasse === | === TCP-wrapper-Klasse === | ||
− | HEADER-Felder | + | ==== HEADER-Felder: ==== |
+ | * TCP_HEADER_SOURCEPORT | ||
+ | * TCP_HEADER_DESTPORT | ||
+ | * TCP_HEADER_SEQUENCENUMBER | ||
+ | * TCP_HEADER_ACKNOWLEDGMENTNUMBER | ||
+ | * TCP_HEADER_DATAOFFSET | ||
+ | * TCP_HEADER_RESERVED | ||
+ | * TCP_HEADER_FLAGS | ||
+ | * TCP_HEADER_URG | ||
+ | * TCP_HEADER_ACK | ||
+ | * TCP_HEADER_PSH | ||
+ | * TCP_HEADER_RST | ||
+ | * TCP_HEADER_SYN | ||
+ | * TCP_HEADER_FIN | ||
+ | * TCP_HEADER_WINDOW | ||
+ | * TCP_HEADER_CHECKSUM | ||
+ | * TCP_HEADER_URGENTPOINTER | ||
+ | * TCP_HEADER_OPTIONS | ||
+ | * TCP_PAYLOAD | ||
− | === UDP-wrapper- | + | === UDP-wrapper-Klassen === |
− | HEADER-Felder | + | ==== HEADER-Felder: ==== |
+ | * UDP_HEADER_SOURCEPORT | ||
+ | * UDP_HEADER_DESTPORT | ||
+ | * UDP_HEADER_LENGTH | ||
+ | * UDP_HEADER_CHECKSUM | ||
+ | * UDP_PAYLOAD | ||
=== ICMP-wrapper-Klasse === | === ICMP-wrapper-Klasse === | ||
− | HEADER-Felder | + | ==== HEADER-Felder: ==== |
+ | * ICMP_HEADER_TYPE | ||
+ | * ICMP_HEADER_CODE | ||
+ | * ICMP_HEADER_CHECKSUM | ||
+ | * ICMP_HEADER_POINTER | ||
+ | * ICMP_HEADER_IDENTIFIER | ||
+ | * ICMP_HEADER_SEQNUMBER | ||
+ | * ICMP_HEADER_GWIPADDRESS | ||
+ | * ICMP_PAYLOAD |
Aktuelle Version vom 15. Oktober 2005, 22:48 Uhr
Inhaltsverzeichnis
wrapper-Klassen
Allgemeines zu wrapper-Klassen
Momentan gibt es für jedes übliche Protokoll eine wrapper-Klasse. Jede wrapper-Klasse bietet der Python-Ebene die Funktionalität zu dem entsprechenden Protokoll an, wie zum Beispiel Konstruktuoren für default IP-Pakete und Setter-Methoden für den Header, um Felder zu setzen.
Folgende wrapper-Klassen gibt es:
- ip_wrap.cpp (trunk/src/wrapper/tcp/tcp_wrap.cpp)
- tcp_wrap.cpp (trunk/src/wrapper/tcp/tcp_wrap.cpp)
- udp_wrap.cpp (trunk/src/wrapper/udp/udp_wrap.cpp)
- icmp_wrap.cpp (trunk/src/wrapper/icmp/icmp_wrap.cpp)
IP-wrapper-Klasse
HEADER-Felder:
- IP_HEADER_VERSION
- IP_HEADER_IHL
- IP_HEADER_TOS
- IP_HEADER_LENGTH
- IP_HEADER_ID
- IP_HEADER_FLAGS
- IP_HEADER_RESERVED
- IP_HEADER_DONTFRAGMENT
- IP_HEADER_MOREFRAGMENTS
- IP_HEADER_FRAGOFFSET
- IP_HEADER_TTL
- IP_HEADER_PROTOCOL
- IP_HEADER_CHECKSUM
- IP_HEADER_SOURCEIP
- IP_HEADER_DESTIP
- IP_HEADER_OPTIONS
- IP_PAYLOAD
So setzt man zum Beispiel drei Felder des IP-Headers:
ip_packet = fwt_ip.Packet(fwt_ip.defaultPacket) ip_packet.set ({ fwt_ip.HEADER_PROTOCOL: 17, fwt_ip.HEADER_SOURCEIP: 10.0.0.1, fwt_ip.HEADER_DESTIP: 10.128.0.1, })
TCP-wrapper-Klasse
HEADER-Felder:
- TCP_HEADER_SOURCEPORT
- TCP_HEADER_DESTPORT
- TCP_HEADER_SEQUENCENUMBER
- TCP_HEADER_ACKNOWLEDGMENTNUMBER
- TCP_HEADER_DATAOFFSET
- TCP_HEADER_RESERVED
- TCP_HEADER_FLAGS
- TCP_HEADER_URG
- TCP_HEADER_ACK
- TCP_HEADER_PSH
- TCP_HEADER_RST
- TCP_HEADER_SYN
- TCP_HEADER_FIN
- TCP_HEADER_WINDOW
- TCP_HEADER_CHECKSUM
- TCP_HEADER_URGENTPOINTER
- TCP_HEADER_OPTIONS
- TCP_PAYLOAD
UDP-wrapper-Klassen
HEADER-Felder:
- UDP_HEADER_SOURCEPORT
- UDP_HEADER_DESTPORT
- UDP_HEADER_LENGTH
- UDP_HEADER_CHECKSUM
- UDP_PAYLOAD
ICMP-wrapper-Klasse
HEADER-Felder:
- ICMP_HEADER_TYPE
- ICMP_HEADER_CODE
- ICMP_HEADER_CHECKSUM
- ICMP_HEADER_POINTER
- ICMP_HEADER_IDENTIFIER
- ICMP_HEADER_SEQNUMBER
- ICMP_HEADER_GWIPADDRESS
- ICMP_PAYLOAD