Fix some warnings.

This commit is contained in:
Matjaz Mesnjak
2022-01-17 18:46:53 +01:00
parent c1e8ab1593
commit 42f40c2275

View File

@ -333,7 +333,7 @@ int main(int argc, char *argv[])
//frame_size = frame_size - (512 - n); //frame_size = frame_size - (512 - n);
if((pcap_inject(device.handle, (void*)frame, frame_size)) != -1) { if((pcap_inject(device.handle, (void*)frame, frame_size)) != -1) {
usleep(100000); usleep(100000);
printf(FPURPLE BBLACK"Frame sent: %iB\n"NONE, frame_size); printf(FPURPLE BBLACK"Frame sent: %liB\n"NONE, frame_size);
} else { } else {
printf("Frame not sent\n"); printf("Frame not sent\n");
} }
@ -533,7 +533,7 @@ int main(int argc, char *argv[])
ipx_packet = (ipx_frame_t *)buf3; ipx_packet = (ipx_frame_t *)buf3;
printf("Preparing to transmit packet: %x\n", ipx_packet->checksum); printf("Preparing to transmit packet: %x\n", ipx_packet->checksum);
ipx_packet_size = (size_t)ntohs(ipx_packet->length); ipx_packet_size = (size_t)ntohs(ipx_packet->length);
printf("IPX packet size: %iB\n", ipx_packet_size); printf("IPX packet size: %liB\n", ipx_packet_size);
memcpy(&ethernet_packet->ipxpacket, ipx_packet, ipx_packet_size); memcpy(&ethernet_packet->ipxpacket, ipx_packet, ipx_packet_size);
// ethernet_packet->dest_mac[0] = ipx_packet->dest_node[0]; // ethernet_packet->dest_mac[0] = ipx_packet->dest_node[0];
// ethernet_packet->dest_mac[1] = ipx_packet->dest_node[1]; // ethernet_packet->dest_mac[1] = ipx_packet->dest_node[1];
@ -546,7 +546,7 @@ int main(int argc, char *argv[])
ethernet_packet->src_mac[2] = ipx_packet->src_node[2]; ethernet_packet->src_mac[2] = ipx_packet->src_node[2];
ethernet_packet->ethertype = htons(0x8137); ethernet_packet->ethertype = htons(0x8137);
ethernet_size = sizeof(ethernet_frame_t) + ipx_packet_size; ethernet_size = sizeof(ethernet_frame_t) + ipx_packet_size;
printf("Size of ethernet packet: %iB\n", ethernet_size); printf("Size of ethernet packet: %liB\n", ethernet_size);
if((pcap_inject(device.handle, (void*)ethernet_packet, ethernet_size)) != -1) { if((pcap_inject(device.handle, (void*)ethernet_packet, ethernet_size)) != -1) {
usleep(100000); usleep(100000);
@ -754,7 +754,7 @@ int main(int argc, char *argv[])
spx_packet = (spx_frame_t *)buf3; spx_packet = (spx_frame_t *)buf3;
printf("Preparing to transmit packet: %x\n", spx_packet->checksum); printf("Preparing to transmit packet: %x\n", spx_packet->checksum);
ipx_packet_size = (size_t)ntohs(spx_packet->length); ipx_packet_size = (size_t)ntohs(spx_packet->length);
printf("IPX packet size: %iB\n", ipx_packet_size); printf("IPX packet size: %liB\n", ipx_packet_size);
memcpy(&ethernet_packet->ipxpacket, ipx_packet, ipx_packet_size); memcpy(&ethernet_packet->ipxpacket, ipx_packet, ipx_packet_size);
ethernet_packet->dest_mac[0] = ipx_packet->dest_node[0]; ethernet_packet->dest_mac[0] = ipx_packet->dest_node[0];
ethernet_packet->dest_mac[1] = ipx_packet->dest_node[1]; ethernet_packet->dest_mac[1] = ipx_packet->dest_node[1];
@ -767,7 +767,7 @@ int main(int argc, char *argv[])
ethernet_packet->src_mac[2] = ipx_packet->src_node[2]; ethernet_packet->src_mac[2] = ipx_packet->src_node[2];
ethernet_packet->ethertype = htons(0x8137); ethernet_packet->ethertype = htons(0x8137);
ethernet_size = sizeof(ethernet_frame_t) + ipx_packet_size; ethernet_size = sizeof(ethernet_frame_t) + ipx_packet_size;
printf("Size of ethernet packet: %iB\n", ethernet_size); printf("Size of ethernet packet: %liB\n", ethernet_size);
if((pcap_inject(device.handle, (void*)ethernet_packet, ethernet_size)) != -1) { if((pcap_inject(device.handle, (void*)ethernet_packet, ethernet_size)) != -1) {
usleep(100000); usleep(100000);