search for: sockaddr_in

Displaying 20 results from an estimated 160 matches for "sockaddr_in".

1998 May 14
1
samba main cvs branch seems to be broken on 64-bit boxes.....
hi there :) the code in util.c seems to have some bugs w/regard to compilation on 64-bit machines. in this case, the hardware is an Alpha running redhat 4.2 with pam turned off in the makefile. i get a whole series of errors, all of which say "passing arg 'n' of 'function' from incompatible pointer type. in util.c, checked out of the main branch the day before yesterday,
2003 Feb 20
0
Netbios name service forwarding.
...<sys/types.h> #include <unistd.h> #include <string.h> #include <strings.h> #include <malloc.h> #include <net/if.h> #include <arpa/inet.h> #define NETBIOSPORT 137 typedef struct iface_struct { struct iface_struct *next; char *name; int fd; struct sockaddr_in me; struct sockaddr_in nmbd; struct sockaddr_in bcast; struct sockaddr_in addr_cache[0x10000]; } *iface; iface ifs; void open_if (char *name, int nb_port, int dm_port) { struct sockaddr_in me = { 0 }; iface i = (iface) malloc (sizeof (struct iface_struct)); int fd; int one = 1;...
2007 Jan 06
1
Re: [nut-commits] svn commit r710 - in trunk: . clients server
...-/* From IPv6 patch (doesn't seem to be used) > -extern int opt_af; > - */ > struct { > int flags; > const char *str; > @@ -424,8 +421,13 @@ > > int upscli_connect(UPSCONN *ups, const char *host, int port, int flags) > { > +#ifndef HAVE_IPV6 > + struct sockaddr_in local, server; > + struct hostent *serv; > +#else > struct addrinfo hints, *r, *rtmp; > char *service; > +#endif > > /* clear out any lingering junk */ > ups->fd = -1; > @@ -452,6 +454,80 @@ > return -1; > } > > +#ifndef HAVE_IPV6 > + if...
2007 Jan 06
3
Re: [nut-commits] svn commit r708 - in trunk: . clients server
...reported only once upsclient.c:469: for each function it appears in.) Even if it doesn't break IPv4 support, it may break portability, as IPv6 seems to require specific functions that are not as standardized as the IPv4 ones. For example it uses "struct addrinfo" and not "struct sockaddr_in". Moreover, it seems that my version of getaddrinfo() recognizes different flags than this patch assumes. Ideally the availability of IPv6 functions should be detected at configuration time. Unfortunately, the patch uses the new interface even for IPv4 support, so there is no easy way of encl...
2006 Feb 05
2
R socket communication
...uot;Reading data" in the R console, but nothing else. The PERL client #! /usr/bin/perl use strict; use Socket; # initialize host and port my $host = shift || 'localhost'; my $port = shift || 7890; my $proto = getprotobyname('tcp'); my $iaddr = inet_aton($host); my $paddr = sockaddr_in($port, $iaddr); socket(SOCKET, PF_INET, SOCK_STREAM, $proto) or die "socket: $!"; connect(SOCKET, $paddr) or die "connect: $!"; print SOCKET "Hello \n"; close SOCKET or die "close: $!"; The PERL server #! /usr/bin/perl -w use strict; use Socket; my $port...
2001 Jan 22
0
Patches for failing build & bus error on SPARC/Linux
...a(align)); return 0; } else { hp = gethostbyaddr((char *)&sin->sin_addr, *** /dev/null Tue Jan 1 04:00:00 1980 --- /tmp/testinet.c Mon Jan 22 16:44:17 2001 *************** *** 0 **** --- 1,47 ---- + /* Test program to exercise bug arising from assumed alignment of + struct sockaddr_in in some SPARC versions of inet_ntoa. Appears under + config with host sparc-unknown-linux-gnulibc1. + + To try, compile e.g. + gcc -g -I/usr/src/local/openssh-2.3.0p1 -I/usr/local/ssl/include \ + -o testinet testinet.c + + G. Helffrich/U. Bristol Earth Sciences + */ + #include...
2009 Jun 08
2
[PATCH] few minor bugfixes
...VE_CONNECT) && defined(HAVE_HTONS) && defined(HAVE_GETHOSTBYNAME) +#if defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) static int viewer_open_vnc_socket(const char* vnchost, int vncport) { - int socketfd; - struct hostent *serv; - struct sockaddr_in serv_addr; + int result, socketfd; + char port[10]; + struct addrinfo* vnc_addr; - socketfd = socket(PF_INET, SOCK_STREAM, 0); - if(socketfd < 0){ - return -1; - } + sprintf(port, "%d", vncport); - serv = gethostbyname(vnchost); - if(serv == NULL){ + result = getaddr...
2009 Jun 01
2
[PATCH viewer] few minor bugfixes
...VE_CONNECT) && defined(HAVE_HTONS) && defined(HAVE_GETHOSTBYNAME) +#if defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) static int viewer_open_vnc_socket(const char* vnchost, int vncport) { int socketfd; - struct hostent *serv; struct sockaddr_in serv_addr; socketfd = socket(PF_INET, SOCK_STREAM, 0); @@ -917,14 +918,9 @@ viewer_open_vnc_socket(const char* vnchost, int vncport) return -1; } - serv = gethostbyname(vnchost); - if(serv == NULL){ - return -1; - } - serv_addr.sin_family = PF_INET; serv_addr.sin_port...
2000 Nov 21
1
Openssh-2.2.0pl1 for UnixWare 7.1
UnixWare (not sure when, 7? 7.1?) introduces a new sockaddr_in structure that splits the 16 bit family entity into an 8-bit length and an 8-bit familiy memember: (from in.h): struct sockaddr_in { #ifdef __NEW_SOCKADDR__ sa_len_t sin_len; /* 8-bit structure length */ #endif sa_family_t sin_family; /* 8/16-bit address family (AF_INET) */ in_port_...
2004 Dec 22
1
register_verify defined in 2 files?
I know I'm getting tired of looking at code, but why is the function register_verify defined in 2 different files? chan_iax2.c line 3860 static int register_verify(int callno, struct sockaddr_in *sin, struct iax_ies *ies) chan_sip.c line 4869 /*--- register_verify: Verify registration of user */ static int register_verify(struct sip_pvt *p, struct sockaddr_in *sin, struct sip_request *req, char *uri, int ignore) Regards Greg
2007 Jan 26
1
h323 compile error
...-------------------------- ../../include/asterisk/utils.h: In function `void ast_slinear_saturated_divide (short int *, short int *)': ../../include/asterisk/utils.h:199: warning: `always_inline' attribute directive ignored ../../include/asterisk/utils.h: In function `int inaddrcmp (const sockaddr_in *, const sockaddr_in *)': ../../include/asterisk/utils.h:217: warning: `always_inline' attribute directive ignored In file included from ast_h323.cxx:51: ast_h323.h: At top level: ast_h323.h:159: type specifier omitted for parameter ast_h323.h:159: parse error before `*' ast_h323.cxx:9...
2007 Jan 08
2
Re: [nut-commits] svn commit r714 - in trunk: . server
...n the business of testing, it does not hurt to do so. Arjen, I wonder about server/access.c, line 60-61: return (IN6_IS_ADDR_V4MAPPED(ip6) && ((((const u_int32_t *)ip6)[3] & (u_int32_t)prefix) == net->s_addr)); Comparing this with line 38: return((((struct sockaddr_in*)ip_addr)->sin_addr.s_addr & htonl(prefix)) == ((struct sockaddr_in*)net_addr)->sin_addr.s_addr); I wonder if it shouldn't be htonl(prefix) in line 61, or perhaps ntohl(net->s_addr) in line 61. I don't understand these data structures well, and presumably the patch came from s...
2010 Nov 28
2
[PATCH] Use canonical hostname for DNS SSHFP lookup
...,15 +121,23 @@ #ifndef HAVE_GETADDRINFO static struct -addrinfo *malloc_ai(int port, u_long addr, const struct addrinfo *hints) +addrinfo *malloc_ai(int port, u_long addr, const struct addrinfo *hints, + const char *canonname) { struct addrinfo *ai; + int len = sizeof(*ai) + sizeof(struct sockaddr_in); + int canonlen = 0; - ai = malloc(sizeof(*ai) + sizeof(struct sockaddr_in)); + if (canonname != NULL) { + canonlen = strlen (canonname); + len += canonlen + 1; + } + + ai = malloc(len); if (ai == NULL) return (NULL); - memset(ai, '\0', sizeof(*ai) + sizeof(struct sockaddr_in))...
2000 Mar 07
2
patch for openssh-1.2.2p1
...2.2p1-20000308/canohost.c Wed Mar 8 00:25:18 2000 @@ -42,6 +42,22 @@ debug("getpeername failed: %.100s", strerror(errno)); fatal_cleanup(); } + +#ifdef IPV4_IN_IPV6 + if (((struct sockaddr *)&from)->sa_family == AF_INET6 && + IN6_IS_ADDR_V4MAPPED((&((struct sockaddr_in6 *)&from)->sin6_addr))){ + struct in_addr addr; + u_int16_t port; + memcpy(&addr, ((char *)&((struct sockaddr_in6 *)&from)->sin6_addr)+12, + sizeof(addr)); + port = ((struct sockaddr_in6 *)&from)->sin6_port; + memset(&from, 0, sizeof(from)); + ((struct...
2004 Nov 29
1
Polycom Reboot Script PRI errors!!
...cal_ip > CSeq: 1300 NOTIFY > Contact: <sip:$sip_from\@$local_ip> > Content-Length: 0 > > "; > > $proto = getprotobyname('udp'); > socket( SOCKET, PF_INET, SOCK_DGRAM, $proto ); > $iaddr = inet_aton("$phone_ip"); > $paddr = sockaddr_in( 5060, $iaddr ); > bind( SOCKET, $paddr ); > $port = 5060; > > $hisiaddr = inet_aton($phone_ip); > $hispaddr = sockaddr_in( $port, $hisiaddr ); > > if ( send( SOCKET, $MESG, 0, $hispaddr ) ) { > print "reboot of phone ", "$phone_i...
2004 Mar 02
2
[PATCH] Force mountd(8) to a specified port.
...rieving revision 1.74 diff -u -r1.74 mountd.c --- mountd.c 30 Oct 2003 22:57:43 -0000 1.74 +++ mountd.c 2 Mar 2004 21:08:17 -0000 @@ -272,11 +272,15 @@ fd_set readfds; SVCXPRT *udptransp, *tcptransp, *udp6transp, *tcp6transp; struct netconfig *udpconf, *tcpconf, *udp6conf, *tcp6conf; + struct sockaddr_in sin; + struct sockaddr_in6 sin6; int udpsock, tcpsock, udp6sock, tcp6sock; + char *endptr; + in_port_t svcport = 0; int xcreated = 0, s; int maxrec = RPC_MAXDATASIZE; int one = 1; - int c; + int c, r; udp6conf = tcp6conf = NULL; udp6sock = tcp6sock = NULL; @@ -298,7 +302,7 @@ errx...
2004 Jan 22
2
Polycom Reboot Script - Please wiki-size me
...check-sync Date: $httptime Call-ID: $call_id\@$local_ip CSeq: 1300 NOTIFY Contact: <sip:$sip_from\@$local_ip> Content-Length: 0 "; $proto = getprotobyname('udp'); socket( SOCKET, PF_INET, SOCK_DGRAM, $proto ); $iaddr = inet_aton("$phone_ip"); $paddr = sockaddr_in( 5060, $iaddr ); bind( SOCKET, $paddr ); $port = 5060; $hisiaddr = inet_aton($phone_ip); $hispaddr = sockaddr_in( $port, $hisiaddr ); if ( send( SOCKET, $MESG, 0, $hispaddr ) ) { print "reboot of phone ", "$phone_ip", " was successful", &q...
2004 Apr 01
1
[patch] net/rsync: problems in client name lookup code
...ckaddr(const struct addrinfo *ai, --- clientname.c.orig Fri Jan 10 21:05:56 2003 +++ clientname.c Thu Apr 1 10:57:05 2004 @@ -101,58 +101,58 @@ char *client_name(int fd) static char name_buf[100]; static char port_buf[100]; static int initialised; - struct sockaddr_storage ss, *ssp; - struct sockaddr_in sin; -#ifdef INET6 - struct sockaddr_in6 sin6; -#endif - socklen_t ss_len; + struct sockaddr_storage ss; - if (initialised) return name_buf; + if (initialised) + return name_buf; strcpy(name_buf, default_name); initialised = 1; + memset(&ss, 0, sizeof(ss)); + if (am_server) { /*...
2003 May 23
2
cannot find expat
am compiling h323 support using channels/h323/ error am getting is this any pointers chan_h323.h:30: warning: `struct sockaddr_in bindaddr' defined but not used g++ -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L/root/pwlib/lib -lpt_linux_x86_r -L/root/openh323/lib -lh323_linux_x86_r -L/usr/lib -lpthread -ldl -lcrypto -lssl -lexpat /usr/i486-suse-linux/bin/ld: cannot find -lexpat collect2: ld returned...
2000 Jan 19
3
AIX openssh patches
...%s", RANDOM_POOL, strerror(errno)); close(random_pool); + #endif /* USE_SYSRANDOM */ } #endif /* !HAVE_ARC4RANDOM */ *** canohost.c.DIST Wed Jan 19 11:00:42 2000 --- canohost.c Wed Jan 19 11:01:09 2000 *************** *** 29,35 **** get_remote_hostname(int socket) { struct sockaddr_in from; ! int fromlen, i; struct hostent *hp; char name[MAXHOSTNAMELEN]; --- 29,40 ---- get_remote_hostname(int socket) { struct sockaddr_in from; ! #ifdef _AIX ! unsigned long fromlen; ! #else ! int fromlen; ! #endif ! int i; struct hostent *hp; char name[MAXHOSTNAMELEN];...