#include <afsconfig.h>
#include <afs/param.h>
+#include <afs/stds.h>
-RCSID
- ("$Header$");
+#include <roken.h>
+
+#include <rx/rx.h>
+#include <rx/rxstat.h>
+
+#ifdef AFS_NT40_ENV
+# include <afs/krb5_nt.h>
+#endif
-#include <afs/stds.h>
-#include <afs/afs_Admin.h>
-#include <stdio.h>
-#include <string.h>
#include <afs/afs_Admin.h>
-#include "afs_AdminInternal.h"
-#include "afs_utilAdmin.h"
#include <afs/pthread_glock.h>
#include <afs/cellconfig.h>
#include <afs/dirpath.h>
#include <afs/pterror.h>
#include <afs/bnode.h>
#include <afs/volser.h>
-#include <afs/afsint.h>
-#include <rx/rx.h>
-#include <rx/rxstat.h>
-#ifdef AFS_NT40_ENV
-#include <winsock2.h>
-#else
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#endif
+#include <afs/afscbint.h>
+
+#include "afs_AdminInternal.h"
+#include "afs_utilAdmin.h"
/*
* AIX 4.2 has PTHREAD_CREATE_UNDETACHED and not PTHREAD_CREATE_JOINABLE
initialize_AU_error_table();
initialize_AV_error_table();
initialize_VOLS_error_table();
+#ifdef AFS_KRB5_ERROR_ENV
+ initialize_krb5();
+#endif
error_init_done = 1;
}
+/*
+ * (*errorTextP) will not be freed by the caller.
+ */
int ADMINAPI
util_AdminErrorCodeTranslate(afs_status_t errorCode, int langId,
const char **errorTextP, afs_status_p st)
if (!error_init_done)
pthread_once(&error_init_once, init_once);
code = (afs_int32) errorCode;
- *errorTextP = error_message(code);
+ *errorTextP = afs_error_message(code);
+#ifdef AFS_KRB5_ERROR_ENV
+ if (strncmp(*errorTextP, "unknown", strlen("unknown")) == 0) {
+ const char *msg = fetch_krb5_error_message(code);
+ if (msg)
+ *errorTextP = msg;
+ }
+#endif
rc = 1;
fail_util_AdminErrorCodeTranslate:
afs_status_t tst = 0;
afs_admin_iterator_p iter =
(afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
- database_server_get_p serv =
- (database_server_get_p) calloc(1, sizeof(database_server_get_t));
+ database_server_get_p serv = calloc(1, sizeof(database_server_get_t));
char copyCell[MAXCELLCHARS];
/*
if (num_converted == 4) {
*serverAddress = (part1 << 24) | (part2 << 16) | (part3 << 8) | part4;
} else {
- LOCK_GLOBAL_MUTEX server = gethostbyname(serverName);
+ LOCK_GLOBAL_MUTEX;
+ server = gethostbyname(serverName);
if (server != NULL) {
memcpy((void *)serverAddress, (const void *)server->h_addr,
- sizeof(serverAddress));
+ sizeof(int));
*serverAddress = ntohl(*serverAddress);
} else {
tst = ADMUTILCANTGETSERVERNAME;
UNLOCK_GLOBAL_MUTEX;
goto fail_util_AdminServerAddressGetFromName;
}
- UNLOCK_GLOBAL_MUTEX}
+ UNLOCK_GLOBAL_MUTEX;
+ }
rc = 1;
fail_util_AdminServerAddressGetFromName:
s->stats_v1.func_index = *(ptr++);
hi = *(ptr++);
lo = *(ptr++);
- hset64(s->stats_v1.invocations, hi, lo);
+ s->stats_v1.invocations = ((afs_uint64) hi << 32) + lo;
hi = *(ptr++);
lo = *(ptr++);
- hset64(s->stats_v1.bytes_sent, hi, lo);
+ s->stats_v1.bytes_sent = ((afs_uint64) hi << 32) + lo;
hi = *(ptr++);
lo = *(ptr++);
- hset64(s->stats_v1.bytes_rcvd, hi, lo);
+ s->stats_v1.bytes_rcvd = ((afs_uint64) hi << 32) + lo;
s->stats_v1.queue_time_sum.sec = *(ptr++);
s->stats_v1.queue_time_sum.usec = *(ptr++);
s->stats_v1.queue_time_sum_sqr.sec = *(ptr++);
*/
int ADMINAPI
-util_RPCStatsGetBegin(struct rx_connection *conn, int (*rpc) (),
+util_RPCStatsGetBegin(struct rx_connection *conn,
+ int (*rpc) (struct rx_connection *,
+ afs_uint32, afs_uint32 *,
+ afs_uint32 *, afs_uint32 *,
+ afs_uint32 *, struct rpcStats *),
void **iterationIdP, afs_status_p st)
{
int rc = 0;
*/
int ADMINAPI
-util_RPCStatsStateGet(struct rx_connection *conn, int (*rpc) (),
+util_RPCStatsStateGet(struct rx_connection *conn,
+ int (*rpc) (struct rx_connection *,
+ afs_RPCStatsState_p),
afs_RPCStatsState_p state, afs_status_p st)
{
int rc = 0;
*/
int ADMINAPI
-util_RPCStatsStateEnable(struct rx_connection *conn, int (*rpc) (),
+util_RPCStatsStateEnable(struct rx_connection *conn,
+ int (*rpc) (struct rx_connection *),
afs_status_p st)
{
int rc = 0;
*/
int ADMINAPI
-util_RPCStatsStateDisable(struct rx_connection *conn, int (*rpc) (),
+util_RPCStatsStateDisable(struct rx_connection *conn,
+ int (*rpc) (struct rx_connection *),
afs_status_p st)
{
int rc = 0;
*/
int ADMINAPI
-util_RPCStatsClear(struct rx_connection *conn, int (*rpc) (),
+util_RPCStatsClear(struct rx_connection *conn,
+ int (*rpc) (struct rx_connection *,
+ afs_RPCStatsClearFlag_t),
afs_RPCStatsClearFlag_t flag, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
cm_list_cell_get_p t = (cm_list_cell_get_p) rpc_specific;
char *name;
+ serverList sl;
+ unsigned int n;
/*
* Get the next entry in the CellServDB.
*/
name = t->cell[slot].cellname;
+ sl.serverList_len = 0;
+ sl.serverList_val = NULL;
+ memset(t->cell[slot].serverAddr, 0, sizeof(afs_int32)*UTIL_MAX_CELL_HOSTS);
tst =
- RXAFSCB_GetCellServDB(t->conn, t->index, &name,
- t->cell[slot].serverAddr);
+ RXAFSCB_GetCellServDB(t->conn, t->index, &name, &sl);
if (tst) {
goto fail_ListCellsRPC;
}
strcpy(t->cell[slot].cellname, name);
+ if (sl.serverList_val) {
+ for (n=0; n<sl.serverList_len && n<UTIL_MAX_CELL_HOSTS; n++) {
+ t->cell[slot].serverAddr[n] = sl.serverList_val[n];
+ }
+ xdr_free((xdrproc_t) xdr_serverList, &sl);
+ }
/*
* See if we've processed all the entries
{
int rc = 0;
afs_status_t tst = 0;
- afs_int32 allocbytes;
+ afs_uint32 allocbytes;
struct cacheConfig tconfig;
if (conn == NULL) {
*/
int ADMINAPI
-util_RXDebugRxStats(rxdebugHandle_p handle, struct rx_stats *stats,
+util_RXDebugRxStats(rxdebugHandle_p handle, struct rx_statistics *stats,
afs_uint32 * supportedValues, afs_status_p st)
{
int rc = 0;