Update of /cvsroot/dhcp-agent/dhcp-agent/src
In directory sc8-pr-cvs1:/tmp/cvs-serv28588/src
Modified Files:
dhcp-librawnet.h dhcp-rawnet.c
Log Message:
rawnet now lets us get subnet mask from interface
Index: dhcp-librawnet.h
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-librawnet.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** dhcp-librawnet.h 5 Aug 2003 05:00:38 -0000 1.24
--- dhcp-librawnet.h 18 Aug 2003 01:49:32 -0000 1.25
***************
*** 190,193 ****
--- 190,194 ----
eth_addr_t hw_addr; /* our hardware address. */
ip_addr_t ip_addr; /* our ip address. */
+ ip_addr_t subnet_mask; /* subnet mask. */
eth_addr_t *fake_hw_addr; /* our fake hardware address, if any. */
***************
*** 370,373 ****
--- 371,375 ----
/* rawnet routines. */
extern ip_addr_t rawnet_get_ip_addr(rawnet_t *net);
+ extern ip_addr_t rawnet_get_subnet_mask(rawnet_t *net);
extern int rawnet_port_for_service(const char *serv, const char *proto);
extern char *rawnet_network_address_to_string_static(uint32_t addr);
Index: dhcp-rawnet.c
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-rawnet.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** dhcp-rawnet.c 5 Aug 2003 04:53:19 -0000 1.15
--- dhcp-rawnet.c 18 Aug 2003 01:49:32 -0000 1.16
***************
*** 46,49 ****
--- 46,55 ----
}
+ /* get subnet mask. */
+ ip_addr_t rawnet_get_subnet_mask(rawnet_t *net)
+ {
+ return net->subnet_mask;
+ }
+
/* get a port for a service. */
int rawnet_port_for_service(const char *serv, const char *proto)
***************
*** 106,109 ****
--- 112,117 ----
eth_get(net->eth, &net->hw_addr);
interface_get_ip_addr(net->intf_handle, &net->ip_addr);
+ interface_get_subnet_mask(net->intf_handle, &net->subnet_mask);
+
net->mtu = interface_get_mtu(net->intf_handle);
xfree(net->packet_data);
***************
*** 122,125 ****
--- 130,135 ----
memset(&net->ip_addr, 0, IP_ADDR_LEN); /* clear our IP address -- this isn't very useful though. */
+ memset(&net->subnet_mask, 0, IP_ADDR_LEN);
+
return 0;
}
***************
*** 269,272 ****
--- 279,283 ----
eth_get(net->eth, &net->hw_addr);
interface_get_ip_addr(net->intf_handle, &net->ip_addr);
+ interface_get_subnet_mask(net->intf_handle, &net->subnet_mask);
net->mtu = interface_get_mtu(intf_handle);
|