Segunda, 08 de Marco de 2004, 00:01:53

março 8th, 2004 | by Aldrin Leal |

Fragmentos…


Ou melhor, códigos resgatados…


/** * Fineza interpretar o seguinte paragrafo (vindo do RFC 2131...): * * [1] If the 'giaddr' field in a DHCP message from a client is non-zero, * the server sends any return messages to the 'DHCP server' port on the * BOOTP relay agent whose address appears in 'giaddr'. [2] If the 'giaddr ' * field is zero and the 'ciaddr' field is nonzero, then the server * unicasts DHCPOFFER and DHCPACK messages to the address in 'ciaddr'. * [3] If 'giaddr' is zero and 'ciaddr' is zero, and the broadcast bit is * set, then the server broadcasts DHCPOFFER and DHCPACK messages to * 0xffffffff. [4] If the broadcast bit is not set and 'giaddr' is zero and * 'ciaddr' is zero, then the server unicasts DHCPOFFER and DHCPACK * messages to the client's hardware address and 'yiaddr' address. In * all cases, when 'giaddr' is zero, the server broadcasts any DHCPNAK * messages to 0xffffffff. **/ if (nonZeroP(inMessage.getCiaddr()) && zeroP(inMessage.getGiaddr())) { outMessage.setDestinationHost(Util.getAddr(inMessage.getCiaddr())); } else if (zeroP(inMessage.getGiaddr()) && zeroP(inMessage.getCiaddr())) { outMessage.setFlags((short) 1); outMessage.setDestinationHost("255.255.255.255"); }




Aaargh! Eu vou me dar férias, eu prometo!

Sorry, comments for this entry are closed at this time.