Example #1
0
void
usage(char *option)
{
   char *Msgs[]={
"Usage: isysmeta [-lvVh] [command]",
" Show or modify system metadata.",
"Commands are:",
" mod DataObjectName Time (modify expire time)",
" mod DataObjectName datatype Type (modify data-type)",
" mod DataObjectName comment [replNum] Comment (modify the comment of the replica replNum or 0 by default)",
" ls [-lvV] Name (list dataObject, -l -v for long form)",
" ldt (list data types (those available))",
" ",
"Time can be full or partial date/time: '2009-12-01' or '2009-12-11.12:03'",
"etc, or a delta time '+1h' (one hour from now), etc.",
" ",
"Examples:",
" isysmeta mod foo +1h (set the expire time for file 'foo' to an hour from now)",
" isysmeta mod /tempZone/home/rods/foo 2009-12-01",
" isysmeta mod /tempZone/home/rods/foo datatype 'tar file'",
" isysmeta mod /tempZone/home/rods/dbo1 datatype 'database object'",
" isysmeta mod /tempZone/home/rods/foo comment 1 'my comment'",
" isysmeta ls foo",
" isysmeta -l ls foo",
" isysmeta ls -l foo",
" isysmeta ldt",
""};

   printMsgs(Msgs);
   printReleaseInfo("isysmeta");
}
Example #2
0
static void compareTimeStamps(int burstNr, int msgNr)
{
  static baseDiff, t1old, t2old;
  
  if (burstNr==0 && msgNr==0) {
    if ((kvtData.nMagiSyncGroups == 1 && kvtData.nMagiSyncedMembers == 2) ||
        (kvtData.nNonMagiSyncCards == 1 && kvtData.nNonMagiSyncedMembers == 2)) {
      baseDiff = 0;
    }
    else {
      baseDiff = t1 - t2;
    }
  }
  else if (t1 == t1old || t2 == t2old) {
    if (FirstHardwareType != canHWTYPE_LAPCAN && SecondHardwareType != canHWTYPE_LAPCAN &&
        FirstHardwareType != canHWTYPE_VIRTUAL && SecondHardwareType != canHWTYPE_VIRTUAL) {
      //
      // Don't do this test for LAPcan or virtual channels because they might give several
      // message identical time stamps.
      //
      printSomeStuff();
      printf("burstNr %d, msgNr %d\n", burstNr, msgNr);
      printMsgs();
      Error("compareTimeStamps() Time not increasing: "
            "t1 = %u, t1old = %u, t2 = %u, t2old = %u us\n",
            t1*10, t1old*10, t2*10, t2old*10);
    }
  }
  t1old = t1;
  t2old = t2;
  
  tTmp = t1-t2 - baseDiff ;
  
  if (tTmp>tMax) tMax = tTmp;
  if (tTmp<tMin) tMin = tTmp;
  
  if (abs(tTmp) < MAX_DIFF-1) {
    ndiff[tTmp+MAX_DIFF]++;
  } else {
    printSomeStuff();
    printMsgs();
    Error("compareTimeStamps(): burstNr=%d, msgNr=%d, "
          "t1 - t2 - baseDiff = %d - %d - %d = %d us\n",
          burstNr, msgNr, t1*10, t2*10, baseDiff*10, (t1-t2)*10);
  }
}
Example #3
0
void usageMain()
{
   char *Msgs[]={
"Usage: igroupadmin [-hvV] [command]",
" ",
"This is for users of type 'groupadmin' which are allowed to perform",
"certain administrative functions.  It can also be used by regular",
"users to list groups ('lg') and by the admin for all operations.",
" ",
"A blank execute line invokes the interactive mode, where it",
"prompts and executes commands until 'quit' or 'q' is entered.",
"Single or double quotes can be used to enter items with blanks.",
"Commands are:",
" lg [name] (list group info (user member list))",
" mkuser Name Password (make a user and set the initial password)",
" atg groupName userName[#Zone] (add to group - add a user to a group)",
" rfg groupName userName[#Zone] (remove from group - remove a user from a group)",
" mkgroup groupName[#Zone] (make a new group)",
" help (or h) [command] (this help, or more details on a command)",
""};
   printMsgs(Msgs);
   printReleaseInfo("igroupadmin");
}
Example #4
0
void
usage(char *subOpt)
{
   char *mkuserMsgs[]={
" mkuser Name Group Password (make user by a group-admin)",
"Create a new iRODS user in the ICAT database",
" ",
"Name is the user name to create",
"Group is the group to also add the user to",
"Password is the user's initial password",
" ",
"The user type will be automatically set to 'rodsuser' and the zone local."
""};

   char *lgMsgs[]={
" lg [name] (list group info (user member list))",
"Just 'lg' briefly lists the defined groups.",
"If you include a group name, it will list users who are",
"members of that group.  Users are listed in the user#zone format.",
"In addition to 'rodsadmin', any user can use this sub-command; this is",
"of most value to 'groupadmin' users who can also atg, rfg, and mkuser.",
""};

   char *atgMsgs[]={
" atg groupName userName[#userZone] (add to group - add a user to a group)",
"For remote-zone users, include the userZone.",
"Also see mkgroup, rfg and rmgroup.",
"In addition to the 'rodsadmin', users of type 'groupadmin' can atg and rfg",
"for groups they are members of.  They can see group membership via iuserinfo.",
""};

   char *rfgMsgs[]={
" rfg groupName userName[#userZone] (remove from group - remove a user from a group)",
"For remote-zone users, include the userZone.",
"Also see mkgroup, afg and rmgroup.",
"In addition to the 'rodsadmin', users of type 'groupadmin' can atg and rfg",
"for groups they are members of.  They can see group membership via iuserinfo.",
""};

   char *mkgroupMsgs[]={
" mkgroup groupName[#Zone] (make a new group)",
"Make a new group.  You will need to add yourself to the new group to then",
"be able to add and remove others (when the group is empty groupadmins are",
"allowed to add themselves.)",
""};

   char *helpMsgs[]={
" help (or h) [command] (general help, or more details on a command)",
" If you specify a command, a brief description of that command",
" will be displayed.",
""};

   char *subCmds[]={
                    "lg",
		    "mkuser",
		    "atg",
		    "rfg",
		    "mkgroup",
		    "help", "h",
		    ""};

   char **pMsgs[]={ 
                    lgMsgs,
		    mkuserMsgs,
		    atgMsgs, 
		    rfgMsgs,
		    mkgroupMsgs,
		    helpMsgs, helpMsgs };

   if (*subOpt=='\0') {
      usageMain();
   }
   else {
      int i;
      for (i=0;;i++) {
	 if (strlen(subCmds[i])==0) break;
	 if (strcmp(subOpt,subCmds[i])==0) {
	    printMsgs(pMsgs[i]);
	 }
      }
   }
}
Example #5
0
static void compareMsgPair (int burstNr, int msgNr)
{
  unsigned i;
  
  if (flag1 & canMSG_TXACK && flag2 & canMSG_TXACK) {
    printSomeStuff();
    printf("burstNr %d, msgNr %d\n", burstNr, msgNr);
    printMsgs();
    Error("The flags indicate tx_ack on both handles, flag1=%x, flag2=%x\n", flag1, flag2);
  }
  
  else if (flag1 & canMSG_TXACK) {
    // handle1 got a transmit ack and handle2 got a message
    
    if (((flag1 & (canMSG_STD | canMSG_EXT)) != (msgs1[i1].flags & (canMSG_STD | canMSG_EXT))) ||
        ((flag2 & (canMSG_STD | canMSG_EXT)) != (msgs1[i1].flags & (canMSG_STD | canMSG_EXT)))) {
      printSomeStuff();
      printf("burstNr %d, msgNr %d\n", burstNr, msgNr);
      printMsgs();
      Error("Sent and received msg identifier types don't match\n");
    }
    
    if (id1!=msgs1[i1].id || id2!=id1) {
      printSomeStuff();
      printf("burstNr %d, msgNr %d\n", burstNr, msgNr);
      printMsgs();
      Error("Ids don't match, msgs1[%d].id=%x, id1=%x, id2=%x\n", i1, msgs1[i1].id, id1, id2);
    }
    
    if (dlc1!=msgs1[i1].dlc || dlc2!=dlc1) {
      printSomeStuff();
      printf("burstNr %d, msgNr %d\n", burstNr, msgNr);
      printMsgs();
      Error("Dlc not correct, msgs1[%d].dlc=%d, dlc1=%d, dlc2=%d\n", i1, msgs1[i1].dlc, dlc1, dlc2);
    }
    
    for (i=0; i<dlc1; i++) {
      if (data1[i]!=msgs1[i1].data[i] || data1[i]!=data2[i]) {
        printSomeStuff();
        printf("burstNr %d, msgNr %d\n", burstNr, msgNr);
        printMsgs();
        Error("Data wrong, msgs1[%d].data[%d]=%d, data1[%d]=%d, data2[%d]=%d\n",
               i1, i, msgs1[i1].data[i], i, data1[i], i, data2[i]);
      }
    }
    
    i1++;
  }
  
  else if (flag2 & canMSG_TXACK) {
    // handle2 got a transmit ack and handle1 got a message
    
    if (((flag1 & (canMSG_STD | canMSG_EXT)) != (msgs2[i2].flags & (canMSG_STD | canMSG_EXT))) ||
        ((flag2 & (canMSG_STD | canMSG_EXT)) != (msgs2[i2].flags & (canMSG_STD | canMSG_EXT)))) {
      printSomeStuff();
      printf("burstNr %d, msgNr %d\n", burstNr, msgNr);
      printMsgs();
      Error("Sent and received msg identifier types don't match\n");
    }
    
    if (id1!=msgs2[i2].id || id2!=id1) {
      printSomeStuff();
      printf("burstNr %d, msgNr %d\n", burstNr, msgNr);
      printMsgs();
      Error("Ids don't match, msgs2[%d].id=%x, id1=%x, id2=%x\n", i1, msgs2[i2].id, id1, id2);
    }
    
    if (dlc1!=msgs2[i2].dlc || dlc2!=dlc1) {
      printSomeStuff();
      printf("burstNr %d, msgNr %d\n", burstNr, msgNr);
      printMsgs();
      Error("Dlc not correct, msgs2[%d].dlc=%d, dlc1=%d, dlc2=%d\n", i1, msgs2[i2].dlc, dlc1, dlc2);
    }
    
    for (i=0; i<dlc1; i++) {
      if (data1[i]!=msgs2[i2].data[i] || data1[i]!=data2[i]) {
        printSomeStuff();
        printf("burstNr %d, msgNr %d\n", burstNr, msgNr);
        printMsgs();
        Error("Data wrong, msgs2[%d].data[%d]=%d, data1[%d]=%d, data2[%d]=%d\n",
               i2, i, msgs2[i2].data[i], i, data1[i], i, data2[i]);
      }
    }
    
    i2++;
  } else {
    printSomeStuff();
    printf("burstNr %d, msgNr %d\n", burstNr, msgNr);
    printMsgs();
    Error("None of the handles reported a tx_ack, flag1=%x, flag2=%x\n", flag1, flag2);
  }
}