~ubuntu-branches/ubuntu/utopic/babeld/utopic-proposed

« back to all changes in this revision

Viewing changes to local.c

  • Committer: Package Import Robot
  • Author(s): Stéphane Glondu
  • Date: 2011-12-08 20:49:12 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20111208204912-oiizndrm9va3aplf
Tags: 1.3.0-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include <errno.h>
28
28
 
29
29
#include "babeld.h"
30
 
#include "network.h"
 
30
#include "interface.h"
31
31
#include "source.h"
32
32
#include "neighbour.h"
33
33
#include "xroute.h"
140
140
                     address as a unique identifier. */
141
141
                  (unsigned long int)neigh,
142
142
                  format_address(neigh->address),
143
 
                  neigh->network->ifname,
 
143
                  neigh->ifp->name,
144
144
                  neigh->reach,
145
145
                  neighbour_rxcost(neigh),
146
146
                  neighbour_txcost(neigh),
207
207
                  format_eui64(route->src->id),
208
208
                  route_metric(route), route->refmetric,
209
209
                  format_address(route->neigh->address),
210
 
                  route->neigh->network->ifname);
 
210
                  route->neigh->ifp->name);
211
211
    
212
212
    if(rc < 0 || rc >= 512)
213
213
        goto fail;
222
222
    return;
223
223
}
224
224
 
 
225
static void
 
226
local_notify_xroute_callback(struct xroute *xroute, void *closure)
 
227
{
 
228
    local_notify_xroute(xroute, LOCAL_ADD);
 
229
}
 
230
 
 
231
static void
 
232
local_notify_route_callback(struct route *route, void *closure)
 
233
{
 
234
    local_notify_route(route, LOCAL_ADD);
 
235
}
 
236
 
225
237
void
226
 
local_dump()
 
238
local_notify_all()
227
239
{
228
 
    int i, rc;
 
240
    int rc;
229
241
    struct neighbour *neigh;
230
242
    const char *header = "BABEL 0.0\n";
231
243
 
240
252
    FOR_ALL_NEIGHBOURS(neigh) {
241
253
        local_notify_neighbour(neigh, LOCAL_ADD);
242
254
    }
243
 
    for(i = 0; i < numxroutes; i++)
244
 
        local_notify_xroute(&xroutes[i], LOCAL_ADD);
245
 
    for(i = 0; i < numroutes; i++)
246
 
        local_notify_route(&routes[i], LOCAL_ADD);
 
255
    for_all_xroutes(local_notify_xroute_callback, NULL);
 
256
    for_all_routes(local_notify_route_callback, NULL);
247
257
    return;
248
258
 
249
259
 fail: