'Update IP stats using the input method.
Stats is dict'

@GlancesPlugin._check_decorator
@GlancesPlugin._log_result_decorator
def update(self):

    self.reset()
    if ((self.input_method == 'local') and netifaces_tag):
        try:
            default_gw = netifaces.gateways()['default'][netifaces.AF_INET]
        except (KeyError, AttributeError) as e:
            logger.debug('Cannot    grab    the    default    gateway    ({})'.format(e))
        else:
            try:
                self.stats['address'] = netifaces.ifaddresses(default_gw[1])[netifaces.AF_INET][0]['addr']
                self.stats['mask'] = netifaces.ifaddresses(default_gw[1])[netifaces.AF_INET][0]['netmask']
                self.stats['mask_cidr'] = self.ip_to_cidr(self.stats['mask'])
                self.stats['gateway'] = netifaces.gateways()['default'][netifaces.AF_INET][0]
                self.stats['public_address'] = self.public_address
            except (KeyError, AttributeError) as e:
                logger.debug('Cannot    grab    IP    information:    {}'.format(e))
    elif (self.input_method == 'snmp'):
        pass
    return self.stats
