diff --git a/upnpdescgen.c b/upnpdescgen.c index 9123fb0..54c7efe 100644 --- a/upnpdescgen.c +++ b/upnpdescgen.c @@ -191,79 +191,11 @@ static const struct XMLElt rootDesc[] = {"/serviceType", "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1"}, {"/serviceId", "urn:microsoft.com:serviceId:X_MS_MediaReceiverRegistrar"}, {"/controlURL", X_MS_MEDIARECEIVERREGISTRAR_CONTROLURL}, - {"/eventSubURL", ""}, + {"/eventSubURL", X_MS_MEDIARECEIVERREGISTRAR_EVENTURL}, {"/SCPDURL", X_MS_MEDIARECEIVERREGISTRAR_PATH}, {0, 0} }; -static const struct argument AddPortMappingArgs[] = -{ - {NULL, 1, 11}, - {NULL, 1, 12}, - {NULL, 1, 14}, - {NULL, 1, 13}, - {NULL, 1, 15}, - {NULL, 1, 9}, - {NULL, 1, 16}, - {NULL, 1, 10}, - {NULL, 0, 0} -}; - -static const struct argument DeletePortMappingArgs[] = -{ - {NULL, 1, 11}, - {NULL, 1, 12}, - {NULL, 1, 14}, - {NULL, 0, 0} -}; - -static const struct argument SetConnectionTypeArgs[] = -{ - {NULL, 1, 0}, - {NULL, 0, 0} -}; - -static const struct argument GetConnectionTypeInfoArgs[] = -{ - {NULL, 2, 0}, - {NULL, 2, 1}, - {NULL, 0, 0} -}; - -static const struct argument GetNATRSIPStatusArgs[] = -{ - {NULL, 2, 5}, - {NULL, 2, 6}, - {NULL, 0, 0} -}; - -static const struct argument GetGenericPortMappingEntryArgs[] = -{ - {NULL, 1, 8}, - {NULL, 2, 11}, - {NULL, 2, 12}, - {NULL, 2, 14}, - {NULL, 2, 13}, - {NULL, 2, 15}, - {NULL, 2, 9}, - {NULL, 2, 16}, - {NULL, 2, 10}, - {NULL, 0, 0} -}; - -static const struct argument GetSpecificPortMappingEntryArgs[] = -{ - {NULL, 1, 11}, - {NULL, 1, 12}, - {NULL, 1, 14}, - {NULL, 2, 13}, - {NULL, 2, 15}, - {NULL, 2, 9}, - {NULL, 2, 16}, - {NULL, 2, 10}, - {NULL, 0, 0} -}; - /* For ConnectionManager */ static const struct argument GetProtocolInfoArgs[] = { @@ -321,9 +253,9 @@ static const struct action ConnectionManagerActions[] = static const struct stateVar ConnectionManagerVars[] = { - {"SourceProtocolInfo", 1<<7, 0, 0, 44}, /* required */ - {"SinkProtocolInfo", 1<<7, 0, 0, 48}, /* required */ - {"CurrentConnectionIDs", 1<<7, 0, 0, 46}, /* required */ + {"SourceProtocolInfo", 0|EVENTED, 0, 0, 44}, /* required */ + {"SinkProtocolInfo", 0|EVENTED, 0, 0, 48}, /* required */ + {"CurrentConnectionIDs", 0|EVENTED, 0, 0, 46}, /* required */ {"A_ARG_TYPE_ConnectionStatus", 0, 0, 27}, /* required */ {"A_ARG_TYPE_ConnectionManager", 0, 0}, /* required */ {"A_ARG_TYPE_Direction", 0, 0, 33}, /* required */ @@ -405,7 +337,7 @@ static const struct action ContentDirectoryActions[] = static const struct stateVar ContentDirectoryVars[] = { - {"TransferIDs", 1<<7, 0, 0, 48}, /* 0 */ + {"TransferIDs", 0|EVENTED, 0, 0, 48}, /* 0 */ {"A_ARG_TYPE_ObjectID", 0, 0}, {"A_ARG_TYPE_Result", 0, 0}, {"A_ARG_TYPE_SearchCriteria", 0, 0}, @@ -416,17 +348,9 @@ static const struct stateVar ContentDirectoryVars[] = {"A_ARG_TYPE_Index", 3, 0}, {"A_ARG_TYPE_Count", 3, 0}, {"A_ARG_TYPE_UpdateID", 3, 0}, - //JM{"A_ARG_TYPE_TransferID", 3, 0}, /* 10 */ - //JM{"A_ARG_TYPE_TransferStatus", 0, 0, 39}, - /* Allowed Values : COMPLETED / ERROR / IN_PROGRESS / STOPPED */ - //JM{"A_ARG_TYPE_TransferLength", 0, 0}, - //JM{"A_ARG_TYPE_TransferTotal", 0, 0}, - //JM{"A_ARG_TYPE_TagValueList", 0, 0}, - //JM{"A_ARG_TYPE_URI", 5, 0}, /* 15 */ {"SearchCapabilities", 0, 0}, {"SortCapabilities", 0, 0}, - {"SystemUpdateID", 3|0x80, 0, 0, 255}, - //{"ContainerUpdateIDs", 0, 0}, + {"SystemUpdateID", 3|EVENTED, 0, 0, 255}, {0, 0} }; @@ -455,9 +379,6 @@ static const struct action X_MS_MediaReceiverRegistrarActions[] = { {"IsAuthorized", GetIsAuthorizedArgs}, /* R */ {"IsValidated", GetIsValidatedArgs}, /* R */ -#if 0 // Not needed? WMP12 still works. Need to check with 360 and WMP11. - {"RegisterDevice", GetRegisterDeviceArgs}, /* R */ -#endif {0, 0} }; @@ -467,49 +388,13 @@ static const struct stateVar X_MS_MediaReceiverRegistrarVars[] = {"A_ARG_TYPE_RegistrationReqMsg", 7, 0}, {"A_ARG_TYPE_RegistrationRespMsg", 7, 0}, {"A_ARG_TYPE_Result", 6, 0}, - {"AuthorizationDeniedUpdateID", 3, 0}, - {"AuthorizationGrantedUpdateID", 3, 0}, - {"ValidationRevokedUpdateID", 3, 0}, - {"ValidationSucceededUpdateID", 3, 0}, + {"AuthorizationDeniedUpdateID", 3|EVENTED, 0}, + {"AuthorizationGrantedUpdateID", 3|EVENTED, 0}, + {"ValidationRevokedUpdateID", 3|EVENTED, 0}, + {"ValidationSucceededUpdateID", 3|EVENTED, 0}, {0, 0} }; -/* WANCfg.xml */ -/* See UPnP_IGD_WANCommonInterfaceConfig 1.0.pdf */ - -static const struct argument GetCommonLinkPropertiesArgs[] = -{ - {NULL, 2, 0}, - {NULL, 2, 1}, - {NULL, 2, 2}, - {NULL, 2, 3}, - {NULL, 0, 0} -}; - -static const struct argument GetTotalBytesSentArgs[] = -{ - {NULL, 2, 4}, - {NULL, 0, 0} -}; - -static const struct argument GetTotalBytesReceivedArgs[] = -{ - {NULL, 2, 5}, - {NULL, 0, 0} -}; - -static const struct argument GetTotalPacketsSentArgs[] = -{ - {NULL, 2, 6}, - {NULL, 0, 0} -}; - -static const struct argument GetTotalPacketsReceivedArgs[] = -{ - {NULL, 2, 7}, - {NULL, 0, 0} -}; - static const struct serviceDesc scpdContentDirectory = { ContentDirectoryActions, ContentDirectoryVars }; @@ -777,7 +662,7 @@ genServiceDesc(int * len, const struct serviceDesc * s) { str = strcat_str(str, len, &tmplen, ""); str = strcat_str(str, len, &tmplen, vars[i].name); str = strcat_str(str, len, &tmplen, ""); @@ -851,7 +736,7 @@ genEventVars(int * len, const struct serviceDesc * s, const char * servns) snprintf(buf, sizeof(buf), "", servns); str = strcat_str(str, len, &tmplen, buf); while(v->name) { - if(v->itype & 0x80) { + if(v->itype & EVENTED) { snprintf(buf, sizeof(buf), "<%s>", v->name); str = strcat_str(str, len, &tmplen, buf); //printf("", v->name); diff --git a/upnpdescgen.h b/upnpdescgen.h index b377d82..5ec33a9 100644 --- a/upnpdescgen.h +++ b/upnpdescgen.h @@ -57,6 +57,7 @@ struct argument { unsigned char relatedVar; /* index of the related variable */ }; +#define EVENTED 1<<7 struct stateVar { const char * name; unsigned char itype; /* MSB: sendEvent flag, 7 LSB: index in upnptypes */