Hi all,
        we are trying to write some simple applications using AFS/NT API
available from distribution (we are running AFS/NT pl.8).

Unfortunately, we have problems with some basic AFS/NT calls - the
function cm_SearchCellFile() returns -3 ("Couldn't find any servers for
cell") virtually for any cell :-(( (The same function detects syntax errors
or missing afsdconf.ini file OK) (I'm sending our test code as
attachment). 

Does someone have any suggestion or working code example (I hope,
someone should have running similar piece of code) ?? I'm not very
familiar with NT :-), so _ANY_ help or suggestion are welcome!!

Thank you again in advance for any help or suggestion!

Best regards,
        Lubos

--------------------------------------------------------------------------
Lubos Kejzlar
System and Network Specialist

Laboratory for Computer Science                    Tel.:   +420-19 7491210
University of West Bohemia                                 +420-19 7221530
Univerzitni 8, 30614 Pilsen                        Fax:    +420-19 7491485
Czech Republic                                     E-mail:  [EMAIL PROTECTED]
--------------------------------------------------------------------------
#include <winsock.h>

#define MAXCELLCHARS    64
#define MAXHOSTCHARS    64
#define MAXHOSTSPERCELL  8

struct afsconf_cell {
    char name[MAXCELLCHARS];        /* Cell name */
    short numServers;               /* Num active servers for the cell*/
    short flags;                    /* useful flags */
    struct sockaddr_in hostAddr[MAXHOSTSPERCELL];
                                    /* IP addresses for cell's servers*/
    char hostName[MAXHOSTSPERCELL][MAXHOSTCHARS];       
                                    /* Names for cell's servers */
    char *linkedCell;               /* Linked cell name, if any */
};
#include <stdio.h>
#include "test.h"

struct afsconf_cell cellconfig; /* General information about the cell */

/* libafsconf.dll */
extern long cm_GetRootCellName();
extern long cm_SearchCellFile();

static long cm_SearchCellFile_CallBack()
{
  return (long)0;
}

int main()
{
  int status = 0;
  char local_cell[64];
  
  status = cm_GetRootCellName(&local_cell);
  status = cm_SearchCellFile (local_cell,
                              &cm_SearchCellFile_CallBack,
                              cellconfig);

  printf("Cell: %s Status = %d", local_cell, status);
  return status;
}

Reply via email to