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