2 * Copyright (c) 1990,1993 Regents of The University of Michigan.
3 * All Rights Reserved. See COPYRIGHT.
11 #include <netatalk/endian.h>
12 #include <netatalk/at.h>
13 #include <atalk/netddp.h>
14 #include <atalk/util.h>
21 if (( p = strrchr( av0, '/' )) == 0 ) {
27 fprintf( stderr, "Usage: %s [ -A address ] obj:type@zone\n", p );
35 struct sockaddr_at addr;
36 struct at_addr ataddr;
37 char *Obj = 0, *Type = 0, *Zone = 0;
43 memset(&ataddr, 0, sizeof(ataddr));
44 while (( c = getopt( ac, av, "p:A:" )) != EOF ) {
47 if (!atalk_aton(optarg, &ataddr)) {
48 fprintf(stderr, "Bad address.\n");
54 port = atoi( optarg );
62 if ( ac - optind != 1 ) {
67 * Get the name. If Type or Obj aren't specified, error.
69 if ( nbp_name( av[ optind ], &Obj, &Type, &Zone ) || !Obj || !Type ) {
73 memset(&addr, 0, sizeof(addr));
74 memcpy(&addr.sat_addr, &ataddr, sizeof(addr.sat_addr));
75 if ((s = netddp_open(&addr, NULL)) < 0)
82 if ( nbp_rgstr( &addr, Obj, Type, Zone ) < 0 ) {
83 perror( "nbp_rgstr" );
84 fprintf( stderr, "Can't register %s:%s@%s\n", Obj, Type,