⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 _afs.c

📁 This directory contains source code for tcpdump, a tool for network monitoring and data acquisition
💻 C
📖 第 1 页 / 共 2 页
字号:
    PRINTF ("%s.%s.%08x.%04x < %s.%s: ",
            ipaddr_string (&ip->ip_dst), dport,
            ntohl (rp->cid), ntohl (rp->callNumber),
            ipaddr_string (&ip->ip_src), sport);
  }

  PRINTF ("%2x.", rp->seq);

  rp++;
  ap = (struct rx_ackPacket*) rp;

  if (&ap->nAcks > snapend)
  {
    PUTS ("00 ack-truncated ");
    return;
  }

  PRINTF ("%04x ack %c %x",
          ntohl (ap->serial), rx_ackReasons[(int)ap->reason],
          ntohl (ap->firstPacket));

  if (ap->nAcks)
  {
    int offset;

    for (offset = 0; offset < ap->nAcks; offset++)
    {
      if (&(ap->acks[offset]) > snapend)
           PRINTF ("+%dacks ", ap->nAcks - offset);
      else PUTCHAR (ap->acks[offset] == RX_ACK_TYPE_NACK ? '-' : '*');
    }
  }
}

static void afsreq_print (u_long *rp, int length, struct ip *ip)
{
  u_long op = ntohl (*rp);

  if (op >= AFSOP_LowestOpcode && op <= AFSOP_HighestOpcode)
     PRINTF (" %s", (afsopstrings[op - AFSOP_LowestOpcode]));

  switch (op)
  {
    case AFSOP_FetchStatus:
    case AFSOP_StoreStatus:
    case AFSOP_SetLock:
    case AFSOP_ExtendLock:
    case AFSOP_ReleaseLock:
    case AFSOP_FetchACL:
    case AFSOP_StoreACL:
         printfid (rp+1);
         break;
    case AFSOP_CallBack:
         printfid (rp+2);
         break;
    case AFSOP_RemoveFile:  /* the rest of these guys fids are for parent */
    case AFSOP_CreateFile:
    case AFSOP_Rename:
    case AFSOP_Symlink:
    case AFSOP_Link:
    case AFSOP_MakeDir:
    case AFSOP_RemoveDir:
    case AFSOP_Lookup:
    case AFSOP_DFSSymlink:
         printfid (rp+1);
         printname (*(rp+4), (char*)(rp+5));
         break;
    case AFSOP_FetchData:   /* also print out pos and len */
         printfid (rp+1);
         printlong (rp+4);
         printlong (rp+5);
         break;
    case AFSOP_StoreData:   /* fid, pos, len, file len */
         printfid (rp + 1);
         printlong (rp+10);
         printlong (rp+11);
         printlong (rp+12);
         break;
    case AFSOP_GetVolumeInfo:
         printname (*(rp+1), (char*)(rp+2));
         break;
  }
}

static void kasreq_print (u_long *rp, int length, struct ip *ip)
{
  u_long op = ntohl (*rp);

  if (op >= KASOP_LowestOpcode && op <= KASOP_HighestOpcode)
     PRINTF (" %s", (kasopstrings[op - KASOP_LowestOpcode]));

  switch (op)
  {
    case KASOP_Authenticate_old:
    case KASOP_Authenticate:
    case KASOP_ChangePassword:
    case KASOP_SetPassword:
    case KASOP_SetFields:
    case KASOP_CreateUser:
    case KASOP_DeleteUser:
    case KASOP_GetEntry:
    case KASOP_GetPassword:
         printname (*(rp+1), (char*)(rp+2));
  }
}

static void ubik_print (u_long *rp, int length, struct ip *ip)
{
  u_long op = ntohl (*rp);

  if (op >= UVOTE_LowestOpcode && op <= UVOTE_HighestOpcode)
       PRINTF (" %s", (UVOTE_opstrings[op - UVOTE_LowestOpcode]));
  else if (op >= UDISK_LowestOpcode && op <= UDISK_HighestOpcode)
       PRINTF (" %s", (UDISK_opstrings[op - UDISK_LowestOpcode]));

#if 0
  switch (op)
  {
    case VOTE_BEACON:
    case VOTE_DEBUG:
    case VOTE_SDEBUG:
    case VOTE_GETSYNCSITE:
    case DISK_BEGIN:
    case DISK_COMMIT:
    case DISK_LOCK:
    case DISK_WRITE:
    case DISK_GETVERSION:
    case DISK_GETFILE:
    case DISK_SENDFILE:
    case DISK_ABORT:
    case DISK_RELEASELOCKS:
    case DISK_TRUNCATE:
    case DISK_PROBE:
         break;
  }
#endif
}

