'Get the "effective" ethertype of a packet.
This means that if the payload is something like a VLAN or SNAP header,
we want the type from that deeper header.  This is kind of ugly here in
the packet library, but it should make user code somewhat simpler.'

@staticmethod
def _get_effective_ethertype(self):

    if (not self.parsed):
        return ethernet.INVALID_TYPE
    if ((self.type == ethernet.VLAN_TYPE) or (type(self.payload) == ethernet._llc)):
        try:
            return self.payload.effective_ethertype
        except:
            return ethernet.INVALID_TYPE
    return self.type
