diff options
Diffstat (limited to 'net/ax25/ax25_addr.c')
-rw-r--r-- | net/ax25/ax25_addr.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/net/ax25/ax25_addr.c b/net/ax25/ax25_addr.c index 5f0896ad0042..97a49c79c605 100644 --- a/net/ax25/ax25_addr.c +++ b/net/ax25/ax25_addr.c | |||
@@ -29,17 +29,26 @@ | |||
29 | #include <linux/interrupt.h> | 29 | #include <linux/interrupt.h> |
30 | 30 | ||
31 | /* | 31 | /* |
32 | * The null address is defined as a callsign of all spaces with an | 32 | * The default broadcast address of an interface is QST-0; the default address |
33 | * SSID of zero. | 33 | * is LINUX-1. The null address is defined as a callsign of all spaces with |
34 | * an SSID of zero. | ||
34 | */ | 35 | */ |
35 | ax25_address null_ax25_address = {{0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00}}; | ||
36 | 36 | ||
37 | const ax25_address ax25_bcast = | ||
38 | {{'Q' << 1, 'S' << 1, 'T' << 1, ' ' << 1, ' ' << 1, ' ' << 1, 0 << 1}}; | ||
39 | const ax25_address ax25_defaddr = | ||
40 | {{'L' << 1, 'I' << 1, 'N' << 1, 'U' << 1, 'X' << 1, ' ' << 1, 1 << 1}}; | ||
41 | const ax25_address null_ax25_address = | ||
42 | {{' ' << 1, ' ' << 1, ' ' << 1, ' ' << 1, ' ' << 1, ' ' << 1, 0 << 1}}; | ||
43 | |||
44 | EXPORT_SYMBOL_GPL(ax25_bcast); | ||
45 | EXPORT_SYMBOL_GPL(ax25_defaddr); | ||
37 | EXPORT_SYMBOL(null_ax25_address); | 46 | EXPORT_SYMBOL(null_ax25_address); |
38 | 47 | ||
39 | /* | 48 | /* |
40 | * ax25 -> ascii conversion | 49 | * ax25 -> ascii conversion |
41 | */ | 50 | */ |
42 | char *ax2asc(char *buf, ax25_address *a) | 51 | char *ax2asc(char *buf, const ax25_address *a) |
43 | { | 52 | { |
44 | char c, *s; | 53 | char c, *s; |
45 | int n; | 54 | int n; |
@@ -72,9 +81,9 @@ EXPORT_SYMBOL(ax2asc); | |||
72 | /* | 81 | /* |
73 | * ascii -> ax25 conversion | 82 | * ascii -> ax25 conversion |
74 | */ | 83 | */ |
75 | void asc2ax(ax25_address *addr, char *callsign) | 84 | void asc2ax(ax25_address *addr, const char *callsign) |
76 | { | 85 | { |
77 | char *s; | 86 | const char *s; |
78 | int n; | 87 | int n; |
79 | 88 | ||
80 | for (s = callsign, n = 0; n < 6; n++) { | 89 | for (s = callsign, n = 0; n < 6; n++) { |
@@ -107,7 +116,7 @@ EXPORT_SYMBOL(asc2ax); | |||
107 | /* | 116 | /* |
108 | * Compare two ax.25 addresses | 117 | * Compare two ax.25 addresses |
109 | */ | 118 | */ |
110 | int ax25cmp(ax25_address *a, ax25_address *b) | 119 | int ax25cmp(const ax25_address *a, const ax25_address *b) |
111 | { | 120 | { |
112 | int ct = 0; | 121 | int ct = 0; |
113 | 122 | ||
@@ -128,7 +137,7 @@ EXPORT_SYMBOL(ax25cmp); | |||
128 | /* | 137 | /* |
129 | * Compare two AX.25 digipeater paths. | 138 | * Compare two AX.25 digipeater paths. |
130 | */ | 139 | */ |
131 | int ax25digicmp(ax25_digi *digi1, ax25_digi *digi2) | 140 | int ax25digicmp(const ax25_digi *digi1, const ax25_digi *digi2) |
132 | { | 141 | { |
133 | int i; | 142 | int i; |
134 | 143 | ||
@@ -149,7 +158,9 @@ int ax25digicmp(ax25_digi *digi1, ax25_digi *digi2) | |||
149 | * Given an AX.25 address pull of to, from, digi list, command/response and the start of data | 158 | * Given an AX.25 address pull of to, from, digi list, command/response and the start of data |
150 | * | 159 | * |
151 | */ | 160 | */ |
152 | unsigned char *ax25_addr_parse(unsigned char *buf, int len, ax25_address *src, ax25_address *dest, ax25_digi *digi, int *flags, int *dama) | 161 | const unsigned char *ax25_addr_parse(const unsigned char *buf, int len, |
162 | ax25_address *src, ax25_address *dest, ax25_digi *digi, int *flags, | ||
163 | int *dama) | ||
153 | { | 164 | { |
154 | int d = 0; | 165 | int d = 0; |
155 | 166 | ||
@@ -204,7 +215,8 @@ unsigned char *ax25_addr_parse(unsigned char *buf, int len, ax25_address *src, a | |||
204 | /* | 215 | /* |
205 | * Assemble an AX.25 header from the bits | 216 | * Assemble an AX.25 header from the bits |
206 | */ | 217 | */ |
207 | int ax25_addr_build(unsigned char *buf, ax25_address *src, ax25_address *dest, ax25_digi *d, int flag, int modulus) | 218 | int ax25_addr_build(unsigned char *buf, const ax25_address *src, |
219 | const ax25_address *dest, const ax25_digi *d, int flag, int modulus) | ||
208 | { | 220 | { |
209 | int len = 0; | 221 | int len = 0; |
210 | int ct = 0; | 222 | int ct = 0; |
@@ -261,7 +273,7 @@ int ax25_addr_build(unsigned char *buf, ax25_address *src, ax25_address *dest, a | |||
261 | return len; | 273 | return len; |
262 | } | 274 | } |
263 | 275 | ||
264 | int ax25_addr_size(ax25_digi *dp) | 276 | int ax25_addr_size(const ax25_digi *dp) |
265 | { | 277 | { |
266 | if (dp == NULL) | 278 | if (dp == NULL) |
267 | return 2 * AX25_ADDR_LEN; | 279 | return 2 * AX25_ADDR_LEN; |
@@ -272,7 +284,7 @@ int ax25_addr_size(ax25_digi *dp) | |||
272 | /* | 284 | /* |
273 | * Reverse Digipeat List. May not pass both parameters as same struct | 285 | * Reverse Digipeat List. May not pass both parameters as same struct |
274 | */ | 286 | */ |
275 | void ax25_digi_invert(ax25_digi *in, ax25_digi *out) | 287 | void ax25_digi_invert(const ax25_digi *in, ax25_digi *out) |
276 | { | 288 | { |
277 | int ct; | 289 | int ct; |
278 | 290 | ||