Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Dnsmasq
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Dnsmasq
Commits
aaeea9f6
Commit
aaeea9f6
authored
Aug 12, 2014
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GetLoopServers Dbus method.
parent
40766e55
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
0 deletions
+43
-0
dbus/DBus-interface
dbus/DBus-interface
+9
-0
src/dbus.c
src/dbus.c
+34
-0
No files found.
dbus/DBus-interface
View file @
aaeea9f6
...
...
@@ -160,6 +160,15 @@ for SetServersEx is represented as
"/eng.mycorp.com/lab.mycorp.com/1003:1234:abcd::1%eth0"
]
GetLoopServers
--------------
(Only available if dnsmasq compiled with HAVE_LOOP)
Return an array of strings, each string is the IP address of an upstream
server which has been found to loop queries back to this dnsmasq instance, and
it therefore not being used.
2. SIGNALS
...
...
src/dbus.c
View file @
aaeea9f6
...
...
@@ -35,6 +35,11 @@ const char* introspection_xml_template =
" <method name=
\"
GetVersion
\"
>
\n
"
" <arg name=
\"
version
\"
direction=
\"
out
\"
type=
\"
s
\"
/>
\n
"
" </method>
\n
"
#ifdef HAVE_LOOP
" <method name=
\"
GetLoopServers
\"
>
\n
"
" <arg name=
\"
server
\"
direction=
\"
out
\"
type=
\"
as
\"
/>
\n
"
" </method>
\n
"
#endif
" <method name=
\"
SetServers
\"
>
\n
"
" <arg name=
\"
servers
\"
direction=
\"
in
\"
type=
\"
av
\"
/>
\n
"
" </method>
\n
"
...
...
@@ -205,6 +210,29 @@ static void dbus_read_servers(DBusMessage *message)
cleanup_servers
();
}
#ifdef HAVE_LOOP
static
DBusMessage
*
dbus_reply_server_loop
(
DBusMessage
*
message
)
{
DBusMessageIter
args
,
args_iter
;
struct
server
*
serv
;
DBusMessage
*
reply
=
dbus_message_new_method_return
(
message
);
dbus_message_iter_init_append
(
reply
,
&
args
);
dbus_message_iter_open_container
(
&
args
,
DBUS_TYPE_ARRAY
,
DBUS_TYPE_STRING_AS_STRING
,
&
args_iter
);
for
(
serv
=
daemon
->
servers
;
serv
;
serv
=
serv
->
next
)
if
(
serv
->
flags
&
SERV_LOOP
)
{
prettyprint_addr
(
&
serv
->
addr
,
daemon
->
addrbuff
);
dbus_message_iter_append_basic
(
&
args_iter
,
DBUS_TYPE_STRING
,
&
daemon
->
addrbuff
);
}
dbus_message_iter_close_container
(
&
args
,
&
args_iter
);
return
reply
;
}
#endif
static
DBusMessage
*
dbus_read_servers_ex
(
DBusMessage
*
message
,
int
strings
)
{
DBusMessageIter
iter
,
array_iter
,
string_iter
;
...
...
@@ -433,6 +461,12 @@ DBusHandlerResult message_handler(DBusConnection *connection,
dbus_message_append_args
(
reply
,
DBUS_TYPE_STRING
,
&
v
,
DBUS_TYPE_INVALID
);
}
#ifdef HAVE_LOOP
else
if
(
strcmp
(
method
,
"GetLoopServers"
)
==
0
)
{
reply
=
dbus_reply_server_loop
(
message
);
}
#endif
else
if
(
strcmp
(
method
,
"SetServers"
)
==
0
)
{
dbus_read_servers
(
message
);
...
...
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