Fork of the vendor (Boundary Devices) u-boot for Reform 2, with minor tweaks. The goal is to migrate to mainstream u-boot or barebox ASAP. The main impediment so far is the 4GB RAM config.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 
 

39 lines
813 B

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <unistd.h>
  4. #include <sys/socket.h>
  5. #include <netinet/in.h>
  6. int main (int argc, char *argv[])
  7. {
  8. int s, len, o, port = 6666;
  9. char buf[512];
  10. struct sockaddr_in addr;
  11. socklen_t addr_len = sizeof addr;
  12. if (argc > 1)
  13. port = atoi (argv[1]);
  14. s = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP);
  15. o = 1;
  16. len = 4;
  17. setsockopt (3, SOL_SOCKET, SO_REUSEADDR, &o, len);
  18. addr.sin_family = AF_INET;
  19. addr.sin_port = htons (port);
  20. addr.sin_addr.s_addr = INADDR_ANY; /* receive broadcasts */
  21. bind (s, (struct sockaddr *) &addr, sizeof addr);
  22. for (;;) {
  23. len = recvfrom (s, buf, sizeof buf, 0, (struct sockaddr *) &addr, &addr_len);
  24. if (len < 0)
  25. break;
  26. if (write (1, buf, len) != len)
  27. fprintf(stderr, "WARNING: serial characters dropped\n");
  28. }
  29. return 0;
  30. }