'Gets source IPv4 address for packets that have one (IPv4 and ARP)
Returns (ip_address, has_arp).  If no IP, returns (None, False).'

def getSrcIPandARP(self, packet):

    if isinstance(packet, ipv4):
        log.debug('IP    %s    =>    %s', str(packet.srcip), str(packet.dstip))
        return (packet.srcip, False)
    elif isinstance(packet, arp):
        log.debug('ARP    %s    %s    =>    %s', {arp.REQUEST: 'request', arp.REPLY: 'reply'}.get(packet.opcode, ('op:%i' % (packet.opcode,))), str(packet.protosrc), str(packet.protodst))
        if ((packet.hwtype == arp.HW_TYPE_ETHERNET) and (packet.prototype == arp.PROTO_TYPE_IP) and (packet.protosrc != 0)):
            return (packet.protosrc, True)
    return (None, False)
