def getall(self):
        """Return all ip routes configured on the switch as a resource dict

        Returns:
            dict: An dict object of static route entries in the form::

                { ip_dest:
                    { next_hop:
                        { next_hop_ip:
                            { distance:
                                { 'tag': tag,
                                  'route_name': route_name
                                }
                            }
                        }
                    }
                }

            If the ip address specified does not have any associated
            static routes, then None is returned.

        Notes:
            The keys ip_dest, next_hop, next_hop_ip, and distance in
            the returned dictionary are the values of those components
            of the ip route specification. If a route does not contain
            a next_hop_ip, then that key value will be set as 'None'.
        """

        # Find all the ip routes in the config
        matches = ROUTES_RE.findall(self.config)

        # Parse the routes and add them to the routes dict
        routes = dict()
        for match in matches:

            # Get the four identifying components
            ip_dest = match[0]
            next_hop = match[1]
            next_hop_ip = None if match[2] is '' else match[2]
            distance = int(match[3])

            # Create the data dict with the remaining components
            data = {}
            data['tag'] = None if match[4] is '' else int(match[4])
            data['route_name'] = None if match[5] is '' else match[5]

            # Build the complete dict entry from the four components
            # and the data.
            # temp_dict = parent_dict[key] = parent_dict.get(key, {})
            # This creates the keyed dict in the parent_dict if it doesn't
            # exist, or reuses the existing keyed dict.
            # The temp_dict is used to make things more readable.
            ip_dict = routes[ip_dest] = routes.get(ip_dest, {})
            nh_dict = ip_dict[next_hop] = ip_dict.get(next_hop, {})
            nhip_dict = nh_dict[next_hop_ip] = nh_dict.get(next_hop_ip, {})
            nhip_dict[distance] = data

        return routes
Return all ip routes configured on the switch as a resource dict

        Returns:
            dict: An dict object of static route entries in the form::

                { ip_dest:
                    { next_hop:
                        { next_hop_ip:
                            { distance:
                                { 'tag': tag,
                                  'route_name': route_name
                                }
                            }
                        }
                    }
                }

            If the ip address specified does not have any associated
            static routes, then None is returned.

        Notes:
            The keys ip_dest, next_hop, next_hop_ip, and distance in
            the returned dictionary are the values of those components
            of the ip route specification. If a route does not contain
            a next_hop_ip, then that key value will be set as 'None'.