Page History

Turn Off History

First milestone

It had been since few months so it may not appropriate to call it as first mile stone. I would say it is first milestone for working code of Condor.

Well, I must admit that it is too painful to convert everything at once. Try to devise some strategy that can split works and test-cases. Which modules are necessary and which are not for the first milestone?

Features

Will not be implemented

List of Condor IP addr functions

// from condor_c++_util/get_full_hostname.cpp

extern char* get_full_hostname( const char*,
                                struct in_addr *sin_addrp = NULL );

extern char* get_full_hostname_from_hostent( struct hostent* host_ptr,
                                             const char* host );

// from condor_util_lib/condor_netdb.c

struct hostent *
condor_gethostbyname(const char *name);

struct hostent *
condor_gethostbyaddr(const char *addr, SOCKET_LENGTH_TYPE len, int type);

int
condor_gethostname(char *name, size_t namelen);

// from condor_util_lib/internet.c
// internet.c is a total failure...... tons of old-style codings

int is_ipaddr(const char *inbuf, struct in_addr *sin_addr);

int is_ipaddr_no_wildcard(const char *inbuf, struct in_addr *sin_addr);

int is_ipaddr_wildcard(const char *inbuf, struct in_addr *sin_addr, struct in_addr *mask_addr);

int is_valid_network( const char *network, struct in_addr *ip, struct in_addr *mask);

int is_valid_sinful( const char *sinful );

// there are many more from internet.c. omitted at this time.

Condor NetDB

Condor defines its own netdb-related functions (proxy functions) for its own DNS system called NO_DNS.

Test required

Don't forget below lists.

currently working on

Link error

Mar, 9 : resolved some errors. condor_getaddrinfo, condor_getnameinfo

../condor_daemon_core.V6/daemon_core.a(daemon_core.o): In function `DaemonCore::InitDCCommandSocket(int)':
/u/m/_/m/ron_ws/src/condor_daemon_core.V6/daemon_core.cpp:8676: undefined reference to `Sock::get_addr()'
../condor_util_lib/util_lib.a(internet.o): In function `getSockAddr':
/u/m/_/m/ron_ws/src/condor_util_lib/internet.c:1024: undefined reference to `my_ip_addr'
../condor_c++_util/cplus_lib.a(my_hostname.o): In function `init_full_hostname':
/u/m/_/m/ron_ws/src/condor_c++_util/my_hostname.cpp:140: undefined reference to `get_full_hostname_ipv6(char const*, ipaddr&)'
../condor_c++_util/cplus_lib.a(my_hostname.o): In function `init_ipaddr':
/u/m/_/m/ron_ws/src/condor_c++_util/my_hostname.cpp:176: undefined reference to `ipv6_is_ipaddr(char const*, ipaddr&)'
/u/m/_/m/ron_ws/src/condor_c++_util/my_hostname.cpp:209: undefined reference to `get_full_hostname_ipv6(char const*, ipaddr&)'
../condor_io/libcedar.a(sock.o): In function `Sock::get_port()':
/u/m/_/m/ron_ws/src/condor_io/sock.cpp:1952: undefined reference to `condor_getsockname(int, ipaddr&)'
../condor_io/libcedar.a(sock.o): In function `Sock::bindWithin(int, int, bool)':
/u/m/_/m/ron_ws/src/condor_io/sock.cpp:447: undefined reference to `ipv6_my_ip_addr()'
../condor_io/libcedar.a(sock.o): In function `Sock::bind(bool, int, bool)':
/u/m/_/m/ron_ws/src/condor_io/sock.cpp:579: undefined reference to `ipv6_my_ip_addr()'
../condor_io/libcedar.a(sock.o): In function `Sock::do_connect(char const*, int, bool)':
/u/m/_/m/ron_ws/src/condor_io/sock.cpp:734: undefined reference to `ipv6_is_ipaddr(char const*, ipaddr&)'
/u/m/_/m/ron_ws/src/condor_io/sock.cpp:752: undefined reference to `ipaddr::ipaddr(sockaddr*)'
../condor_io/libcedar.a(safe_sock.o): In function `SafeSock::connect(char const*, int, bool)':
/u/m/_/m/ron_ws/src/condor_io/safe_sock.cpp:277: undefined reference to `ipv6_is_ipaddr(char const*, ipaddr&)'
../condor_io/libcedar.a(condor_ipv6.o): In function `condor_gethostbyaddr_ipv6(ipaddr const&)':
/u/m/_/m/ron_ws/src/condor_io/condor_ipv6.cpp:129: undefined reference to `ipaddr::get_socklen() const'
../condor_io/libcedar.a(condor_ipv6.o): In function `condor_getnameinfo(ipaddr const&, char*, unsigned int, char*, unsigned int, unsigned int)':
/u/m/_/m/ron_ws/src/condor_io/condor_ipv6.cpp:108: undefined reference to `ipaddr::get_socklen() const'
../condor_io/libcedar.a(condor_auth_x509.o): In function `getDaemonList(ReliSock*)':
/u/m/_/m/ron_ws/src/condor_io/condor_auth_x509.cpp:478: undefined reference to `ipv6_to_hostname(ipaddr const&, char*, int)'
collect2: ld returned 1 exit status
make: *** [condor_dcskel] Error 1

Note for constants

Don't forget constants that should be adjusted!

MAXMACHNAME : seen in file_transfer_db.c, stores the result of sin_to_hostname.

IpVerify

[zach] implemented by mostly Todd, and little bit by Zach and Dan.

IpVerify verifies the remote process's ip from the configuration file. There are many lines that are referring to DCpermission. I am bit confused here. I do not understand what 'DCpermission' made for.

Ulrich Mystery

Ulrich's Userlevel IPv6 Programming Introductionn - http://people.redhat.com/drepper/userapi-ipv6.html

He denotes gethostbyaddr() as an obsolete. However, gethostbyaddr() accepts a socket type as a parameter. (AF_INET, AF_INET6) That means it should work well with IPv6. Why it is obsolete??

Converting Sock

Sock is not only used by TCP/UDP connection but also used by Unix domain socket (AF_UNIX). Basically, Sock can only create TCP or UDP socket internally but SharedEndPoint and SharedPortClient creates Unix domain socket and calls Sock::assign() to pass the descriptor.

I guess this is broken abstraction since Sock has IP related functions such as peer_addr() or peer_port() which are not available to Unix domain socket.

It seems assign() is only used by these Shared* thing. So maybe we could end up with refactoring it.

What is it?

TCP_FORWARDING_HOST ?

solved

KeyCache

KeyCache, uses sockaddr_in for storing ip addr. before modify, be sure to look at the overall picture. only used in condor_secman and daemon core.

KeyCacheEntry stores sockaddr_in. KeyCache converts sockaddr_in into sinful string and use the string as a key.

Sock::my_addr() can fail?

One of asymmetry in Sock class is that peer_addr() does not fail and always return a value but my_addr() can fail. ( peer_addr tells you the address of peer, my_addr() tells you the address of local socket)

The possible case for a failure of my_addr() is that when Sock class did not assign a socket descriptor.

In this case, peer_addr() can also fail.

Returning a pointer of a static buffer inside a function

It is quite common practice in Condor source code that returning a pointer of a static buffer in a function. It was perfectly fine in a world that pthread is rare and multi-core is unknown. It is obviously non-re-entrant and non-thread-safe. Well, I could do as it was. But, I am slightly uncomfortable of writing such a function. So, I decided to use MyString instead of returning a pointer of a static buffer.