Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2018
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.81 KB | None | 0 0
  1. gcc -c -o icmp.o icmp.c -I. -O3 -Wall
  2. icmp.c:23:47: warning: declaration of 'struct icmphdr' will not be visible outside of this
  3. function [-Wvisibility]
  4. void prepare_headers(struct iphdr *ip, struct icmphdr *icmp);
  5. ^
  6. icmp.c:104:40: error: invalid application of 'sizeof' to an incomplete type
  7. 'struct icmphdr'
  8. packet_size = sizeof(struct iphdr) + sizeof(struct icmphdr) + packet_details->pa...
  9. ^ ~~~~~~~~~~~~~~~~
  10. icmp.c:93:10: note: forward declaration of 'struct icmphdr'
  11. struct icmphdr *icmp;
  12. ^
  13. icmp.c:115:59: error: invalid application of 'sizeof' to an incomplete type
  14. 'struct icmphdr'
  15. icmp_payload = (char *)(packet + sizeof(struct iphdr) + sizeof(struct icmphdr));
  16. ^ ~~~~~~~~~~~~~~~~
  17. icmp.c:93:10: note: forward declaration of 'struct icmphdr'
  18. struct icmphdr *icmp;
  19. ^
  20. icmp.c:117:23: warning: incompatible pointer types passing 'struct icmphdr *' to parameter
  21. of type 'struct icmphdr *' [-Wincompatible-pointer-types]
  22. prepare_headers(ip, icmp);
  23. ^~~~
  24. icmp.c:23:56: note: passing argument to parameter 'icmp' here
  25. void prepare_headers(struct iphdr *ip, struct icmphdr *icmp);
  26. ^
  27. icmp.c:125:7: error: incomplete definition of type 'struct icmphdr'
  28. icmp->type = packet_details->type;
  29. ~~~~^
  30. icmp.c:93:10: note: forward declaration of 'struct icmphdr'
  31. struct icmphdr *icmp;
  32. ^
  33. icmp.c:126:7: error: incomplete definition of type 'struct icmphdr'
  34. icmp->checksum = 0;
  35. ~~~~^
  36. icmp.c:93:10: note: forward declaration of 'struct icmphdr'
  37. struct icmphdr *icmp;
  38. ^
  39. icmp.c:127:7: error: incomplete definition of type 'struct icmphdr'
  40. icmp->checksum = in_cksum((unsigned short *)icmp, sizeof(struct icmphdr) + packe...
  41. ~~~~^
  42. icmp.c:93:10: note: forward declaration of 'struct icmphdr'
  43. struct icmphdr *icmp;
  44. ^
  45. icmp.c:127:53: error: invalid application of 'sizeof' to an incomplete type
  46. 'struct icmphdr'
  47. icmp->checksum = in_cksum((unsigned short *)icmp, sizeof(struct icmphdr) + packe...
  48. ^ ~~~~~~~~~~~~~~~~
  49. icmp.c:93:10: note: forward declaration of 'struct icmphdr'
  50. struct icmphdr *icmp;
  51. ^
  52. icmp.c:157:42: error: invalid application of 'sizeof' to an incomplete type
  53. 'struct icmphdr'
  54. enc_MTU = MTU + sizeof(struct iphdr) + sizeof(struct icmphdr);
  55. ^ ~~~~~~~~~~~~~~~~
  56. icmp.c:148:10: note: forward declaration of 'struct icmphdr'
  57. struct icmphdr *icmp;
  58. ^
  59. icmp.c:173:59: error: invalid application of 'sizeof' to an incomplete type
  60. 'struct icmphdr'
  61. icmp_payload = (char *)(packet + sizeof(struct iphdr) + sizeof(struct icmphdr));
  62. ^ ~~~~~~~~~~~~~~~~
  63. icmp.c:148:10: note: forward declaration of 'struct icmphdr'
  64. struct icmphdr *icmp;
  65. ^
  66. icmp.c:178:30: error: incomplete definition of type 'struct icmphdr'
  67. packet_details->type = icmp->type;
  68. ~~~~^
  69. icmp.c:148:10: note: forward declaration of 'struct icmphdr'
  70. struct icmphdr *icmp;
  71. ^
  72. icmp.c:179:71: error: invalid application of 'sizeof' to an incomplete type
  73. 'struct icmphdr'
  74. ...= packet_size - sizeof(struct iphdr) - sizeof(struct icmphdr);
  75. ^ ~~~~~~~~~~~~~~~~
  76. icmp.c:148:10: note: forward declaration of 'struct icmphdr'
  77. struct icmphdr *icmp;
  78. ^
  79. icmp.c:233:47: warning: declaration of 'struct icmphdr' will not be visible outside of
  80. this function [-Wvisibility]
  81. void prepare_headers(struct iphdr *ip, struct icmphdr *icmp)
  82. ^
  83. icmp.c:233:6: error: conflicting types for 'prepare_headers'
  84. void prepare_headers(struct iphdr *ip, struct icmphdr *icmp)
  85. ^
  86. icmp.c:23:6: note: previous declaration is here
  87. void prepare_headers(struct iphdr *ip, struct icmphdr *icmp);
  88. ^
  89. icmp.c:243:7: error: incomplete definition of type 'struct icmphdr'
  90. icmp->code = 0;
  91.  
  92. icmp.c:233:47: warning: declaration of 'struct icmphdr' will not be visible outside of
  93. this function [-Wvisibility]
  94. void prepare_headers(struct iphdr *ip, struct icmphdr *icmp)
  95. ^
  96. icmp.c:233:6: error: conflicting types for 'prepare_headers'
  97. void prepare_headers(struct iphdr *ip, struct icmphdr *icmp)
  98. ^
  99. icmp.c:23:6: note: previous declaration is here
  100. void prepare_headers(struct iphdr *ip, struct icmphdr *icmp);
  101. ^
  102. icmp.c:243:7: error: incomplete definition of type 'struct icmphdr'
  103. icmp->code = 0;
  104. ~~~~^
  105. icmp.c:233:47: note: forward declaration of 'struct icmphdr'
  106. void prepare_headers(struct iphdr *ip, struct icmphdr *icmp)
  107. ^
  108. icmp.c:244:7: error: incomplete definition of type 'struct icmphdr'
  109. icmp->un.echo.sequence = rand();
  110. ~~~~^
  111. icmp.c:233:47: note: forward declaration of 'struct icmphdr'
  112. void prepare_headers(struct iphdr *ip, struct icmphdr *icmp)
  113. ^
  114. icmp.c:245:7: error: incomplete definition of type 'struct icmphdr'
  115. icmp->un.echo.id = rand();
  116. ~~~~^
  117. icmp.c:233:47: note: forward declaration of 'struct icmphdr'
  118. void prepare_headers(struct iphdr *ip, struct icmphdr *icmp)
  119. ^
  120. icmp.c:246:7: error: incomplete definition of type 'struct icmphdr'
  121. icmp->checksum = 0;
  122. ~~~~^
  123. icmp.c:233:47: note: forward declaration of 'struct icmphdr'
  124. void prepare_headers(struct iphdr *ip, struct icmphdr *icmp)
  125. ^
  126. 3 warnings and 15 errors generated.
  127. make: *** [Makefile:6: icmp.o] Error 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement