1
0
Files
irix-657m-src/irix/cmd/netman/lib/protocols/ip_indexops.c
2022-09-29 17:59:04 +03:00

23 lines
435 B
C

/*
* Copyright 1989 Silicon Graphics, Inc. All rights reserved.
*
* Index operations for IP addresses, used by several protocols.
*/
#include <sys/types.h>
#include <netinet/in.h>
unsigned int
ip_hashaddr(struct in_addr *addr)
{
u_long hash;
hash = addr->s_addr;
return ((hash >> 8 ^ hash) >> 8 ^ hash) >> 8 ^ hash;
}
int
ip_cmpaddrs(struct in_addr *addr1, struct in_addr *addr2)
{
return addr1->s_addr != addr2->s_addr;
}