xref: /haiku/src/servers/net/AutoconfigLooper.h (revision b46615c55ad2c8fe6de54412055a0713da3d610a)
1 /*
2  * Copyright 2006-2008, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Axel Dörfler, axeld@pinc-software.de
7  */
8 #ifndef AUTOCONFIG_LOOPER_H
9 #define AUTOCONFIG_LOOPER_H
10 
11 
12 #include <Looper.h>
13 #include <Messenger.h>
14 #include <String.h>
15 #include <netinet6/in6.h>
16 
17 class AutoconfigClient;
18 
19 class AutoconfigLooper : public BLooper {
20 public:
21 								AutoconfigLooper(BMessenger target,
22 									const char* device);
23 	virtual						~AutoconfigLooper();
24 
25 	virtual	void				MessageReceived(BMessage* message);
26 
27 			BMessenger			Target() const { return fTarget; }
28 
29 private:
30 			void				_RemoveClient();
31 			void				_ConfigureIPv4();
32 			void				_ConfigureIPv6LinkLocal(bool add);
33 			bool				_AddIPv6LinkLocal(int socket, const in6_addr &);
34 			void				_RemoveIPv6LinkLocal(int socket, const in6_addr &);
35 			void				_ReadyToRun();
36 
37 			BMessenger			fTarget;
38 			BString				fDevice;
39 			AutoconfigClient*	fCurrentClient;
40 			uint8				fCurrentMac[6];
41 };
42 
43 #endif	// AUTOCONFIG_LOOPER_H
44