vfs: check userland buffers before reading them.
[haiku.git] / headers / os / add-ons / network_settings / NetworkProfile.h
blobda26f51de3aef9e55ebcd067b09615ca0dea9d36
1 /*
2 * Copyright 2004-2015 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _NETWORK_PROFILE_H
6 #define _NETWORK_PROFILE_H
9 #include <Entry.h>
10 #include <Path.h>
13 namespace BNetworkKit {
16 class BNetworkProfile {
17 public:
18 BNetworkProfile();
19 BNetworkProfile(const char* path);
20 BNetworkProfile(const entry_ref& ref);
21 BNetworkProfile(const BEntry& entry);
22 virtual ~BNetworkProfile();
24 status_t SetTo(const char* path);
25 status_t SetTo(const entry_ref& ref);
26 status_t SetTo(const BEntry& entry);
28 bool Exists();
30 const char* Name();
31 status_t SetName(const char* name);
33 bool IsDefault();
34 bool IsCurrent();
36 status_t MakeCurrent();
37 status_t Delete();
39 static BNetworkProfile* Default();
40 static BNetworkProfile* Current();
42 private:
43 BEntry fEntry;
44 BPath fPath;
45 bool fIsDefault;
46 bool fIsCurrent;
47 const char* fName;
49 static BDirectory* fProfilesRoot;
53 } // namespace BNetworkKit
56 #endif // _NETWORK_PROFILE_H