mirror of
https://github.com/nmap/nmap.git
synced 2026-10-09 05:44:36 +00:00
Define our own servent/protoent structs with const members.
This commit is contained in:
parent
d8864b6d5a
commit
cc5cd5f2c6
6 changed files with 26 additions and 17 deletions
|
|
@ -128,7 +128,7 @@ static int nmap_protocols_init() {
|
|||
numipprots++;
|
||||
|
||||
current = (struct protocol_list *) cp_alloc(sizeof(struct protocol_list));
|
||||
current->protoent = (struct protoent *) cp_alloc(sizeof(struct protoent));
|
||||
current->protoent = (struct nprotoent *) cp_alloc(sizeof(struct nprotoent));
|
||||
current->next = NULL;
|
||||
if (previous == NULL) {
|
||||
protocol_table[protno % PROTOCOL_TABLE_SIZE] = current;
|
||||
|
|
@ -137,7 +137,6 @@ static int nmap_protocols_init() {
|
|||
}
|
||||
current->protoent->p_name = cp_strdup(protocolname);
|
||||
current->protoent->p_proto = protno;
|
||||
current->protoent->p_aliases = NULL;
|
||||
}
|
||||
fclose(fp);
|
||||
protocols_initialized = 1;
|
||||
|
|
@ -172,7 +171,7 @@ int addprotocolsfromservmask(char *mask, u8 *porttbl) {
|
|||
}
|
||||
|
||||
|
||||
struct protoent *nmap_getprotbynum(int num) {
|
||||
struct nprotoent *nmap_getprotbynum(int num) {
|
||||
struct protocol_list *current;
|
||||
|
||||
if (nmap_protocols_init() == -1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue