anchor.diff:        Other
     end.
   
  -
  --spec(handle_get_route(Addr :: inet:ip4_address(), Socket :: gen_socket:socket()) ->
  +-spec(maybe_update_cache(Timestamp :: integer(), Address :: inet:ip4_address(), TableID :: ets:tid(),
  +  {ok, Route :: route()} | {error, Reason :: term()}) -> {ok, Route :: route()} | {error, Reason :: term()}).
  +maybe_update_cache(Timestamp, Address, TableId, {ok, Route}) ->
  +  Route1 = [{route_cache_timestamp, Timestamp}|Route],
  +  ets:insert(TableId, #route_cache{addr = Address, timestamp = Timestamp, route = Route1}),
  +  {ok, Route1};
  +maybe_update_cache(_, _, _, Else) -> Else.
  +
  +
  +-spec(handle_get_route(Addr :: inet:ip4_address(), Socket :: gen_socket:socket(), TableID :: ets:tid()) ->
     {ok, Route :: route} | {error, Reason :: term()}).
  -handle_get_route(Addr, Socket) when is_tuple(Addr) ->
  +handle_get_route(Addr, Socket, TableID) ->
  +  Now = erlang:monotonic_time(seconds),
  +  case ets:lookup(TableID, Addr) of
  +    [#route_cache{timestamp = Timestamp, route = Route}] when (Now - Timestamp) < ?ROUTE_CACHE_TIME_SECONDS ->
  +      {ok, Route};
  +    _ ->
  +      Route = handle_get_route_real(Addr, Socket),
  +      maybe_update_cache(Now, Addr, TableID, Route)
  +  end.
  +
  +
  +-spec(handle_get_route_real(Addr :: inet:ip4_address(), Socket :: gen_socket:socket()) ->
  +  {ok, Route :: route()} | {error, Reason :: term()}).
  +handle_get_route_real(Addr, Socket) when is_tuple(Addr) ->
     Seq = erlang:time_offset() + erlang:monotonic_time(),
     Req = [{dst, Addr}],
     Family = inet,
  
positive.code: -include_lib("gen_socket/include/gen_socket.hrl").
  -include_lib("gen_netlink/include/netlink.hrl").
  -define(SERVER, ?MODULE).
  
  -record(state, {socket = erlang:error() :: gen_socket:socket()}).
  %% TODO: define a route,
  %% They look roughly like:
  %[{dst,{8,8,8,8}},
  
negative.code:   {gen_socket, RealPort, _, _, _, _} = Socket,
    erlang:link(RealPort),
    ok = gen_socket:bind(Socket, netlink:sockaddr_nl(netlink, 0, 0)),
    {ok, #state{socket = Socket, table_id = TableID}}.
  
  %%--------------------------------------------------------------------
  %% @private
  