ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I assumed that the error was due to the difference between the 1st argument and 2nd argument, However, changing the difference to the accepted dns message size (512 bytes) or even to no difference at all did nothing to remove the error.
Further, I am trying to check the output after having first compressed a domain name using dn_comp into *out_rr. This function call is in order to check whether the compression is happening correctly.
I assumed that the error was due to the difference between the 1st argument and 2nd argument, However, changing the difference to the accepted dns message size (512 bytes) or even to no difference at all did nothing to remove the error.
Further, I am trying to check the output after having first compressed a domain name using dn_comp into *out_rr. This function call is in order to check whether the compression is happening correctly.
Any ideas on what I might be doing wrong ?
And why haven't you looked yet into the function source ?
And why haven't you looked yet into the function source ?
I have looked into the function source and I could not figure out anything from that as there are too many flags that I do not understand. Moreover, the source was pretty difficult to find so that when I did find the code I wasn't sure whether it was for the actual function that I am using or the source code for some other version of the function.
PS: I don't know whether you realize it or not but your response is ---- 1. Rude, 2. Not helpful at all. Thanks a lot anyways.
I have looked into the function source and I could not figure out anything from that as there are too many flags that I do not understand. Moreover, the source was pretty difficult to find so that when I did find the code I wasn't sure whether it was for the actual function that I am using or the source code for some other version of the function.
PS: I don't know whether you realize it or not but your response is ---- 1. Rude, 2. Not helpful at all. Thanks a lot anyways.
So, now copy the source into your program, changing the function name, and adding 'printf' statements, so you'll be able to trace which statements are executed and why you are getting the error message.
The above is trivial.
The source apparently is in 'glibc' - at least, this is where I find it.
The sources:
Code:
int
dn_expand(const u_char *msg, const u_char *eom, const u_char *src,
char *dst, int dstsiz)
{
int n = ns_name_uncompress(msg, eom, src, dst, (size_t)dstsiz);
if (n > 0 && dst[0] == '.')
dst[0] = '\0';
return (n);
}
About my response - do you realize you are plain lazy and want others to do your job ?
1. By not asking for help again after replying to you, I think it was very clear that the thread was "CLOSED" at least for "you".
2. I have completed my work - ALL ON MY OWN.
3. When I posted the thread, all I wanted to know was whether anyone had any idea about dn_expand(). I wasn't expecting anyone to do my work for me. If you have such trouble replying, just don't bother to.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.