Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
senf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wiback
senf
Commits
9b43bcb5
Commit
9b43bcb5
authored
15 years ago
by
g0dil
Browse files
Options
Downloads
Patches
Plain Diff
Socket/Protocols/Raw: EUI64 documentation
parent
2a1dfda2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Socket/Protocols/Raw/EUI64.hh
+42
-6
42 additions, 6 deletions
Socket/Protocols/Raw/EUI64.hh
with
42 additions
and
6 deletions
Socket/Protocols/Raw/EUI64.hh
+
42
−
6
View file @
9b43bcb5
...
@@ -42,7 +42,27 @@ namespace senf {
...
@@ -42,7 +42,27 @@ namespace senf {
/** \brief EUI-64 data type
/** \brief EUI-64 data type
An EUI-64 is a 64 bit (8 octet) id.
An EUI-64 is a 64 bit (8 octet) id. The id is represented as an 8 byte sequence in network
byte order. An EUI64 can be converted from/to several other representations
<table class="senf">
<tr><td><tt>boost::uint64_t</tt></td>
<td><tt>senf::EUI64(0x1a2b3c4d5f607182ull)</tt><br/>
<i>eui64</i><tt>.uint64()</tt></td></tr>
<tr><td><tt>std::string</tt></td>
<td><tt>senf::EUI64::from_string("1a:2b:3c:4d-5f:60:71:82")</tt><br/>
<tt>senf::str(</tt><i>eui64</i><tt>)</tt></td></tr>
<tr><td><i>raw data</i></td>
<td><tt>senf::EUI64::from_data(</tt><i>iterator</i><tt>)</tt><br/>
<i>eui64</i><tt>.begin()</tt></td></tr>
<tr><td>senf::MACAddress<br/> (aka EUI-48)</td>
<td><tt>senf::EUI64::from_mac(</tt><i>mac-address</i><tt>)</tt><br/>
<tt>senf::MACAddress::from_eui64(</tt><i>eui64</i><tt>)</tt></td></tr>
</table>
Additionally, a senf::MACAddress can be converted into an EUI64 and vice versa.
\ingroup addr_group
*/
*/
class
EUI64
class
EUI64
:
public
boost
::
array
<
boost
::
uint8_t
,
8
>
,
:
public
boost
::
array
<
boost
::
uint8_t
,
8
>
,
...
@@ -58,23 +78,39 @@ namespace senf {
...
@@ -58,23 +78,39 @@ namespace senf {
// default destructor
// default destructor
// no conversion constructors
// no conversion constructors
explicit
EUI64
(
boost
::
uint64_t
v
=
0u
);
explicit
EUI64
(
boost
::
uint64_t
v
=
0u
);
///< Construct EUI-64
explicit
EUI64
(
senf
::
NoInit_t
);
explicit
EUI64
(
senf
::
NoInit_t
);
///< Construct <em>uninitialized</em> EUI-64
static
EUI64
from_mac
(
MACAddress
const
&
mac
);
static
EUI64
from_mac
(
MACAddress
const
&
mac
);
///< Construct EUI-64 from senf::MACAddress
static
EUI64
from_string
(
std
::
string
const
&
s
);
static
EUI64
from_string
(
std
::
string
const
&
s
);
///< Construct EUI-64 from string representation
/**< The string representation consists of 8 octets in
hexadecimal notation spearated by ':' or '-' */
template
<
class
InputIterator
>
template
<
class
InputIterator
>
static
EUI64
from_data
(
InputIterator
i
);
static
EUI64
from_data
(
InputIterator
i
);
///< Construct EUI-64 from 8 data octets
/**< The iterator \a i must point to a sequence of 8
octets in network byte order. */
///@}
///@}
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
bool
isMACCompatible
()
const
;
bool
isMACCompatible
()
const
;
///< \c true, if EUI64 is MAC compatible, \c false otherwise
bool
boolean_test
()
const
;
/**< An EUI64 is MAC compatible if bytes 4th and 5th byte
boost
::
uint64_t
uint64
()
const
;
(in network byte order) are 0xfffe. */
bool
boolean_test
()
const
;
///< \c true, if EUI64 is != 0, \c false otherwise
boost
::
uint64_t
uint64
()
const
;
///< Return EUI64 as integer number
};
};
/** \brief Write out EUI64 in it's string representation to stream
\related senf::EUI64
*/
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
EUI64
const
&
v
);
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
EUI64
const
&
v
);
/** \brief Read EUI64 string representation from stream
\related senf::EUI64
*/
std
::
istream
&
operator
>>
(
std
::
istream
&
is
,
EUI64
&
v
);
std
::
istream
&
operator
>>
(
std
::
istream
&
is
,
EUI64
&
v
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment