Added service hash for resolving port/protocol numbers to names.

Minor fix to handling of netmasks end /32.
This commit is contained in:
pdw
2002-10-10 14:11:12 +00:00
parent acad1ac4b5
commit c1f017231c
8 changed files with 137 additions and 23 deletions

22
serv_hash.h Normal file
View File

@@ -0,0 +1,22 @@
/*
* addr_hash.h:
*
*/
#ifndef __SERV_HASH_H_ /* include guard */
#define __SERV_HASH_H_
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "hash.h"
typedef struct {
int port;
int protocol;
} ip_service;
hash_type* serv_hash_create();
void serv_hash_initialise(hash_type* sh);
#endif /* __SERV_HASH_H_ */