Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openAcs compatibility fault #1

Open
GoogleCodeExporter opened this issue Mar 23, 2015 · 0 comments
Open

openAcs compatibility fault #1

GoogleCodeExporter opened this issue Mar 23, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

INFORM HANDSHAKING PROBLEM:

1. I have installed openACS server, and configured evcmp (edit tr098_data.xml) 
to work with my server.

2. evcmp send a correct inform message to the server, but it is not able
   to understand the server response.

3. I debugged the code and I found a problem on xml response format 
compatibility. Server response contain the attribute 
xmlns:cwmp="urn:dslforum-org:cwmp-1-0 on SetParameterValues node.
When evcmp parse this node, the function evcpe_xmlns_table_add (xmlns.c) fail 
on this control: 

***********************************************************************
if ((ns = evcpe_xmlns_table_find(table, name, name_len))) {
        evcpe_error(__func__, "namespace already exists: %.*s",
                name_len, name);
        rc = -1;
        goto finally;
    }
***********************************************************************

because the attribute xmlns:cwmp="urn:dslforum-org:cwmp-1-0 is already present 
on the SOAP-ENV:Envelope node.

XML-SOAP server message is compliant with the protocol specification.

4. To workaround the problem I disabled the check (commented it). In this way 
the inform handshaking works well, and is also possible to perform 
getParameterValues operation. Any suggestion to fix this problem?


setParameterValues PROBLEM:

1. The setParameterValues invoked by the openacs default script fail

2. The xml format is not compliant, because evcmp doesn't manage the 
    <ParameterKey>CommandKey</ParameterKey> node sended by the server:

<cwmp:SetParameterValues xmlns:cwmp="urn:dslforum-org:cwmp-1-0">
<ParameterList SOAP-ENC:arrayType="cwmp:ParameterValueStruct[1]">
    <ParameterValueStruct>
        <Name>InternetGatewayDevice.ManagementServer.Test</Name>
         <Value xsi:type="xsd:string">test_value</Value>
    </ParameterValueStruct>
</ParameterList>
<ParameterKey>CommandKey</ParameterKey>  /**** <--- not managed ****/
</cwmp:SetParameterValues>

3. To workaround this problem I added I added : 
evcpe_strncmp("SetParameterValues", parent->name, parent->len) in  
evcpe_msg_xml_elm_begin_cb function (file msg_xml.c), see below

***********************************************************************
else if (!evcpe_strncmp("ParameterKey", name, len)) {
        if (evcpe_strncmp("AddObject", parent->name, parent->len) &&
                evcpe_strncmp("DeleteObject", parent->name, parent->len) && evcpe_strncmp("SetParameterValues", parent->name, parent->len)) {
            goto unexpected_parent;
        }
    }
    if (!(parent = calloc(1, sizeof(struct evcpe_xml_element)))) {
        evcpe_error(__func__, "failed to calloc evcpe_soap_element");
        return ENOMEM;
    }
***********************************************************************

and I also added a case entry in function evcpe_msg_xml_data_cb in  
"ParameterKey" case:

***********************************************************************

case EVCPE_SET_PARAMETER_VALUES:  /**** <--- added ****/
            break;
        default:
            evcpe_error(__func__, "unexpected evcpe_method_type: %d",
                    parser->msg->method_type);
            goto syntax_error;
        }
    } else if (len > 0) {
        evcpe_error(__func__, "unexpected element: %.*s",
                elm->len, elm->name);
        goto syntax_error;
    }
    rc = 0;

finally:
    return rc;
***********************************************************************

4. Any suggestion to fix this problem?

Original issue reported on code.google.com by [email protected] on 14 Jul 2010 at 3:45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant