1
#include "network_address.h"
2
#include "network_packet.h"
7
net_address_t::net_address_t(const char *text)
12
for(sint8 j=24; j>=0; j-=8) {
13
uint32 n = atoi(text);
14
ip |= (n & 0xff) << j;
16
text = strchr(text+offset, '.');
27
void net_address_t::rdwr(packet_t *packet)
29
packet->rdwr_long(ip);
30
packet->rdwr_long(mask);
33
void address_list_t::rdwr(packet_t *packet)
35
uint32 count = get_count();
36
packet->rdwr_long(count);
37
for(uint32 i=0; i<count; i++) {
38
if (packet->is_loading()) {
39
append(net_address_t());
41
(*this)[i].rdwr(packet);