Commit 4c66089e authored by Yann Garcia's avatar Yann Garcia
Browse files

Add log in its_bridge_client

parent e3b738e3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=its_bridge
PKG_REFV:=2
PKG_VERSION:=0.0.12
PKG_VERSION:=0.0.1
PKG_RELEASE:=1

include $(INCLUDE_DIR)/package.mk
+2 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ void sig_usr1_handler(int p_signal) {
}

void pcap_message_callback(u_char* p_args, const struct pcap_pkthdr* p_pkthdr, const u_char* p_packet) {
  printf("pcap_message_callback: packet sent to %s:%d.\n", inet_ntoa(remote_addr.sin_addr), htons(remote_addr.sin_port));
  if (sendto(socket_hd, p_packet, p_pkthdr->caplen, 0, (struct sockaddr*)&remote_addr, sizeof(remote_addr)) < 0) {
    fprintf(stderr, "pcap_message_callback: 'sento' failure: %s, continue.\n", strerror(errno));
  }
@@ -238,6 +239,7 @@ int main(const int32_t p_argc, char* const p_argv[]) {
          if (pcap_setfilter(device, &f) != 0) {
            fprintf(stderr, "Failed to set PCAP filter.\n");
            pcap_close(device);
	    pcap_freecode(&f);
            goto error;
          }
        }