1 #ifndef SUBORDINATION_KERNEL_KERNEL_HEADER_HH 2 #define SUBORDINATION_KERNEL_KERNEL_HEADER_HH 7 #include <unistdx/net/socket_address> 9 #include <subordination/ppl/application.hh> 10 #include <subordination/ppl/kernel_header_flag.hh> 22 sys::socket_address _src {};
23 sys::socket_address _dst {};
24 application_type _aid = this_application::get_id();
37 if (this->owns_application()) {
42 inline const sys::socket_address&
43 from()
const noexcept {
48 from(
const sys::socket_address& rhs) noexcept {
52 inline const sys::socket_address&
58 to(
const sys::socket_address& rhs) noexcept {
62 inline application_type
63 app()
const noexcept {
68 setapp(application_type rhs) noexcept {
73 is_foreign()
const noexcept {
74 return !this->is_native();
78 is_native()
const noexcept {
79 return this->_aid == this_application::get_id();
83 aptr()
const noexcept {
89 if (this->owns_application()) {
93 this->_flags |= flag_type::has_application;
94 this->_aid = rhs->id();
96 this->_flags &= ~
flag_type::has_application;
102 has_application()
const noexcept {
103 return this->_flags & kernel_header_flag::has_application;
107 owns_application()
const noexcept {
108 return this->_flags & flag_type::owns_application;
112 has_source_and_destination()
const noexcept {
113 return this->_flags &
114 kernel_header_flag::has_source_and_destination;
118 prepend_source_and_destination() {
119 this->_flags |= kernel_header_flag::has_source_and_destination;
123 do_not_prepend_source_and_destination() {
128 write_header(sys::pstream& out)
const;
131 read_header(sys::pstream& in);
143 rhs.write_header(out);
148 operator>>(sys::pstream& in, kernel_header& rhs) {
155 #endif // vim:filetype=cpp
Definition: application.hh:25