code: @Override
      public MACPacket frame(final PCapPacket parent, final Buffer buffer) throws IOException, FramingException {
          if (parent == null) {
              throw new IllegalArgumentException("The parent frame cannot be null");
          }
  
          // final Buffer destMacAddress = buffer.readBytes(6);
          // final Buffer srcMacAddress = buffer.readBytes(6);
          // final byte b1 = buffer.readByte();
          // final byte b2 = buffer.readByte();
  
          if (buffer.getReadableBytes() < 14) {
              throw new FramingException("not enough bytes for header", getProtocol());
          }
          Buffer headers;
          try {
              EtherType etherType = getEtherType(buffer.getByte(12), buffer.getByte(13));
              if (etherType == EtherType.Dot1Q) {
                  getEtherType(buffer.getByte(16), buffer.getByte(17));
                  headers = buffer.readBytes(18);
              } else {
                  headers = buffer.readBytes(14);
              }
          } catch (IndexOutOfBoundsException e) {
              throw new FramingException("not enough bytes for header", getProtocol());
          } catch (final UnknownEtherType e) {
              throw new FramingException(String.format("unknown ether type: 0x%02x%02x", e.getB1(), e.getB2()), getProtocol());
          }
  
          final Buffer payload = buffer.slice(buffer.capacity());
          return new MACPacketImpl(Protocol.ETHERNET_II, parent, headers, payload);
      }
docs: {@inheritDoc}