route_add(ip, call, udpport, flags)
void route_add(ip, call, udpport, flags)
route_add(ip, call, udpport, flags)unsigned char *ip;unsigned char *call;int udpport;unsigned int flags;{	struct route_table_entry *rl, *rn;	int i;	/* Check we have an IP address */	if (ip==NULL)		return;	/* Check we have a callsign */	if (call==NULL)		return;	/* Find the last entry in the list */	rl=route_tbl;	if (route_tbl)		while (rl->next)			rl=rl->next;	rn=(struct route_table_entry*)malloc(sizeof(struct route_table_entry));	/* Build this entry ... */	for (i=0; i<6; i++)		rn->callsign[i] = call[i] & 0xfe;	rn->callsign[6] = (call[6] & 0x1e) | 0x60;	rn->padcall = 0;	memcpy(rn->ip_addr, ip, 4);	rn->udp_port = htons(udpport);	rn->pad1 = 0;	rn->pad2 = 0;	rn->flags = flags;	rn->next=NULL;	/* Update the default_route pointer if this is a default route */	if (flags & AXRT_DEFAULT)		default_route=rn;	if (rl)	/* ... the list is already started add the new route */		rl->next=rn;	else	/* ... start the list off */		route_tbl=rn;	/* Log this entry ... */	LOGL4("added route: %s\t%s\t%s\t%d\t%d\n",			call_to_a(rn->callsign),			(char *)inet_ntoa(*(struct in_addr *)rn->ip_addr),			rn->udp_port ? "udp" : "ip",			ntohs(rn->udp_port), flags);	return;}