Added service hash for resolving port/protocol numbers to names.
Minor fix to handling of netmasks end /32.
This commit is contained in:
22
serv_hash.h
Normal file
22
serv_hash.h
Normal 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_ */
|
||||
Reference in New Issue
Block a user