lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | .\" |
| 2 | .\" Copyright 1998 by the Massachusetts Institute of Technology. |
| 3 | .\" |
| 4 | .\" Permission to use, copy, modify, and distribute this |
| 5 | .\" software and its documentation for any purpose and without |
| 6 | .\" fee is hereby granted, provided that the above copyright |
| 7 | .\" notice appear in all copies and that both that copyright |
| 8 | .\" notice and this permission notice appear in supporting |
| 9 | .\" documentation, and that the name of M.I.T. not be used in |
| 10 | .\" advertising or publicity pertaining to distribution of the |
| 11 | .\" software without specific, written prior permission. |
| 12 | .\" M.I.T. makes no representations about the suitability of |
| 13 | .\" this software for any purpose. It is provided "as is" |
| 14 | .\" without express or implied warranty. |
| 15 | .\" |
| 16 | .TH ARES_EXPAND_NAME 3 "20 Nov 2009" |
| 17 | .SH NAME |
| 18 | ares_expand_string \- Expand a length encoded string |
| 19 | .SH SYNOPSIS |
| 20 | .nf |
| 21 | .B #include <ares.h> |
| 22 | .PP |
| 23 | .B int ares_expand_string(const unsigned char *\fIencoded\fP, |
| 24 | .B const unsigned char *\fIabuf\fP, int \fIalen\fP, unsigned char **\fIs\fP, |
| 25 | .B long *\fIenclen\fP) |
| 26 | .fi |
| 27 | .SH DESCRIPTION |
| 28 | The |
| 29 | .B ares_expand_string |
| 30 | function converts a length encoded string to a NUL-terminated C |
| 31 | string. The argument |
| 32 | .I encoded |
| 33 | gives the beginning of the encoded string, and the arguments |
| 34 | .I abuf |
| 35 | and |
| 36 | .I alen |
| 37 | give the containing message buffer (necessary for the processing of |
| 38 | indirection pointers within the encoded domain name). The result is |
| 39 | placed in a NUL-terminated allocated buffer, a pointer to which is |
| 40 | stored in the variable pointed to by |
| 41 | .IR s . |
| 42 | The length of the encoded string is stored in the variable pointed to by |
| 43 | .I enclen |
| 44 | so that the caller can advance past the encoded string to read |
| 45 | further data in the message. |
| 46 | .SH RETURN VALUES |
| 47 | .B ares_expand_string |
| 48 | can return any of the following values: |
| 49 | .TP 15 |
| 50 | .B ARES_SUCCESS |
| 51 | Expansion of the encoded string succeeded. |
| 52 | .TP 15 |
| 53 | .B ARES_EBADSTR |
| 54 | The encoded string was malformed and could not be expanded. |
| 55 | .TP 15 |
| 56 | .B ARES_ENOMEM |
| 57 | Memory was exhausted. |
| 58 | .SH SEE ALSO |
| 59 | .BR ares_free_string (3) |
| 60 | .SH AUTHOR |
| 61 | Dominick Meglio |