
/****************************************************************
 *                                                              *
 *  LIBDIST V1.0						*
 *                                                              *
 *  ns-client.c -- test naming service                          *
 *                                                              *
 *  Last changed: 21.02.96                                      *
 *  Author: Frank Kargl (frank.kargl@informatik.uni-ulm.de)     *
 *                                                              *
 *  Restrictions: works only for Solaris 2.6 or above           *
 *                                                              *
 ****************************************************************/

#include "libdist.h"

int main() {

    char *ptr;

    printf("Entering data\n");

    if (dl_ns_enter("host1","134.60.1.1") == DL_ERROR) {
	fprintf(stderr,"ERROR\n");
    }
    if (dl_ns_enter("host2","134.60.1.2") == DL_ERROR) {
	fprintf(stderr,"ERROR\n");
    }
    if (dl_ns_enter("host3","134.60.1.3") == DL_ERROR) {
	fprintf(stderr,"ERROR\n");
    }
    if (dl_ns_enter("host3","134.60.1.4") == DL_ERROR) {
	fprintf(stderr,"ERROR\n");
    }

    if (dl_ns_delete("host1") == DL_ERROR) {
	fprintf(stderr,"ERROR\n");
    }
		
    dl_ns_dump();

    if (( ptr=dl_ns_retrieve("host2")) == NULL ) {
	fprintf(stderr,"ERROR\n");
    }

    printf("host2 = %s\n",ptr);

    if (( ptr=dl_ns_retrieve("host3")) == NULL) {
	fprintf(stderr,"ERROR\n");
    }

    printf("host3 = %s\n",ptr);

    return 0;
}
