github.com/solo-io/unik@v0.0.0-20190717152701-a58d3e8e33b7/containers/compilers/includeos/cpp/patches/api/platforms/unik.hpp (about) 1 // This file is a part of the IncludeOS unikernel - www.includeos.org 2 // 3 // Copyright 2015 Oslo and Akershus University College of Applied Sciences 4 // and Alfred Bratterud 5 // 6 // Licensed under the Apache License, Version 2.0 (the "License"); 7 // you may not use this file except in compliance with the License. 8 // You may obtain a copy of the License at 9 // 10 // http://www.apache.org/licenses/LICENSE-2.0 11 // 12 // Unless required by applicable law or agreed to in writing, software 13 // distributed under the License is distributed on an "AS IS" BASIS, 14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 // See the License for the specific language governing permissions and 16 // limitations under the License. 17 18 #ifndef PLATFORMS_UNIK_HPP 19 #define PLATFORMS_UNIK_HPP 20 21 #include <net/inet4.hpp> 22 23 namespace unik{ 24 25 const net::UDP::port_t default_port = 9967; 26 27 class Client { 28 public: 29 using Registered_event = delegate<void()>; 30 31 static void register_instance(net::Inet4& inet, const net::UDP::port_t port = default_port); 32 static void register_instance_dhcp(); 33 static void on_registered(Registered_event e) { 34 on_registered_ = e; 35 }; 36 37 private: 38 static Registered_event on_registered_; 39 }; 40 41 } 42 43 #endif