network.c 617 B

1234567891011121314151617181920212223242526
  1. //
  2. // Created by janco on 25-2-16.
  3. //
  4. #include <dev/board.h>
  5. #include <sys/timer.h>
  6. #include <sys/confnet.h>
  7. #include <dev/nicrtl.h>
  8. #include <stdio.h>
  9. #include <io.h>
  10. #include <arpa/inet.h>
  11. #include <pro/dhcp.h>
  12. #include "network.h"
  13. void NetworkInit() {
  14. /* Register de internet controller. */
  15. if (NutRegisterDevice(&DEV_ETHER, 0, 0)) {
  16. printf("Registering failed.");
  17. }/* Netwerk configureren op dhcp */
  18. else if (NutDhcpIfConfig(DEV_ETHER_NAME, NULL, 0)) {
  19. /* Done. */
  20. }else {
  21. printf("Ik heb een internet connectie. Ip is: %s", inet_ntoa(confnet.cdn_ip_addr));
  22. }
  23. }