Sponsored Content
Top Forums Programming Host to IP Source Code in C - Questions! Please Help Post 302246113 by f.ben.isaac on Sunday 12th of October 2008 09:41:50 PM
Old 10-12-2008
Host to IP Source Code in C - Questions! Please Help

Hello,

First of all, i want to say Hi! Glad to join your forum and be your member. I'm a newbie towards C/C++ especially on network programming.

What is the definition of getaddrinfo()?

int getaddrinfo(const char *node, const char *service,
const struct addrinfo *hints,
struct addrinfo **res);

Can you tell me in which library does it reside?

Last edited by f.ben.isaac; 10-13-2008 at 07:41 PM..
 

9 More Discussions You Might Find Interesting

1. Solaris

Tar files, transfer to remote host and delelte source

Hi, I´m having a problem here. I have a directory that holds many subdirs and files (by many I mean MANY thousands). What I want to do is make blocks of these files and transfer them block by block to a remote host; but once a given file is already placed in the remote host, the script must... (0 Replies)
Discussion started by: Dago
0 Replies

2. Linux

source code for linux

Hi , where can i get free source code for LINUX commands , OS , system calls etc. Thanks Naren (2 Replies)
Discussion started by: naren_chella
2 Replies

3. Programming

New to C... questions about this code... ADTs...

Hi, In a file called itemADT.c I have specified the itemType data type to contain a listADT (having already written this library) and an integer, which will eventually represent the no. of times the word that is stored in the listADT has occurred (when I do this, and write code to insert... (2 Replies)
Discussion started by: eva
2 Replies

4. Shell Programming and Scripting

Linux source code

Unix is written in C. From where u can see the source code of unix or linux (1 Reply)
Discussion started by: pritish.sas
1 Replies

5. UNIX for Dummies Questions & Answers

Where can i get unix source code?

Sir please tell me where can i get source code for some unix kernal and shell also. (1 Reply)
Discussion started by: VIPUL15
1 Replies

6. Shell Programming and Scripting

Block of code replacement in Java source code through Unix script

Hi, I want to remove the following code from Source files (or replace the code with empty.) from all the source files in given directory. finally { if (null != hibernateSession && hibernateSession.isOpen()) { //hibernateSession.close(); } } It would be great if the script has... (2 Replies)
Discussion started by: hareeshram
2 Replies

7. Linux

Source code

I need the source code of fedora. plz plz plz help me........... (1 Reply)
Discussion started by: neh
1 Replies

8. Shell Programming and Scripting

Connect to target host from Source host.

Hi All, Need to connect to target host and execute a command and connect back to source host to continue with next set of command execution. Is there a utility/command using which we can connect to target host ? Please suggest. Note: Netezza database is instaled on Linux server. ... (4 Replies)
Discussion started by: Nagaraja Akkiva
4 Replies

9. UNIX for Dummies Questions & Answers

Source code

hii... i am a biginner....and i have linux source code ,downloaded from some website ,a compressed file on windows and dont know how do compile them..... (4 Replies)
Discussion started by: M K Raju
4 Replies
explain_getaddrinfo(3)					     Library Functions Manual					    explain_getaddrinfo(3)

NAME
explain_getaddrinfo - explain getaddrinfo(3) errors SYNOPSIS
#include <libexplain/getaddrinfo.h> const char *explain_errcode_getaddrinfo(int errnum, const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res); void explain_message_errcode_getaddrinfo(char *message, int message_size, int errnum, const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res); DESCRIPTION
These functions may be used to obtain explanations for errors returned by the getaddrinfo(3) system call. explain_errcode_getaddrinfo const char *explain_errcode_getaddrinfo(int errnum, const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res); The explain_errcode_getaddrinfo function is used to obtain an explanation of an error returned by the getaddrinfo(3) system call. The least the message will contain is the value of gai_strerror(errcode), but usually it will do much better, and indicate the underlying cause in more detail. This function is intended to be used in a fashion similar to the following example: int errcode = getaddrinfo(node, service, hints, res); if (errncode == GAI_SYSTEM) errcode = errno; if (errcode) { fprintf(stderr, "%s ", explain_errcode_getaddrinfo(errcode, node, service, hints, res)); exit(EXIT_FAILURE); } The above code example is available as the explain_getaddrinfo_or_die(3) function. errnum The error value to be decoded, usually obtained from the errno global variable just before this function is called. This is neces- sary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value of errno. node The original node, exactly as passed to the getaddrinfo(3) system call. service The original service, exactly as passed to the getaddrinfo(3) system call. hints The original hints, exactly as passed to the getaddrinfo(3) system call. res The original res, exactly as passed to the getaddrinfo(3) system call. Returns: The message explaining the error. This message buffer is shared by all libexplain functions which do not supply a buffer in their argument list. This will be overwritten by the next call to any libexplain function which shares this buffer, including other threads. Note: This function is not thread safe, because it shares a return buffer across all threads, and many other functions in this library. explain_message_errno_getaddrinfo void explain_message_errno_getaddrinfo(char *message, int message_size, int errnum, const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res); The explain_message_errno_getaddrinfo function may be used to obtain an explanation of an error returned by the getaddrinfo(3) system call. The least the message will contain is the value of strerror(errnum), but usually it will do much better, and indicate the underlying cause in more detail. This function is intended to be used in a fashion similar to the following example: int errcode = getaddrinfo(node, service, hints, res); if (errnode == EAI_SYSTEM) errcode = errno; if (errcode) { char message[3000]; explain_message_errcode_getaddrinfo(message, sizeof(message), errcode, node, service, hints, res); fprintf(stderr, "%s ", message); exit(EXIT_FAILURE); } The above code example is available pre-packaged as the explain_getaddrinfo_or_die(3) function. message The location in which to store the returned message. If a suitable message return buffer is supplied, this function is thread safe. message_size The size in bytes of the location in which to store the returned message. errnum The error value to be decoded, usually obtained from the errno global variable just before this function is called. This is neces- sary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value of errno. node The original node, exactly as passed to the getaddrinfo(3) system call. service The original service, exactly as passed to the getaddrinfo(3) system call. hints The original hints, exactly as passed to the getaddrinfo(3) system call. res The original res, exactly as passed to the getaddrinfo(3) system call. SEE ALSO
getaddrinfo(3) network address and explain_getaddrinfo_or_die(3) network address and and report errors COPYRIGHT
libexplain version 0.52 Copyright (C) 2008 Peter Miller explain_getaddrinfo(3)
All times are GMT -4. The time now is 05:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy