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
4febfc2f
Commit
4febfc2f
authored
17 years ago
by
tho
Browse files
Options
Downloads
Patches
Plain Diff
added some const's to the NetdeviceController
parent
9e314c0e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Socket/NetdeviceController.cc
+7
-0
7 additions, 0 deletions
Socket/NetdeviceController.cc
Socket/NetdeviceController.hh
+7
-7
7 additions, 7 deletions
Socket/NetdeviceController.hh
with
14 additions
and
7 deletions
Socket/NetdeviceController.cc
+
7
−
0
View file @
4febfc2f
...
...
@@ -52,6 +52,7 @@ prefix_ senf::NetdeviceController::NetdeviceController(int interface_index)
}
prefix_
std
::
string
senf
::
NetdeviceController
::
interfaceName
()
const
{
struct
ifreq
ifr
;
ifrName
(
ifr
);
...
...
@@ -59,6 +60,7 @@ prefix_ std::string senf::NetdeviceController::interfaceName()
}
prefix_
senf
::
MACAddress
senf
::
NetdeviceController
::
hardwareAddress
()
const
{
struct
ifreq
ifr
;
ifrName
(
ifr
);
...
...
@@ -67,6 +69,7 @@ prefix_ senf::MACAddress senf::NetdeviceController::hardwareAddress()
}
prefix_
int
senf
::
NetdeviceController
::
mtu
()
const
{
struct
ifreq
ifr
;
ifrName
(
ifr
);
...
...
@@ -75,6 +78,7 @@ prefix_ int senf::NetdeviceController::mtu()
}
prefix_
void
senf
::
NetdeviceController
::
mtu
(
int
new_mtu
)
const
{
struct
ifreq
ifr
;
ifrName
(
ifr
);
...
...
@@ -83,6 +87,7 @@ prefix_ void senf::NetdeviceController::mtu(int new_mtu)
}
prefix_
int
senf
::
NetdeviceController
::
interfaceIndex
()
const
{
return
ifindex_
;
}
...
...
@@ -100,6 +105,7 @@ prefix_ void senf::NetdeviceController::openSocket()
}
prefix_
void
senf
::
NetdeviceController
::
ifrName
(
ifreq
&
ifr
)
const
{
::
memset
(
&
ifr
,
0
,
sizeof
(
ifr
));
ifr
.
ifr_ifindex
=
ifindex_
;
...
...
@@ -109,6 +115,7 @@ prefix_ void senf::NetdeviceController::ifrName(ifreq& ifr)
prefix_
void
senf
::
NetdeviceController
::
doIoctl
(
ifreq
&
ifr
,
int
request
)
const
{
if
(
::
ioctl
(
sockfd_
,
request
,
&
ifr
)
<
0
)
throw
SystemException
();
...
...
This diff is collapsed.
Click to expand it.
Socket/NetdeviceController.hh
+
7
−
7
View file @
4febfc2f
...
...
@@ -50,16 +50,16 @@ namespace senf {
NetdeviceController
(
int
interface_index
);
virtual
~
NetdeviceController
();
MACAddress
hardwareAddress
();
std
::
string
interfaceName
();
int
interfaceIndex
();
///< return the interface index of the interface
int
mtu
();
void
mtu
(
int
new_mtu
);
MACAddress
hardwareAddress
()
const
;
std
::
string
interfaceName
()
const
;
int
interfaceIndex
()
const
;
///< return the interface index of the interface
int
mtu
()
const
;
void
mtu
(
int
new_mtu
)
const
;
private:
void
openSocket
();
void
doIoctl
(
ifreq
&
ifr
,
int
request
);
void
ifrName
(
ifreq
&
ifr
);
void
doIoctl
(
ifreq
&
ifr
,
int
request
)
const
;
void
ifrName
(
ifreq
&
ifr
)
const
;
int
sockfd_
;
int
ifindex_
;
};
...
...
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