mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 15:52:43 +00:00 
			
		
		
		
	 75ed262fe5
			
		
	
	
		75ed262fe5
		
	
	
	
	
		
			
			This defaults to 1500 for all adapters, but LoopbackAdapter increases it to 65536 on construction. If an IPv4 packet is larger than the MTU, we'll need to break it into smaller fragments before transmitting it. This part is a FIXME. :^)
		
			
				
	
	
		
			25 lines
		
	
	
	
		
			481 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
	
		
			481 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #include <Kernel/Net/LoopbackAdapter.h>
 | |
| 
 | |
| LoopbackAdapter& LoopbackAdapter::the()
 | |
| {
 | |
|     static LoopbackAdapter* the;
 | |
|     if (!the)
 | |
|         the = new LoopbackAdapter;
 | |
|     return *the;
 | |
| }
 | |
| 
 | |
| LoopbackAdapter::LoopbackAdapter()
 | |
| {
 | |
|     set_interface_name("loop");
 | |
|     set_mtu(65536);
 | |
| }
 | |
| 
 | |
| LoopbackAdapter::~LoopbackAdapter()
 | |
| {
 | |
| }
 | |
| 
 | |
| void LoopbackAdapter::send_raw(const u8* data, int size)
 | |
| {
 | |
|     dbgprintf("LoopbackAdapter: Sending %d byte(s) to myself.\n", size);
 | |
|     did_receive(data, size);
 | |
| }
 |