Merge pull request #180 from razzfazz/fix_dp_action_args

fix action arguments for DeviceProtection service (IGDv2)
This commit is contained in:
Thomas BERNARD 2015-12-12 08:58:25 +01:00
commit 128bbee806
2 changed files with 33 additions and 7 deletions

View File

@ -115,7 +115,12 @@ static const char * magicargname[] = {
"RemotePort",
"InternalClient",
"InternalPort",
"IsWorking"
"IsWorking",
"ProtocolType",
"InMessage",
"OutMessage",
"ProtocolList",
"RoleList"
};
static const char xmlver[] =
@ -743,11 +748,32 @@ static const struct serviceDesc scpd6FC =
#ifdef ENABLE_DP_SERVICE
/* UPnP-gw-DeviceProtection-v1-Service.pdf */
static const struct argument SendSetupMessageArgs[] =
{
{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|0x80|(11<<2), 1}, /* ProtocolList */
{0, 0}
};
static const struct argument GetAssignedRolesArgs[] =
{
{2|0x80|(12<<2), 6}, /* RoleList */
{0, 0}
};
static const struct action DPActions[] =
{
{"SendSetupMessage", 0},
{"GetSupportedProtocols", 0},
{"GetAssignedRoles", 0},
{"SendSetupMessage", SendSetupMessageArgs},
{"GetSupportedProtocols", GetSupportedProtocolsArgs},
{"GetAssignedRoles", GetAssignedRolesArgs},
{0, 0}
};

View File

@ -1989,7 +1989,7 @@ SendSetupMessage(struct upnphttp * h, const char * action, const char * ns)
static const char resp[] =
"<u:%sResponse "
"xmlns:u=\"%s\">"
"<NewOutMessage>%s</NewOutMessage>"
"<OutMessage>%s</OutMessage>"
"</u:%sResponse>";
char body[1024];
int bodylen;
@ -2030,7 +2030,7 @@ GetSupportedProtocols(struct upnphttp * h, const char * action, const char * ns)
static const char resp[] =
"<u:%sResponse "
"xmlns:u=\"%s\">"
"<NewProtocolList>%s</NewProtocolList>"
"<ProtocolList>%s</ProtocolList>"
"</u:%sResponse>";
char body[1024];
int bodylen;
@ -2056,7 +2056,7 @@ GetAssignedRoles(struct upnphttp * h, const char * action, const char * ns)
static const char resp[] =
"<u:%sResponse "
"xmlns:u=\"%s\">"
"<NewRoleList>%s</NewRoleList>"
"<RoleList>%s</RoleList>"
"</u:%sResponse>";
char body[1024];
int bodylen;