* forced. Important thing about &f_val s is that they may be copied
* with simple =. That's fine for all currently defined types: strings
* are read-only (and therefore okay), paths are copied for each
- * operation (okay too). */
+ * operation (okay too).
+ */
#undef LOCAL_DEBUG
}
}
-/**
+/*
* val_compare - compare two values, returns -1, 0, 1 on <, =, > and 999 on error
*/
int
}
}
-/**
+/*
* val_simple_in_range - check if @v1 ~ @v2 for everything except sets
*/
int
return CMP_ERROR;
}
-/**
+/*
* val_in_range - check if @v1 ~ @v2
*/
int
debug( "] " );
}
-/**
+/*
* val_print - format filter value
*/
void
static int f_flags;
static rta *f_rta_copy;
-/**
+/*
* rta_cow - prepare rta for modification by filter
*/
void
* interpret
* @what: filter to interrpret
*
- * Interrpret given tree of filter instructions. This is core function
+ * Interpret given tree of filter instructions. This is core function
* of filter system and does all the hard work.
*/
static struct f_val
#define A2_SAME if (f1->a2.i != f2->a2.i) return 0;
-/**
+/*
* i_same - function that does real comparing of instruction trees, you should call filter_same from outside
*/
int
/**
* f_run - external entry point to filters
* @filter: pointer to filter to run
+ * @tmp_attrs: where to store newly generated temporary attributes
* @rte: pointer to pointer to rte being filtered. When route is modified, this is changed with rte_cow.
* @tmp_pool: all filter allocations go from this pool
+ * @flags: flags
*/
int
f_run(struct filter *filter, struct rte **rte, struct ea_list **tmp_attrs, struct linpool *tmp_pool, int flags)
*
* Rip is pretty simple protocol so half of this code is interface
* with core. We maintain our own linklist of &rip_entry - it serves
- * as our small routing table. Within rip_tx(), this list is
+ * as our small routing table. Rip never adds into this linklist at
+ * packet reception; instead, it lets core know about data from packet,
+ * and waits for core to call our rip_rte_notify.
+ *
+ * Within rip_tx(), this list is
* walked, and packet is generated using rip_tx_prepare(). This gets
* tricky because we may need to send more than one packet to one
* destination. Struct &rip_connection is used to hold info such as how
#define P_NAME p->name
-/**
+/*
* DOC: Output processing
*
* This part is responsible for getting packets out to the network.
log( L_ERR "%s: Unexpected error at rip transmit: %M", P_NAME, err );
}
-/**
+/*
* rip_tx_prepare:
* @e: rip entry that needs to be translated to form suitable for network
* @b: block to be filled
return pos+1;
}
-/**
+/*
* rip_tx - send one rip packet to the network
*/
static void
return;
}
-/**
+/*
* rip_sendto - send whole routing table to selected destination
* @rif: interface to use. Notice that we lock interface so that at
* most one send to one interface is done.
return NULL;
}
-/**
+/*
* DOC: Input processing
*
* This part is responsible for any updates that come from network
rte_update(tab, net, p, new);
}
-/**
+/*
* advertise_entry - let main routing table know about our new entry
* @b: entry in network format
*
* This basically translates @b to format used by bird core and feeds
- * bird core with this route. Notice that we do not store info anywhere
- * in our data structures: we'll do that when core notifies us back.
+ * bird core with this route.
*/
static void
advertise_entry( struct proto *p, struct rip_block *b, ip_addr whotoldme )
DBG( "done\n" );
}
-/**
+/*
* process_block - do some basic check and pass block to advertise_entry
*/
static void
#define BAD( x ) { log( L_REMOTE "%s: " x, P_NAME ); return 1; }
-/**
+/*
* rip_process_packet - this is main routine for incoming packets.
*/
static int
return 0;
}
-/**
+/*
* rip_rx - Receive hook: do basic checks and pass packet to rip_process_packet
*/
static int
return 1;
}
-/**
+/*
* DOC: Interface to bird core
*/
}
/**
- * rip_timer - broadcast routing tables periodically (using rip_tx) and kill routes that are too old
+ * rip_timer
+ * @t: timer
+ *
+ * Broadcast routing tables periodically (using rip_tx) and kill
+ * routes that are too old. Rip keeps its own entries in main routing
+ * table linked by link list (functions rip_rte_insert and
+ * rip_rte_delete are responsible for that), walks this list in timer
+ * and in case entry is too old, it is discarded.
*/
+
static void
rip_timer(timer *t)
{
DBG( "RIP: tick tock done\n" );
}
-/**
+/*
* rip_start - initialize instance of rip
*/
static int
}
/**
- * new_iface - actually create struct interface and start listening to it
+ * new_iface
+ * @p: myself
* @new: interface to be created or %NULL if we are creating magic
* socket. Magic socket is used for listening, and is also used for
* sending requested responses.
+ * @flags: interface flags
+ * @patt: pattern this interface matched, used for access to config options
+ *
+ * actually create struct interface and start listening to it
*/
static struct rip_interface *
new_iface(struct proto *p, struct iface *new, unsigned long flags, struct iface_patt *patt )
rt->u.rip.metric = ea_get_int(attrs, EA_RIP_METRIC, 1);
}
-/**
+/*
* rip_rt_notify - core tells us about new route (possibly our
* own), so store it into our data structures.
*/
return 0;
}
-/**
+/*
* rip_rte_insert - we maintain linked list of "our" entries in main
* routing table, so that we can timeout them correctly. rip_timer
* walks the list.
add_head( &P->garbage, &rte->u.rip.garbage );
}
-/**
+/*
* rip_rte_remove - link list maintenance
*/
static void