mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 13:11:28 +00:00
Make some args const.
This commit is contained in:
@@ -497,7 +497,7 @@ int ip_is_reserved(struct in_addr *ip)
|
||||
returned for the set command. */
|
||||
#define MACCACHE_GET 1
|
||||
#define MACCACHE_SET 2
|
||||
static int do_mac_cache(int command, struct sockaddr_storage *ss, u8 *mac) {
|
||||
static int do_mac_cache(int command, const struct sockaddr_storage *ss, u8 *mac) {
|
||||
struct MacCache {
|
||||
struct sockaddr_storage ip;
|
||||
u8 mac[6];
|
||||
@@ -551,10 +551,10 @@ static int do_mac_cache(int command, struct sockaddr_storage *ss, u8 *mac) {
|
||||
* AF_INET. Otherwise the function will return 0 and there would be
|
||||
* no way for the caller to tell tell the difference between an error
|
||||
* or a cache miss.*/
|
||||
int mac_cache_get(struct sockaddr_storage *ss, u8 *mac){
|
||||
int mac_cache_get(const struct sockaddr_storage *ss, u8 *mac){
|
||||
return do_mac_cache(MACCACHE_GET, ss, mac);
|
||||
}
|
||||
int mac_cache_set(struct sockaddr_storage *ss, u8 *mac){
|
||||
int mac_cache_set(const struct sockaddr_storage *ss, u8 *mac){
|
||||
return do_mac_cache(MACCACHE_SET, ss, mac);
|
||||
}
|
||||
|
||||
|
||||
@@ -193,8 +193,8 @@ int ip_is_reserved(struct in_addr *ip);
|
||||
* Function mac_cache_set() adds an entry with the given ip (ss) and
|
||||
* mac address. An existing entry for the IP ss will be overwritten
|
||||
* with the new MAC address. mac_cache_set() always returns true. */
|
||||
int mac_cache_get(struct sockaddr_storage *ss, u8 *mac);
|
||||
int mac_cache_set(struct sockaddr_storage *ss, u8 *mac);
|
||||
int mac_cache_get(const struct sockaddr_storage *ss, u8 *mac);
|
||||
int mac_cache_set(const struct sockaddr_storage *ss, u8 *mac);
|
||||
|
||||
const void *ip_get_data(const void *packet, unsigned int *len,
|
||||
struct abstract_ip_hdr *hdr);
|
||||
|
||||
4
tcpip.cc
4
tcpip.cc
@@ -1949,8 +1949,8 @@ bool setTargetNextHopMAC(Target *target) {
|
||||
}
|
||||
|
||||
/* Like to getTargetNextHopMAC(), but for arbitrary hosts (not Targets) */
|
||||
bool getNextHopMAC(char *iface, u8 *srcmac, struct sockaddr_storage *srcss,
|
||||
struct sockaddr_storage *dstss, u8 *dstmac)
|
||||
bool getNextHopMAC(const char *iface, const u8 *srcmac, const struct sockaddr_storage *srcss,
|
||||
const struct sockaddr_storage *dstss, u8 *dstmac)
|
||||
{
|
||||
arp_t *a;
|
||||
struct arp_entry ae;
|
||||
|
||||
4
tcpip.h
4
tcpip.h
@@ -476,8 +476,8 @@ int setTargetMACIfAvailable(Target *target, struct link_header *linkhdr,
|
||||
after an ARP scan if many directly connected machines are involved. */
|
||||
bool setTargetNextHopMAC(Target *target);
|
||||
|
||||
bool getNextHopMAC(char *iface, u8 *srcmac, struct sockaddr_storage *srcss,
|
||||
struct sockaddr_storage *dstss, u8 *dstmac);
|
||||
bool getNextHopMAC(const char *iface, const u8 *srcmac, const struct sockaddr_storage *srcss,
|
||||
const struct sockaddr_storage *dstss, u8 *dstmac);
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user