On 30 May 2007, at 16:12, Davide Libenzi wrote:
> Can you try to build the program below, and then run?
>
> $ ./ipaddr 192.168.59.0 255.255.255.0
>
>
>
>
> - Davide
>
>
> ----
> #include <sys/types.h>
> #include <sys/socket.h>
> #include <stdio.h>
> #include <netinet/in.h>
> #include <netdb.h>
> #include <string.h>
>
> static const char *afname(int ipfam) {
> switch (ipfam) {
> case AF_INET:
> return "ipv4";
> case AF_INET6:
> return "ipv6";
> }
> return "????";
> }
>
> static int numip(char const *ipname) {
> int error, ipfam;
> struct addrinfo *cares, *ares;
> struct addrinfo hints;
>
> printf("Looking up: %s\n", ipname);
> memset(&hints, 0, sizeof(hints));
> hints.ai_family = AF_UNSPEC;
> if ((error = getaddrinfo(ipname, NULL, &hints, &ares)) != 0) {
> perror("getaddrinfo");
> return error;
> }
> for (cares = ares; cares != NULL; cares = cares->ai_next) {
> ipfam = *(unsigned short *) cares->ai_addr;
> printf("Found: family='%s' fnbr=%u len=%u\n", afname(ipfam),
> ipfam, cares->ai_addrlen);
> }
> freeaddrinfo(ares);
>
> return 0;
> }
>
> int main(int ac, char **av) {
> int i;
>
> for (i = 1; i < ac; i++)
> numip(av[i]);
>
> return 0;
> }
First after making a few of changes to server.tab on the spare system
it gave relay denied at 'RCPT TO:' same as other system had done.
Other than 'cosmetic' changes to get configs closer, eg. Maxerrors
increased from "2" to "3", only ones I think made the difference are:
"SmtpNoSSLAuths" "1"
"EnableCTRL-TLS" "0"
"EnableSMTP-TLS" "0"
"EnablePOP3-TLS" "0"
Only guessing how to proceed with above code but looks as if
something bad happened.
$ c++ -v -o ipaddr2 ipaddr.cpp
Using built-in specs.
Configured with:
/home/nick/work/netbsd/src/tools/gcc/../../gnu/dist/gcc/configure
--enable-long-long --disable-multilib --enable-threads --disable-symvers
--build=i386-unknown-netbsdelf2.0. --host=i386--netbsdelf
--target=i386--netbsdelf
Thread model: posix
gcc version 3.3.3 (NetBSD nb3 20040520)
/usr/bin/../libexec/cc1plus -quiet -v -iprefix /usr/bin/../libexec/
-D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 ipaddr.cpp -D__GNUG__=3
-quiet -dumpbase ipaddr.cpp -auxbase ipaddr -version -o /var/tmp//ccfdFz79.s
GNU C++ version 3.3.3 (NetBSD nb3 20040520) (i386--netbsdelf)
compiled by GNU C version 3.3.3 (NetBSD nb3 20040520).
GGC heuristics: --param ggc-min-expand=38 --param ggc-min-heapsize=16384
ignoring nonexistent directory "/usr/libexec/include/g++"
ignoring nonexistent directory "/usr/libexec/include/g++/backward"
ignoring nonexistent directory "/usr/libexec/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/g++
/usr/include/g++/backward
/usr/include
End of search list.
as -o /var/tmp//cctFamJf.o /var/tmp//ccfdFz79.s
ld -dc -dp -e __start -dynamic-linker /usr/libexec/ld.elf_so -o ipaddr2
/usr/lib/crt0.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/bin/../libexec
/var/tmp//cctFamJf.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/lib/crtend.o /usr/lib/crtn.o
$ ./ipaddr2 192.168.59.0 255.255.255.0
Looking up: 192.168.59.0
Found: family='????' fnbr=528 len=16
Found: family='????' fnbr=528 len=16
Looking up: 255.255.255.0
Found: family='????' fnbr=528 len=16
Found: family='????' fnbr=528 len=16
David
-
To unsubscribe from this list: send the line "unsubscribe xmail" in
the body of a message to [EMAIL PROTECTED]
For general help: send the line "help" in the body of a message to
[EMAIL PROTECTED]