Ipv4hook.ned 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // This program is property of its copyright holder. All rights reserved.
  3. //
  4. package inet.examples.inet.ipv4hook;
  5. import inet.networklayer.common.NetfilterInfoHook;
  6. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  7. import inet.node.inet.Router;
  8. import inet.node.inet.StandardHost;
  9. import ned.DatarateChannel;
  10. module MyHost extends StandardHost
  11. {
  12. submodules:
  13. iPv4HookInfo: NetfilterInfoHook {
  14. @display("p=626,265");
  15. }
  16. }
  17. module MyRouter extends Router
  18. {
  19. submodules:
  20. iPv4HookInfo: NetfilterInfoHook {
  21. @display("p=524,98");
  22. }
  23. }
  24. //
  25. // TODO Auto-generated network
  26. //
  27. network Ipv4hook
  28. {
  29. types:
  30. channel C extends DatarateChannel
  31. {
  32. datarate = 10Mbps;
  33. delay = 0.1us;
  34. }
  35. submodules:
  36. host1: MyHost {
  37. @display("p=43,70");
  38. }
  39. host2: MyHost {
  40. @display("p=271,70");
  41. }
  42. router: MyRouter {
  43. @display("p=157,197");
  44. }
  45. configurator: IPv4NetworkConfigurator {
  46. @display("p=112,278");
  47. }
  48. connections:
  49. host1.ethg++ <--> C <--> router.ethg++;
  50. host2.ethg++ <--> C <--> router.ethg++;
  51. }