static void vlsreq_print (u_long *rp, int length, struct ip *ip)
{
  u_long op = ntohl (*rp);

  if (op >= VLSOP_LowestOpcode && op <= VLSOP_HighestOpcode)
     PRINTF (" %s", (vlsopstrings[op - VLSOP_LowestOpcode]));

  switch (op)
  {
    case VLSOP_GetEntryByID:
    case VLGETENTRYBYIDN:
    case VLDELETEENTRY:
    case VLREPLACEENTRY:
    case VLREPLACEENTRYN:
    case VLUPDATEENTRY:
    case VLSETLOCK:
    case VLRELEASELOCK:
         printlong (rp+1);
         break;
    case VLUPDATEENTRYBYNAME:
    case VLGETENTRYBYNAMEN:
    case VLSOP_GetEntryByName:
         printname (*(rp+1), (char*)(rp+2));
         break;
    case VLCHANGEADDR:
         printlong (rp+1);
         printlong (rp+2);
         break;
    case VLCREATEENTRY:
    case VLCREATEENTRYN:
    case VLGETNEWVOLUMEID:
    case VLLISTENTRY:
    case VLLISTENTRYN:
    case VLLISTATTRIBUTES:
    case VLLISTATTRIBUTESN:
    case VLLINKEDLIST:
    case VLLINKEDLISTN:
    case VLGETSTATS:
    case VLPROBE:
         break;
  }
}

static void ptsreq_print (u_long *rp, int length, struct ip *ip)
{
  u_long op = ntohl (*rp);

  if (op >= PTSOP_LowestOpcode && op <= PTSOP_HighestOpcode)
     PRINTF (" %s", (ptsopstrings[op - PTSOP_LowestOpcode]));

  switch (op)
  {
    case PRINEWUSER:
         printname (*(rp+1), (char*)(rp+2));
         break;
    case PRWHEREISIT:
    case PRDUMPENTRY:
         printlong (rp+1);
         break;
    case PRADDTOGROUP:
         printlong (rp+1);
         printlong (rp+2);
         break;
    case PRNAMETOID:
         printname2 (*(rp+2), (u_long*)(rp+3));
         break;
    case PRIDTONAME:
         printlong (rp+1);
         printlong (rp+2);
         break;
    case PRDELETE:
         printlong (rp+1);
         break;
    case PRREMOVEFROMGROUP:
         printlong (rp+1);
         printlong (rp+2);
         break;
    case PRGETCPS:
         printlong (rp+1);
         break;
    case PRNEWENTRY:
         printname (*(rp+1), (char*)(rp+2));
         break;
    case PRLISTMAX:
    case PRSETMAX:
         printlong (rp+1);
         printlong (rp+2);
         break;
    case PRLISTENTRY:
         printname (*(rp+1), (char*)(rp+2));
         break;
    case PRCHANGEENTRY:
         printlong (rp+1);
         printname (*(rp+2), (char*)(rp+3));
         break;
    case PRLISTELEMENTS:
         printlong (rp+1);
         break;
    case PRISAMEMBEROF:
         printlong (rp+1);
         printlong (rp+2);
         break;
    case PRSETFIELDSENTRY:
         printlong (rp+1);
         printlong (rp+2);
         break;
    case PRLISTOWNED:
         printlong (rp+1);
         break;
    case PRGETCPS2:
         printlong (rp+1);
         printlong (rp+2);
         break;
    case PRGETHOSTCPS:
         printhost (rp+1);
         break;
  }
}

static void volreq_print (u_long *rp, int length, struct ip *ip)
{
  u_long op = ntohl (*rp);

  if (op >= VOLOP_LowestOpcode && op <= VOLOP_HighestOpcode)
     PRINTF (" %s", (volopstrings[op - VOLOP_LowestOpcode]));

  switch (op)
  {
    case VOLDELETEVOLUME:
    case VOLRESTORE:
    case VOLFORWARD:
    case VOLENDTRANS:
    case VOLCLONE:
    case VOLSETFLAGS:
    case VOLGETFLAGS:
    case VOLDUMP:
    case VOLSETFORWARDING:
    case VOLGETNAME:
    case VOLGETSTATUS:
    case VOLSETIDSTYPES:
    case VOLRECLONE:
         printlong (rp+1);
         break;
    case VOLNUKE:
    case VOLSETDATE:
    case VOLXLISTVOLS:
    case VOLXLISTONEVOL:
    case VOLSETINFO:
    case VOLXLISTPARTITIONS:
    case VOLFORWARDMULTIPLE:
    case VOLTRANSCREATE:
    case VOLCREATEVOLUME:
    case VOLGETNTHVOLUME:
    case VOLSIGRESTORE:
    case VOLLISTPARTITIONS:
    case VOLLISTONEVOL:
    case VOLLISTVOLS:
    case VOLDISKPART:
    case VOLMONITOR:
         break;
  }
}

static void rxkreq_print (u_long *rp, int length, struct ip *ip)
{
  u_long op = ntohl (*rp);

  if (op >= RXKST_LOWEST_OPCODE && op <= RXKST_HIGHEST_OPCODE)
     PRINTF (" %s", (rxkopstrings[op - RXKST_LOWEST_OPCODE]));

  switch (op)
  {
    case RXKST_Fast:
    case RXKST_Slow:
         printlong (rp+1);
         break;
    case RXKST_Copious:
         printlong (rp+1);
         printlong (rp+2);
         printlong (rp+3);
         break;
    case RXKST_Kill:
         break;
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -