/* Reverse Digipeat List. May not pass both parameters as same struct  */
void ax25_digi_invert(const ax25_digi *in, ax25_digi *out)
/* Reverse Digipeat List. May not pass both parameters as same struct  */
void ax25_digi_invert(const ax25_digi *in, ax25_digi *out)
{
	int ct;
	out->ndigi      = in->ndigi;
	out->lastrepeat = in->ndigi - in->lastrepeat - 2;
	for (ct = 0; ct < in->ndigi; ct++) {
		out->calls[ct] = in->calls[in->ndigi - ct - 1];
		if (ct <= out->lastrepeat) {
			out->calls[ct].ax25_call[6] |= AX25_HBIT;
			out->repeated[ct]            = 1;
		} else {
			out->calls[ct].ax25_call[6] &= ~AX25_HBIT;
			out->repeated[ct]            = 0;
		}
	}
}