MDL-48766 moodlelib: introduce ip_is_public()