user: implement some more user functions

I am interested in the "getlogin" symbol, but for completeness I am implementing
the whole family.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
user: implement getgrgid

We have currently the reentrant version implemented, but we are missing
the non-reentrant symbol

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Remove the Route gathering logic outside of lsroute

The route gathering logic in lsroute can be used by other modules,
specifically the API.

This hides the logic details with a foreach function that iterate over
the routes.

The foreach_route function iterate over the routes and call a lambda
expression function with the current route details.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>