1
0
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:
david
2011-10-29 19:40:15 +00:00
parent 17e54e2d0e
commit 06b69fa9a3
4 changed files with 9 additions and 9 deletions

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);