comparison rvinterf/etm/etmbasic.c @ 184:4714fdfca39c

fc-tmsh compiles!
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 24 Nov 2013 08:40:44 +0000
parents 85222710dc92
children 9f4f331ac24d
comparison
equal deleted inserted replaced
183:85222710dc92 184:4714fdfca39c
5 #include <sys/types.h> 5 #include <sys/types.h>
6 #include <stdio.h> 6 #include <stdio.h>
7 #include <string.h> 7 #include <string.h>
8 #include <strings.h> 8 #include <strings.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include "../pktmux.h"
10 #include "../limits.h" 11 #include "../limits.h"
11 12
12 extern u_char rvi_msg[]; 13 extern u_char rvi_msg[];
13 extern int rvi_msg_len; 14 extern int rvi_msg_len;
14 15
31 c ^= rvi_msg[i]; 32 c ^= rvi_msg[i];
32 } 33 }
33 sprintf(dp, " chksum %s", c ? "BAD" : "OK"); 34 sprintf(dp, " chksum %s", c ? "BAD" : "OK");
34 async_msg_output(buf); 35 async_msg_output(buf);
35 } 36 }
37
38 void
39 cmd_etmpkt(argc, argv)
40 char **argv;
41 {
42 u_char pkt[MAX_PKT_TO_TARGET];
43 int di, c, b;
44 char **ap;
45
46 pkt[0] = RVT_TM_HEADER;
47 di = 1;
48 c = 0;
49 for (ap = argv + 1; *ap; ap++) {
50 b = strtoul(*ap, 0, 16);
51 pkt[di++] = b;
52 c ^= b;
53 }
54 pkt[di++] = c;
55 send_pkt_to_target(pkt, di);
56 }