Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gamera_videos_no_ui
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liusq
gamera_videos_no_ui
Commits
7e011b02
Commit
7e011b02
authored
Oct 10, 2024
by
“liusq”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改ping命令-04
parent
225f0db7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
VidesData.h
+3
-0
No files found.
VidesData.h
View file @
7e011b02
...
...
@@ -447,11 +447,13 @@ inline bool GetNetworkInfoByQNetworkInterface(QString &mac, QString &subnetMask,
interface
.
flags
().
testFlag
(
QNetworkInterface
::
IsRunning
)
&&
!
interface
.
flags
().
testFlag
(
QNetworkInterface
::
IsLoopBack
))
{
mac
=
interface
.
hardwareAddress
();
qInfo
()
<<
"mac===>."
<<
mac
;
QList
<
QNetworkAddressEntry
>
addressEntries
=
interface
.
addressEntries
();
foreach
(
QNetworkAddressEntry
entry
,
addressEntries
)
{
if
(
entry
.
ip
().
protocol
()
==
QAbstractSocket
::
IPv4Protocol
)
{
subnetMask
=
entry
.
netmask
().
toString
();
qInfo
()
<<
"subnetMask===>."
<<
subnetMask
;
// 获取网关地址
QFile
file
(
"/proc/net/route"
);
...
...
@@ -469,6 +471,7 @@ inline bool GetNetworkInfoByQNetworkInterface(QString &mac, QString &subnetMask,
gateway
=
gateway
.
mid
(
6
,
2
)
+
":"
+
gateway
.
mid
(
4
,
2
)
+
":"
+
gateway
.
mid
(
2
,
2
)
+
":"
+
gateway
.
mid
(
0
,
2
);
gateway
=
gateway
.
replace
(
":"
,
"."
);
gateway
=
QHostAddress
(
gateway
).
toString
();
qInfo
()
<<
"gateway===>."
<<
gateway
;
return
true
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment