Lines Matching defs:packet

83      * The maximum length of a packet that can be constructed.
207 * Asks the packet object to signal the next operation in the DHCP
214 * Asks the packet object to create a ByteBuffer serialization of
215 * the packet for transmission.
221 * Allows the concrete class to fill in packet-type-specific details,
222 * typically optional parameters at the end of the packet.
246 * Creates a new L3 packet (including IP header) containing the
247 * DHCP udp packet. This method relies upon the delegated method
248 * finishPacket() to insert the per-packet contents.
265 // if a full IP packet needs to be generated, put the IP & UDP
326 // If an IP packet is being built, the IP & UDP checksums must be
521 private static InetAddress readIpAddress(ByteBuffer packet) {
524 packet.get(ipAddr);
555 public static DhcpPacket decodeFullPacket(ByteBuffer packet, int pktType)
582 packet.order(ByteOrder.BIG_ENDIAN);
586 // System.out.println("buffer len " + packet.limit());
590 packet.get(l2dst);
591 packet.get(l2src);
593 short l2type = packet.getShort();
601 byte ipType = packet.get();
603 byte ipDiffServicesField = packet.get();
604 short ipTotalLength = packet.getShort();
605 short ipIdentification = packet.getShort();
606 byte ipFlags = packet.get();
607 byte ipFragOffset = packet.get();
608 byte ipTTL = packet.get();
609 byte ipProto = packet.get();
610 short ipChksm = packet.getShort();
612 ipSrc = readIpAddress(packet);
613 ipDst = readIpAddress(packet);
619 short udpSrcPort = packet.getShort();
620 short udpDstPort = packet.getShort();
621 short udpLen = packet.getShort();
622 short udpChkSum = packet.getShort();
629 byte type = packet.get();
630 byte hwType = packet.get();
631 byte addrLen = packet.get();
632 byte hops = packet.get();
633 transactionId = packet.getInt();
634 short elapsed = packet.getShort();
635 short bootpFlags = packet.getShort();
640 packet.get(ipv4addr);
642 packet.get(ipv4addr);
644 packet.get(ipv4addr);
646 packet.get(ipv4addr);
653 packet.get(clientMac);
656 packet.position(packet.position() + (16 - addrLen)
660 int dhcpMagicCookie = packet.getInt();
668 while ((packet.position() < packet.limit()) && notFinishedOptions) {
669 byte optionType = packet.get();
674 byte optionLen = packet.get();
679 netMask = readIpAddress(packet);
683 gateway = readIpAddress(packet);
691 dnsServers.add(readIpAddress(packet));
696 hostName = readAsciiString(packet, optionLen);
700 domainName = readAsciiString(packet, optionLen);
703 bcAddr = readIpAddress(packet);
707 requestedIp = readIpAddress(packet);
711 leaseTime = Integer.valueOf(packet.getInt());
715 dhcpType = packet.get();
719 serverIdentifier = readIpAddress(packet);
724 packet.get(expectedParams);
729 message = readAsciiString(packet, optionLen);
733 vendorId = readAsciiString(packet, optionLen);
737 packet.get(id);
744 byte throwaway = packet.get();
809 * Parse a packet from an array of bytes.
811 public static DhcpPacket decodeFullPacket(byte[] packet, int pktType)
813 ByteBuffer buffer = ByteBuffer.wrap(packet).order(ByteOrder.BIG_ENDIAN);
818 * Builds a DHCP-DISCOVER packet from the required specified
830 * Builds a DHCP-OFFER packet from the required specified
851 * Builds a DHCP-ACK packet from the required specified parameters.
871 * Builds a DHCP-NAK packet from the required specified parameters.
883 * Builds a DHCP-REQUEST packet from the required specified parameters.