mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:42:43 +00:00 
			
		
		
		
	 6e19ab2bbc
			
		
	
	
		6e19ab2bbc
		
	
	
	
	
		
			
			We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
		
			
				
	
	
		
			31 lines
		
	
	
	
		
			843 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
	
		
			843 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2020, the SerenityOS developers.
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include "DHCPv4Client.h"
 | |
| #include <LibCore/ArgsParser.h>
 | |
| #include <LibCore/EventLoop.h>
 | |
| #include <LibCore/System.h>
 | |
| #include <LibMain/Main.h>
 | |
| 
 | |
| ErrorOr<int> serenity_main(Main::Arguments args)
 | |
| {
 | |
|     Vector<DeprecatedString> interfaces;
 | |
| 
 | |
|     Core::ArgsParser parser;
 | |
|     parser.add_positional_argument(interfaces, "Interfaces to run DHCP server on", "interfaces");
 | |
|     parser.parse(args);
 | |
| 
 | |
|     TRY(Core::System::pledge("stdio unix inet cpath rpath"));
 | |
|     Core::EventLoop event_loop;
 | |
| 
 | |
|     TRY(Core::System::unveil("/sys/kernel/net/", "r"));
 | |
|     TRY(Core::System::unveil(nullptr, nullptr));
 | |
| 
 | |
|     auto client = TRY(DHCPv4Client::try_create(interfaces));
 | |
| 
 | |
|     TRY(Core::System::pledge("stdio inet cpath rpath"));
 | |
|     return event_loop.exec();
 | |
| }
 |