mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 14:11:29 +00:00
Abstract some things to move #includes out of headers.
This commit is contained in:
@@ -147,6 +147,36 @@
|
||||
|
||||
extern NmapOps o;
|
||||
|
||||
u16 UltraProbe::sport() const {
|
||||
switch (mypspec.proto) {
|
||||
case IPPROTO_TCP:
|
||||
return probes.IP.pd.tcp.sport;
|
||||
case IPPROTO_UDP:
|
||||
return probes.IP.pd.udp.sport;
|
||||
case IPPROTO_SCTP:
|
||||
return probes.IP.pd.sctp.sport;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
/* not reached */
|
||||
}
|
||||
|
||||
u16 UltraProbe::dport() const {
|
||||
switch (mypspec.proto) {
|
||||
case IPPROTO_TCP:
|
||||
return mypspec.pd.tcp.dport;
|
||||
case IPPROTO_UDP:
|
||||
return mypspec.pd.udp.dport;
|
||||
case IPPROTO_SCTP:
|
||||
return mypspec.pd.sctp.dport;
|
||||
default:
|
||||
/* dport() can get called for other protos if we
|
||||
* get ICMP responses during IP proto scans. */
|
||||
return 0;
|
||||
}
|
||||
/* not reached */
|
||||
}
|
||||
|
||||
/* Pass an arp packet, including ethernet header. Must be 42bytes */
|
||||
|
||||
void UltraProbe::setARP(u8 *arppkt, u32 arplen) {
|
||||
|
||||
Reference in New Issue
Block a user