From 7774c24daa99c45b749c156870d1a18b46cc219b Mon Sep 17 00:00:00 2001 From: Daniel Becker Date: Fri, 11 Dec 2015 22:56:20 -0800 Subject: [PATCH 1/3] add missing parameters for DeviceProtection service actions --- miniupnpd/upnpdescgen.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/miniupnpd/upnpdescgen.c b/miniupnpd/upnpdescgen.c index 05b748c..09458d3 100644 --- a/miniupnpd/upnpdescgen.c +++ b/miniupnpd/upnpdescgen.c @@ -743,11 +743,32 @@ static const struct serviceDesc scpd6FC = #ifdef ENABLE_DP_SERVICE /* UPnP-gw-DeviceProtection-v1-Service.pdf */ + +static const struct argument SendSetupMessageArgs[] = +{ + {1|0x80, 6}, /* ProtocolType */ + {1|0x80, 5}, /* InMessage */ + {2|0x80, 5}, /* OutMessage */ + {0, 0} +}; + +static const struct argument GetSupportedProtocolsArgs[] = +{ + {2, 1}, /* ProtocolList */ + {0, 0} +}; + +static const struct argument GetAssignedRolesArgs[] = +{ + {2, 6}, /* RoleList */ + {0, 0} +}; + static const struct action DPActions[] = { - {"SendSetupMessage", 0}, - {"GetSupportedProtocols", 0}, - {"GetAssignedRoles", 0}, + {"SendSetupMessage", SendSetupMessageArgs}, + {"GetSupportedProtocols", GetSupportedProtocolsArgs}, + {"GetAssignedRoles", GetAssignedRolesArgs}, {0, 0} }; From 0298b6636584a3e18c96c5165824e4eb120b0668 Mon Sep 17 00:00:00 2001 From: Daniel Becker Date: Fri, 11 Dec 2015 23:12:11 -0800 Subject: [PATCH 2/3] fix argument names for DeviceProtection actions --- miniupnpd/upnpdescgen.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/miniupnpd/upnpdescgen.c b/miniupnpd/upnpdescgen.c index 09458d3..38171b7 100644 --- a/miniupnpd/upnpdescgen.c +++ b/miniupnpd/upnpdescgen.c @@ -115,7 +115,12 @@ static const char * magicargname[] = { "RemotePort", "InternalClient", "InternalPort", - "IsWorking" + "IsWorking", + "ProtocolType", + "InMessage", + "OutMessage", + "ProtocolList", + "RoleList" }; static const char xmlver[] = @@ -746,21 +751,21 @@ static const struct serviceDesc scpd6FC = static const struct argument SendSetupMessageArgs[] = { - {1|0x80, 6}, /* ProtocolType */ - {1|0x80, 5}, /* InMessage */ - {2|0x80, 5}, /* OutMessage */ + {1|0x80|(8<<2), 6}, /* ProtocolType */ + {1|0x80|(9<<2), 5}, /* InMessage */ + {2|0x80|(10<<2), 5}, /* OutMessage */ {0, 0} }; static const struct argument GetSupportedProtocolsArgs[] = { - {2, 1}, /* ProtocolList */ + {2|0x80|(11<<2), 1}, /* ProtocolList */ {0, 0} }; static const struct argument GetAssignedRolesArgs[] = { - {2, 6}, /* RoleList */ + {2|0x80|(12<<2), 6}, /* RoleList */ {0, 0} }; From ce3d66a3ee184291700f785806f033e8b8cf47d5 Mon Sep 17 00:00:00 2001 From: Daniel Becker Date: Fri, 11 Dec 2015 23:36:19 -0800 Subject: [PATCH 3/3] fix tags for DeviceProtection action responses --- miniupnpd/upnpsoap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/miniupnpd/upnpsoap.c b/miniupnpd/upnpsoap.c index 07aa373..d4b4c00 100644 --- a/miniupnpd/upnpsoap.c +++ b/miniupnpd/upnpsoap.c @@ -1985,7 +1985,7 @@ SendSetupMessage(struct upnphttp * h, const char * action, const char * ns) static const char resp[] = "" - "%s" + "%s" ""; char body[1024]; int bodylen; @@ -2026,7 +2026,7 @@ GetSupportedProtocols(struct upnphttp * h, const char * action, const char * ns) static const char resp[] = "" - "%s" + "%s" ""; char body[1024]; int bodylen; @@ -2052,7 +2052,7 @@ GetAssignedRoles(struct upnphttp * h, const char * action, const char * ns) static const char resp[] = "" - "%s" + "%s" ""; char body[1024]; int bodylen;