Lines Matching +full:1 +full:- +full:6

1 // SPDX-License-Identifier: GPL-2.0-or-later
27 * The default broadcast address of an interface is QST-0; the default address
28 * is LINUX-1. The null address is defined as a callsign of all spaces with
33 {{'Q' << 1, 'S' << 1, 'T' << 1, ' ' << 1, ' ' << 1, ' ' << 1, 0 << 1}};
35 {{'L' << 1, 'I' << 1, 'N' << 1, 'U' << 1, 'X' << 1, ' ' << 1, 1 << 1}};
37 {{' ' << 1, ' ' << 1, ' ' << 1, ' ' << 1, ' ' << 1, ' ' << 1, 0 << 1}};
44 * ax25 -> ascii conversion
51 for (n = 0, s = buf; n < 6; n++) { in ax2asc()
52 c = (a->ax25_call[n] >> 1) & 0x7F; in ax2asc()
57 *s++ = '-'; in ax2asc()
59 if ((n = ((a->ax25_call[6] >> 1) & 0x0F)) > 9) { in ax2asc()
60 *s++ = '1'; in ax2asc()
61 n -= 10; in ax2asc()
67 if (*buf == '\0' || *buf == '-') in ax2asc()
77 * ascii -> ax25 conversion
84 for (s = callsign, n = 0; n < 6; n++) { in asc2ax()
85 if (*s != '\0' && *s != '-') in asc2ax()
86 addr->ax25_call[n] = *s++; in asc2ax()
88 addr->ax25_call[n] = ' '; in asc2ax()
89 addr->ax25_call[n] <<= 1; in asc2ax()
90 addr->ax25_call[n] &= 0xFE; in asc2ax()
94 addr->ax25_call[6] = 0x00; in asc2ax()
98 addr->ax25_call[6] = *s++ - '0'; in asc2ax()
101 addr->ax25_call[6] *= 10; in asc2ax()
102 addr->ax25_call[6] += *s++ - '0'; in asc2ax()
105 addr->ax25_call[6] <<= 1; in asc2ax()
106 addr->ax25_call[6] &= 0x1E; in asc2ax()
118 while (ct < 6) { in ax25cmp()
119 if ((a->ax25_call[ct] & 0xFE) != (b->ax25_call[ct] & 0xFE)) /* Clean off repeater bits */ in ax25cmp()
120 return 1; in ax25cmp()
124 if ((a->ax25_call[ct] & 0x1E) == (b->ax25_call[ct] & 0x1E)) /* SSID without control bit */ in ax25cmp()
139 if (digi1->ndigi != digi2->ndigi) in ax25digicmp()
140 return 1; in ax25digicmp()
142 if (digi1->lastrepeat != digi2->lastrepeat) in ax25digicmp()
143 return 1; in ax25digicmp()
145 for (i = 0; i < digi1->ndigi; i++) in ax25digicmp()
146 if (ax25cmp(&digi1->calls[i], &digi2->calls[i]) != 0) in ax25digicmp()
147 return 1; in ax25digicmp()
167 if (buf[6] & AX25_CBIT) in ax25_addr_parse()
183 len -= 2 * AX25_ADDR_LEN; in ax25_addr_parse()
185 digi->lastrepeat = -1; in ax25_addr_parse()
186 digi->ndigi = 0; in ax25_addr_parse()
188 while (!(buf[-1] & AX25_EBIT)) { in ax25_addr_parse()
194 memcpy(&digi->calls[d], buf, AX25_ADDR_LEN); in ax25_addr_parse()
195 digi->ndigi = d + 1; in ax25_addr_parse()
197 if (buf[6] & AX25_HBIT) { in ax25_addr_parse()
198 digi->repeated[d] = 1; in ax25_addr_parse()
199 digi->lastrepeat = d; in ax25_addr_parse()
201 digi->repeated[d] = 0; in ax25_addr_parse()
205 len -= AX25_ADDR_LEN; in ax25_addr_parse()
222 buf[6] &= ~(AX25_EBIT | AX25_CBIT); in ax25_addr_build()
223 buf[6] |= AX25_SSSID_SPARE; in ax25_addr_build()
225 if (flag == AX25_COMMAND) buf[6] |= AX25_CBIT; in ax25_addr_build()
231 buf[6] &= ~(AX25_EBIT | AX25_CBIT); in ax25_addr_build()
232 buf[6] &= ~AX25_SSSID_SPARE; in ax25_addr_build()
235 buf[6] |= AX25_SSSID_SPARE; in ax25_addr_build()
237 buf[6] |= AX25_ESSID_SPARE; in ax25_addr_build()
239 if (flag == AX25_RESPONSE) buf[6] |= AX25_CBIT; in ax25_addr_build()
244 if (d == NULL || d->ndigi == 0) { in ax25_addr_build()
245 buf[6] |= AX25_EBIT; in ax25_addr_build()
252 while (ct < d->ndigi) { in ax25_addr_build()
253 memcpy(buf, &d->calls[ct], AX25_ADDR_LEN); in ax25_addr_build()
255 if (d->repeated[ct]) in ax25_addr_build()
256 buf[6] |= AX25_HBIT; in ax25_addr_build()
258 buf[6] &= ~AX25_HBIT; in ax25_addr_build()
260 buf[6] &= ~AX25_EBIT; in ax25_addr_build()
261 buf[6] |= AX25_SSSID_SPARE; in ax25_addr_build()
268 buf[-1] |= AX25_EBIT; in ax25_addr_build()
278 return AX25_ADDR_LEN * (2 + dp->ndigi); in ax25_addr_size()
288 out->ndigi = in->ndigi; in ax25_digi_invert()
289 out->lastrepeat = in->ndigi - in->lastrepeat - 2; in ax25_digi_invert()
292 for (ct = 0; ct < in->ndigi; ct++) { in ax25_digi_invert()
293 out->calls[ct] = in->calls[in->ndigi - ct - 1]; in ax25_digi_invert()
295 if (ct <= out->lastrepeat) { in ax25_digi_invert()
296 out->calls[ct].ax25_call[6] |= AX25_HBIT; in ax25_digi_invert()
297 out->repeated[ct] = 1; in ax25_digi_invert()
299 out->calls[ct].ax25_call[6] &= ~AX25_HBIT; in ax25_digi_invert()
300 out->repeated[ct] = 0; in ax25_digi_invert()