store net_connection addresses in binary rather than string
This commit is contained in:
parent
e4303ee612
commit
b6950ca519
|
@ -2054,10 +2054,12 @@ static int net_conn_get_tcp(sigar_net_connection_walker_t *walker)
|
||||||
|
|
||||||
conn.type = SIGAR_NETCONN_TCP;
|
conn.type = SIGAR_NETCONN_TCP;
|
||||||
|
|
||||||
sigar_inet_ntoa(sigar, pcb.inp_laddr.s_addr,
|
sigar_net_address_set(conn.local_address,
|
||||||
conn.local_address);
|
pcb.inp_laddr.s_addr);
|
||||||
sigar_inet_ntoa(sigar, pcb.inp_faddr.s_addr,
|
|
||||||
conn.remote_address);
|
sigar_net_address_set(conn.remote_address,
|
||||||
|
pcb.inp_faddr.s_addr);
|
||||||
|
|
||||||
conn.local_port = ntohs(pcb.inp_lport);
|
conn.local_port = ntohs(pcb.inp_lport);
|
||||||
conn.remote_port = ntohs(pcb.inp_fport);
|
conn.remote_port = ntohs(pcb.inp_fport);
|
||||||
|
|
||||||
|
|
|
@ -832,10 +832,10 @@ static int net_conn_get_udp_listen(sigar_net_connection_walker_t *walker)
|
||||||
conn.local_port = (unsigned short)entry->LocalPort;
|
conn.local_port = (unsigned short)entry->LocalPort;
|
||||||
conn.remote_port = 0;
|
conn.remote_port = 0;
|
||||||
|
|
||||||
sigar_inet_ntoa(sigar, entry->LocalAddress,
|
sigar_net_address_set(conn.local_address,
|
||||||
conn.local_address);
|
entry->LocalAddress);
|
||||||
|
|
||||||
SIGAR_SSTRCPY(conn.remote_address, "0.0.0.0");
|
sigar_net_address_set(conn.remote_address, 0);
|
||||||
|
|
||||||
conn.send_queue = conn.receive_queue = SIGAR_FIELD_NOTIMPL;
|
conn.send_queue = conn.receive_queue = SIGAR_FIELD_NOTIMPL;
|
||||||
|
|
||||||
|
@ -955,11 +955,8 @@ static int net_conn_get_tcp(sigar_net_connection_walker_t *walker)
|
||||||
conn.remote_port = (unsigned short)entry->RemPort;
|
conn.remote_port = (unsigned short)entry->RemPort;
|
||||||
conn.type = SIGAR_NETCONN_TCP;
|
conn.type = SIGAR_NETCONN_TCP;
|
||||||
|
|
||||||
sigar_inet_ntoa(sigar, entry->LocalAddress,
|
sigar_net_address_set(conn.local_address, entry->LocalAddress);
|
||||||
conn.local_address);
|
sigar_net_address_set(conn.remote_address, entry->RemAddress);
|
||||||
|
|
||||||
sigar_inet_ntoa(sigar, entry->RemAddress,
|
|
||||||
conn.remote_address);
|
|
||||||
|
|
||||||
conn.send_queue = conn.receive_queue = SIGAR_FIELD_NOTIMPL;
|
conn.send_queue = conn.receive_queue = SIGAR_FIELD_NOTIMPL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue