aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2006-12-07 18:43:13 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-08 20:19:25 -0500
commite8cc49bb0fdb9e18a99e6780073d1400ba2b0d1f (patch)
treef60c38413d47ae0d793673a85578c6b82088aa97
parent6c1bbcc8836358294c431e0c09e85e3480895659 (diff)
[AX.25]: Constify ax25 utility functions
Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/ax25.h18
-rw-r--r--net/ax25/ax25_addr.c19
2 files changed, 21 insertions, 16 deletions
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 69374cd1a857..41acb093caae 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -283,14 +283,16 @@ extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *);
283 283
284/* ax25_addr.c */ 284/* ax25_addr.c */
285extern ax25_address null_ax25_address; 285extern ax25_address null_ax25_address;
286extern char *ax2asc(char *buf, ax25_address *); 286extern char *ax2asc(char *buf, const ax25_address *);
287extern void asc2ax(ax25_address *addr, char *callsign); 287extern void asc2ax(ax25_address *addr, const char *callsign);
288extern int ax25cmp(ax25_address *, ax25_address *); 288extern int ax25cmp(const ax25_address *, const ax25_address *);
289extern int ax25digicmp(ax25_digi *, ax25_digi *); 289extern int ax25digicmp(const ax25_digi *, const ax25_digi *);
290extern unsigned char *ax25_addr_parse(unsigned char *, int, ax25_address *, ax25_address *, ax25_digi *, int *, int *); 290extern const unsigned char *ax25_addr_parse(const unsigned char *, int,
291extern int ax25_addr_build(unsigned char *, ax25_address *, ax25_address *, ax25_digi *, int, int); 291 ax25_address *, ax25_address *, ax25_digi *, int *, int *);
292extern int ax25_addr_size(ax25_digi *); 292extern int ax25_addr_build(unsigned char *, const ax25_address *,
293extern void ax25_digi_invert(ax25_digi *, ax25_digi *); 293 const ax25_address *, const ax25_digi *, int, int);
294extern int ax25_addr_size(const ax25_digi *);
295extern void ax25_digi_invert(const ax25_digi *, ax25_digi *);
294 296
295/* ax25_dev.c */ 297/* ax25_dev.c */
296extern ax25_dev *ax25_dev_list; 298extern ax25_dev *ax25_dev_list;
diff --git a/net/ax25/ax25_addr.c b/net/ax25/ax25_addr.c
index 5f0896ad0042..5524f9cb7b83 100644
--- a/net/ax25/ax25_addr.c
+++ b/net/ax25/ax25_addr.c
@@ -39,7 +39,7 @@ EXPORT_SYMBOL(null_ax25_address);
39/* 39/*
40 * ax25 -> ascii conversion 40 * ax25 -> ascii conversion
41 */ 41 */
42char *ax2asc(char *buf, ax25_address *a) 42char *ax2asc(char *buf, const ax25_address *a)
43{ 43{
44 char c, *s; 44 char c, *s;
45 int n; 45 int n;
@@ -72,7 +72,7 @@ EXPORT_SYMBOL(ax2asc);
72/* 72/*
73 * ascii -> ax25 conversion 73 * ascii -> ax25 conversion
74 */ 74 */
75void asc2ax(ax25_address *addr, char *callsign) 75void asc2ax(ax25_address *addr, const char *callsign)
76{ 76{
77 char *s; 77 char *s;
78 int n; 78 int n;
@@ -107,7 +107,7 @@ EXPORT_SYMBOL(asc2ax);
107/* 107/*
108 * Compare two ax.25 addresses 108 * Compare two ax.25 addresses
109 */ 109 */
110int ax25cmp(ax25_address *a, ax25_address *b) 110int ax25cmp(const ax25_address *a, const ax25_address *b)
111{ 111{
112 int ct = 0; 112 int ct = 0;
113 113
@@ -128,7 +128,7 @@ EXPORT_SYMBOL(ax25cmp);
128/* 128/*
129 * Compare two AX.25 digipeater paths. 129 * Compare two AX.25 digipeater paths.
130 */ 130 */
131int ax25digicmp(ax25_digi *digi1, ax25_digi *digi2) 131int ax25digicmp(const ax25_digi *digi1, const ax25_digi *digi2)
132{ 132{
133 int i; 133 int i;
134 134
@@ -149,7 +149,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 149 * Given an AX.25 address pull of to, from, digi list, command/response and the start of data
150 * 150 *
151 */ 151 */
152unsigned char *ax25_addr_parse(unsigned char *buf, int len, ax25_address *src, ax25_address *dest, ax25_digi *digi, int *flags, int *dama) 152const unsigned char *ax25_addr_parse(const unsigned char *buf, int len,
153 ax25_address *src, ax25_address *dest, ax25_digi *digi, int *flags,
154 int *dama)
153{ 155{
154 int d = 0; 156 int d = 0;
155 157
@@ -204,7 +206,8 @@ unsigned char *ax25_addr_parse(unsigned char *buf, int len, ax25_address *src, a
204/* 206/*
205 * Assemble an AX.25 header from the bits 207 * Assemble an AX.25 header from the bits
206 */ 208 */
207int ax25_addr_build(unsigned char *buf, ax25_address *src, ax25_address *dest, ax25_digi *d, int flag, int modulus) 209int ax25_addr_build(unsigned char *buf, const ax25_address *src,
210 const ax25_address *dest, const ax25_digi *d, int flag, int modulus)
208{ 211{
209 int len = 0; 212 int len = 0;
210 int ct = 0; 213 int ct = 0;
@@ -261,7 +264,7 @@ int ax25_addr_build(unsigned char *buf, ax25_address *src, ax25_address *dest, a
261 return len; 264 return len;
262} 265}
263 266
264int ax25_addr_size(ax25_digi *dp) 267int ax25_addr_size(const ax25_digi *dp)
265{ 268{
266 if (dp == NULL) 269 if (dp == NULL)
267 return 2 * AX25_ADDR_LEN; 270 return 2 * AX25_ADDR_LEN;
@@ -272,7 +275,7 @@ int ax25_addr_size(ax25_digi *dp)
272/* 275/*
273 * Reverse Digipeat List. May not pass both parameters as same struct 276 * Reverse Digipeat List. May not pass both parameters as same struct
274 */ 277 */
275void ax25_digi_invert(ax25_digi *in, ax25_digi *out) 278void ax25_digi_invert(const ax25_digi *in, ax25_digi *out)
276{ 279{
277 int ct; 280 int ct;
278 281