]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-rx.c
spell ASCII in uppercase
[tcpdump] / print-rx.c
index 246ba6fe3871e484503660c34ab0d0a7ca21c2e9..9df6b6aeec522b73ef977074fb53d3265811320b 100644 (file)
@@ -20,6 +20,9 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
+
+/* \summary: AFS RX printer */
+
 /*
  * This code unmangles RX packets.  RX is the mutant form of RPC that AFS
  * uses to communicate between clients and servers.
@@ -39,9 +42,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <tcpdump-stdinc.h>
+#include <netdissect-stdinc.h>
 
-#include "interface.h"
+#include "netdissect.h"
 #include "addrtoname.h"
 #include "extract.h"
 
@@ -688,8 +691,8 @@ rx_cache_insert(netdissect_options *ndo,
                rx_cache_next = 0;
 
        rxent->callnum = rxh->callNumber;
-       rxent->client = ip->ip_src;
-       rxent->server = ip->ip_dst;
+       UNALIGNED_MEMCPY(&rxent->client, &ip->ip_src, sizeof(uint32_t));
+       UNALIGNED_MEMCPY(&rxent->server, &ip->ip_dst, sizeof(uint32_t));
        rxent->dport = dport;
        rxent->serviceId = rxh->serviceId;
        rxent->opcode = EXTRACT_32BITS(bp + sizeof(struct rx_header));
@@ -708,8 +711,11 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, int sport,
 {
        int i;
        struct rx_cache_entry *rxent;
-       uint32_t clip = ip->ip_dst.s_addr;
-       uint32_t sip = ip->ip_src.s_addr;
+       uint32_t clip;
+       uint32_t sip;
+
+       UNALIGNED_MEMCPY(&clip, &ip->ip_dst, sizeof(uint32_t));
+       UNALIGNED_MEMCPY(&sip, &ip->ip_src, sizeof(uint32_t));
 
        /* Start the search where we last left off */
 
@@ -1132,7 +1138,7 @@ trunc:
  *
  * "positive" and "negative" are integers which contain the number of
  * positive and negative ACL's in the string.  The uid/aclbits pair are
- * ASCII strings containing the UID/PTS record and and a ascii number
+ * ASCII strings containing the UID/PTS record and an ASCII number
  * representing a logical OR of all the ACL permission bits
  */
 
@@ -1918,7 +1924,7 @@ kauth_print(netdissect_options *ndo,
        bp += sizeof(struct rx_header) + 4;
 
        switch (kauth_op) {
-               case 1:         /* Authenticate old */;
+               case 1:         /* Authenticate old */
                case 21:        /* Authenticate */
                case 22:        /* Authenticate-V2 */
                case 2:         /* Change PW */