Expand '[src|dst] net <net>'
Refactorize expansion functions of several operators

Keywords 'ip', 'arp', 'rarp' and 'net' share some common code depending on
whether they are 'src' or 'dst' that can be refactored into a more general
parametrized function.
Implement expansion of 'net <net> mask <netmask>'