diff --git a/browser/components/safebrowsing/content/test/browser_bug400731.js b/browser/components/safebrowsing/content/test/browser_bug400731.js index 2cef8b13a29b..3132372695fb 100644 --- a/browser/components/safebrowsing/content/test/browser_bug400731.js +++ b/browser/components/safebrowsing/content/test/browser_bug400731.js @@ -6,8 +6,17 @@ function test() { gBrowser.selectedTab = gBrowser.addTab(); // Navigate to malware site. Can't use an onload listener here since - // error pages don't fire onload - window.addEventListener("DOMContentLoaded", testMalware, true); + // error pages don't fire onload. Also can't register the DOMContentLoaded + // handler here because registering it too soon would mean that we might + // get it for about:blank, and not about:blocked. + gBrowser.addTabsProgressListener({ + onLocationChange: function(aTab, aWebProgress, aRequest, aLocation, aFlags) { + if (aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_ERROR_PAGE) { + gBrowser.removeTabsProgressListener(this); + window.addEventListener("DOMContentLoaded", testMalware, true); + } + } + }); content.location = "http://www.mozilla.org/firefox/its-an-attack.html"; } diff --git a/browser/installer/windows/nsis/shared.nsh b/browser/installer/windows/nsis/shared.nsh index 7372db60a4d0..8a4dd43fb481 100755 --- a/browser/installer/windows/nsis/shared.nsh +++ b/browser/installer/windows/nsis/shared.nsh @@ -837,6 +837,10 @@ ; Adds a pinned shortcut to Task Bar on update for Windows 7 and above if this ; macro has never been called before and the application is default (see ; PinToTaskBar for more details). +; Since defaults handling is handled by Windows in Win8 and later, we always +; attempt to pin a taskbar on that OS. If Windows sets the defaults at +; installation time, then we don't get the opportunity to run this code at +; that time. !macro MigrateTaskBarShortcut ${GetShortcutsLogPath} $0 ${If} ${FileExists} "$0" @@ -846,13 +850,17 @@ ClearErrors WriteIniStr "$0" "TASKBAR" "Migrated" "true" ${If} ${AtLeastWin7} - ; Check if the Firefox is the http handler for this user - SetShellVarContext current ; Set SHCTX to the current user - ${IsHandlerForInstallDir} "http" $R9 - ${If} $TmpVal == "HKLM" - SetShellVarContext all ; Set SHCTX to all users + ; No need to check the default on Win8 and later + ${If} ${AtMostWin2008R2} + ; Check if the Firefox is the http handler for this user + SetShellVarContext current ; Set SHCTX to the current user + ${IsHandlerForInstallDir} "http" $R9 + ${If} $TmpVal == "HKLM" + SetShellVarContext all ; Set SHCTX to all users + ${EndIf} ${EndIf} ${If} "$R9" == "true" + ${OrIf} ${AtLeastWin8} ${PinToTaskBar} ${EndIf} ${EndIf} diff --git a/content/base/public/nsContentUtils.h b/content/base/public/nsContentUtils.h index e25713060fd0..476903ddf3ca 100644 --- a/content/base/public/nsContentUtils.h +++ b/content/base/public/nsContentUtils.h @@ -64,7 +64,7 @@ class nsIParserService; class nsIIOService; class nsIURI; class imgIContainer; -class imgIDecoderObserver; +class imgINotificationObserver; class imgIRequest; class imgILoader; class imgICache; @@ -661,7 +661,7 @@ public: nsIDocument* aLoadingDocument, nsIPrincipal* aLoadingPrincipal, nsIURI* aReferrer, - imgIDecoderObserver* aObserver, + imgINotificationObserver* aObserver, int32_t aLoadFlags, imgIRequest** aRequest); diff --git a/content/base/public/nsIImageLoadingContent.idl b/content/base/public/nsIImageLoadingContent.idl index 9a08f47c76fb..417dae5f7e29 100644 --- a/content/base/public/nsIImageLoadingContent.idl +++ b/content/base/public/nsIImageLoadingContent.idl @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "imgIDecoderObserver.idl" +#include "imgINotificationObserver.idl" interface imgIRequest; interface nsIChannel; @@ -34,8 +34,8 @@ interface nsIFrame; * sufficient, when combined with the imageBlockingStatus information.) */ -[scriptable, uuid(4bf1a7c5-6edb-4191-a257-e31a90f6aa85)] -interface nsIImageLoadingContent : imgIDecoderObserver +[scriptable, builtinclass, uuid(497bfb9b-d996-4d1e-a647-8137b0cfc876)] +interface nsIImageLoadingContent : imgINotificationObserver { /** * Request types. Image loading content nodes attempt to do atomic @@ -75,14 +75,14 @@ interface nsIImageLoadingContent : imgIDecoderObserver * * @throws NS_ERROR_OUT_OF_MEMORY */ - void addObserver(in imgIDecoderObserver aObserver); + void addObserver(in imgINotificationObserver aObserver); /** * Used to unregister an image decoder observer. * * @param aObserver the observer to unregister */ - void removeObserver(in imgIDecoderObserver aObserver); + void removeObserver(in imgINotificationObserver aObserver); /** * Accessor to get the image requests diff --git a/content/base/src/Makefile.in b/content/base/src/Makefile.in index d37e7dcec329..2b74908cd814 100644 --- a/content/base/src/Makefile.in +++ b/content/base/src/Makefile.in @@ -28,7 +28,6 @@ EXPORTS = \ nsRange.h \ nsScriptLoader.h \ nsStubDocumentObserver.h \ - nsStubImageDecoderObserver.h \ nsStubMutationObserver.h \ nsTextFragment.h \ mozAutoDocUpdate.h \ @@ -109,7 +108,6 @@ CPPSRCS = \ nsScriptElement.cpp \ nsScriptLoader.cpp \ nsStubDocumentObserver.cpp \ - nsStubImageDecoderObserver.cpp \ nsStubMutationObserver.cpp \ nsStyledElement.cpp \ nsStyleLinkElement.cpp \ diff --git a/content/base/src/nsContentSink.cpp b/content/base/src/nsContentSink.cpp index 2ccdf0771f0e..e740d6220c52 100644 --- a/content/base/src/nsContentSink.cpp +++ b/content/base/src/nsContentSink.cpp @@ -1225,15 +1225,9 @@ nsContentSink::Notify(nsITimer *timer) #ifdef MOZ_DEBUG { PRTime now = PR_Now(); - int64_t diff, interval; - int32_t delay; - LL_I2L(interval, GetNotificationInterval()); - diff = now - mLastNotificationTime; - - diff -= interval; - LL_L2I(delay, diff); - delay /= PR_USEC_PER_MSEC; + int64_t interval = GetNotificationInterval(); + delay = int32_t(now - mLastNotificationTime - interval) / PR_USEC_PER_MSEC; mBackoffCount--; SINK_TRACE(gContentSinkLogModuleInfo, SINK_TRACE_REFLOW, diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp index cd0aacf908f5..1cf173223bf1 100644 --- a/content/base/src/nsContentUtils.cpp +++ b/content/base/src/nsContentUtils.cpp @@ -51,7 +51,7 @@ #include "nsIForm.h" #include "nsIFormControl.h" #include "nsGkAtoms.h" -#include "imgIDecoderObserver.h" +#include "imgINotificationObserver.h" #include "imgIRequest.h" #include "imgIContainer.h" #include "imgILoader.h" @@ -2734,7 +2734,7 @@ nsContentUtils::IsImageInCache(nsIURI* aURI, nsIDocument* aDocument) nsresult nsContentUtils::LoadImage(nsIURI* aURI, nsIDocument* aLoadingDocument, nsIPrincipal* aLoadingPrincipal, nsIURI* aReferrer, - imgIDecoderObserver* aObserver, int32_t aLoadFlags, + imgINotificationObserver* aObserver, int32_t aLoadFlags, imgIRequest** aRequest) { NS_PRECONDITION(aURI, "Must have a URI"); @@ -2777,7 +2777,7 @@ nsContentUtils::LoadImage(nsIURI* aURI, nsIDocument* aLoadingDocument, aReferrer, /* referrer */ aLoadingPrincipal, /* loading principal */ loadGroup, /* loadgroup */ - aObserver, /* imgIDecoderObserver */ + aObserver, /* imgINotificationObserver */ aLoadingDocument, /* uniquification key */ aLoadFlags, /* load flags */ nullptr, /* cache key */ diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 88eb5451e2cd..66d4717d0e47 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -6874,9 +6874,7 @@ nsDocument::RetrieveRelevantHeaders(nsIChannel *aChannel) rv = file->GetLastModifiedTime(&msecs); if (NS_SUCCEEDED(rv)) { - int64_t intermediateValue; - LL_I2L(intermediateValue, PR_USEC_PER_MSEC); - modDate = msecs * intermediateValue; + modDate = msecs * int64_t(PR_USEC_PER_MSEC); } } } else { diff --git a/content/base/src/nsGenConImageContent.cpp b/content/base/src/nsGenConImageContent.cpp index 49ffc4a232d4..27b8bca1b24e 100644 --- a/content/base/src/nsGenConImageContent.cpp +++ b/content/base/src/nsGenConImageContent.cpp @@ -48,11 +48,10 @@ public: NS_DECL_ISUPPORTS_INHERITED }; -NS_IMPL_ISUPPORTS_INHERITED4(nsGenConImageContent, +NS_IMPL_ISUPPORTS_INHERITED3(nsGenConImageContent, nsXMLElement, nsIImageLoadingContent, - imgIContainerObserver, - imgIDecoderObserver, + imgINotificationObserver, imgIOnloadBlocker) nsresult diff --git a/content/base/src/nsImageLoadingContent.cpp b/content/base/src/nsImageLoadingContent.cpp index 92aebf6a56e5..d5a5b1c183db 100644 --- a/content/base/src/nsImageLoadingContent.cpp +++ b/content/base/src/nsImageLoadingContent.cpp @@ -122,114 +122,63 @@ nsImageLoadingContent::~nsImageLoadingContent() } \ PR_END_MACRO - /* - * imgIContainerObserver impl + * imgINotificationObserver impl */ NS_IMETHODIMP -nsImageLoadingContent::FrameChanged(imgIRequest* aRequest, - imgIContainer* aContainer, - const nsIntRect* aDirtyRect) -{ - LOOP_OVER_OBSERVERS(FrameChanged(aRequest, aContainer, aDirtyRect)); - return NS_OK; -} - -/* - * imgIDecoderObserver impl - */ -NS_IMETHODIMP -nsImageLoadingContent::OnStartRequest(imgIRequest* aRequest) +nsImageLoadingContent::Notify(imgIRequest* aRequest, + int32_t aType, + const nsIntRect* aData) { + if (aType == imgINotificationObserver::IS_ANIMATED) { + return OnImageIsAnimated(aRequest); + } + + if (aType == imgINotificationObserver::LOAD_COMPLETE) { + // We should definitely have a request here + NS_ABORT_IF_FALSE(aRequest, "no request?"); + + NS_PRECONDITION(aRequest == mCurrentRequest || aRequest == mPendingRequest, + "Unknown request"); + } + NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_NOT_AVAILABLE); - LOOP_OVER_OBSERVERS(OnStartRequest(aRequest)); + LOOP_OVER_OBSERVERS(Notify(aRequest, aType, aData)); + + if (aType == imgINotificationObserver::SIZE_AVAILABLE) { + // Have to check for state changes here, since we might have been in + // the LOADING state before. + UpdateImageState(true); + } + + if (aType == imgINotificationObserver::LOAD_COMPLETE) { + uint32_t reqStatus; + aRequest->GetImageStatus(&reqStatus); + nsresult status = + reqStatus & imgIRequest::STATUS_ERROR ? NS_ERROR_FAILURE : NS_OK; + return OnStopRequest(aRequest, status); + } + return NS_OK; } -NS_IMETHODIMP -nsImageLoadingContent::OnStartDecode(imgIRequest* aRequest) +nsresult +nsImageLoadingContent::OnStopRequest(imgIRequest* aRequest, + nsresult aStatus) { - NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_NOT_AVAILABLE); + uint32_t oldStatus; + aRequest->GetImageStatus(&oldStatus); - LOOP_OVER_OBSERVERS(OnStartDecode(aRequest)); - return NS_OK; -} - -NS_IMETHODIMP -nsImageLoadingContent::OnStartContainer(imgIRequest* aRequest, - imgIContainer* aContainer) -{ - NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_NOT_AVAILABLE); - - LOOP_OVER_OBSERVERS(OnStartContainer(aRequest, aContainer)); - - // Have to check for state changes here, since we might have been in - // the LOADING state before. - UpdateImageState(true); - return NS_OK; -} - -NS_IMETHODIMP -nsImageLoadingContent::OnStartFrame(imgIRequest* aRequest, - uint32_t aFrame) -{ - NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_NOT_AVAILABLE); - - LOOP_OVER_OBSERVERS(OnStartFrame(aRequest, aFrame)); - return NS_OK; -} - -NS_IMETHODIMP -nsImageLoadingContent::OnDataAvailable(imgIRequest* aRequest, - bool aCurrentFrame, - const nsIntRect* aRect) -{ - NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_NOT_AVAILABLE); - - LOOP_OVER_OBSERVERS(OnDataAvailable(aRequest, aCurrentFrame, aRect)); - return NS_OK; -} - -NS_IMETHODIMP -nsImageLoadingContent::OnStopFrame(imgIRequest* aRequest, - uint32_t aFrame) -{ - NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_NOT_AVAILABLE); - - LOOP_OVER_OBSERVERS(OnStopFrame(aRequest, aFrame)); - return NS_OK; -} - -NS_IMETHODIMP -nsImageLoadingContent::OnStopContainer(imgIRequest* aRequest, - imgIContainer* aContainer) -{ - NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_NOT_AVAILABLE); - - LOOP_OVER_OBSERVERS(OnStopContainer(aRequest, aContainer)); - return NS_OK; -} - -// Warning - This isn't actually fired when decode is complete. Rather, it's -// fired when load is complete. See bug 505385, and in the mean time use -// OnStopContainer. -NS_IMETHODIMP -nsImageLoadingContent::OnStopDecode(imgIRequest* aRequest, - nsresult aStatus, - const PRUnichar* aStatusArg) -{ - NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_NOT_AVAILABLE); - - // We should definitely have a request here - NS_ABORT_IF_FALSE(aRequest, "no request?"); - - NS_PRECONDITION(aRequest == mCurrentRequest || aRequest == mPendingRequest, - "Unknown request"); - LOOP_OVER_OBSERVERS(OnStopDecode(aRequest, aStatus, aStatusArg)); - - // XXXbholley - When we fix bug 505385, everything here should go in - // OnStopRequest. + //XXXjdm This occurs when we have a pending request created, then another + // pending request replaces it before the first one is finished. + // This begs the question of what the correct behaviour is; we used + // to not have to care because we ran this code in OnStopDecode which + // wasn't called when the first request was cancelled. For now, I choose + // to punt when the given request doesn't appear to have terminated in + // an expected state. + if (!(oldStatus & (imgIRequest::STATUS_ERROR | imgIRequest::STATUS_LOAD_COMPLETE))) + return NS_OK; // Our state may change. Watch it. AutoStateChanger changer(this, true); @@ -284,17 +233,7 @@ nsImageLoadingContent::OnStopDecode(imgIRequest* aRequest, return NS_OK; } -NS_IMETHODIMP -nsImageLoadingContent::OnStopRequest(imgIRequest* aRequest, bool aLastPart) -{ - NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_NOT_AVAILABLE); - - LOOP_OVER_OBSERVERS(OnStopRequest(aRequest, aLastPart)); - - return NS_OK; -} - -NS_IMETHODIMP +nsresult nsImageLoadingContent::OnImageIsAnimated(imgIRequest *aRequest) { bool* requestFlag = GetRegisteredFlagForRequest(aRequest); @@ -306,16 +245,6 @@ nsImageLoadingContent::OnImageIsAnimated(imgIRequest *aRequest) return NS_OK; } -NS_IMETHODIMP -nsImageLoadingContent::OnDiscard(imgIRequest *aRequest) -{ - NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_NOT_AVAILABLE); - - LOOP_OVER_OBSERVERS(OnDiscard(aRequest)); - - return NS_OK; -} - /* * nsIImageLoadingContent impl */ @@ -351,7 +280,7 @@ nsImageLoadingContent::GetImageBlockingStatus(int16_t* aStatus) } NS_IMETHODIMP -nsImageLoadingContent::AddObserver(imgIDecoderObserver* aObserver) +nsImageLoadingContent::AddObserver(imgINotificationObserver* aObserver) { NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_NOT_AVAILABLE); @@ -379,7 +308,7 @@ nsImageLoadingContent::AddObserver(imgIDecoderObserver* aObserver) } NS_IMETHODIMP -nsImageLoadingContent::RemoveObserver(imgIDecoderObserver* aObserver) +nsImageLoadingContent::RemoveObserver(imgINotificationObserver* aObserver) { NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_NOT_AVAILABLE); diff --git a/content/base/src/nsImageLoadingContent.h b/content/base/src/nsImageLoadingContent.h index 07996b55c866..a67e9a744cb7 100644 --- a/content/base/src/nsImageLoadingContent.h +++ b/content/base/src/nsImageLoadingContent.h @@ -13,8 +13,7 @@ #ifndef nsImageLoadingContent_h__ #define nsImageLoadingContent_h__ -#include "imgIContainerObserver.h" -#include "imgIDecoderObserver.h" +#include "imgINotificationObserver.h" #include "imgIOnloadBlocker.h" #include "mozilla/CORSMode.h" #include "nsCOMPtr.h" @@ -36,8 +35,7 @@ public: nsImageLoadingContent(); virtual ~nsImageLoadingContent(); - NS_DECL_IMGICONTAINEROBSERVER - NS_DECL_IMGIDECODEROBSERVER + NS_DECL_IMGINOTIFICATIONOBSERVER NS_DECL_NSIIMAGELOADINGCONTENT NS_DECL_IMGIONLOADBLOCKER @@ -161,12 +159,15 @@ protected: nsIContent* aBindingParent, bool aCompileEventHandlers); void UnbindFromTree(bool aDeep, bool aNullParent); + nsresult OnStopRequest(imgIRequest* aRequest, nsresult aStatus); + nsresult OnImageIsAnimated(imgIRequest *aRequest); + private: /** * Struct used to manage the image observers. */ struct ImageObserver { - ImageObserver(imgIDecoderObserver* aObserver) : + ImageObserver(imgINotificationObserver* aObserver) : mObserver(aObserver), mNext(nullptr) { @@ -178,7 +179,7 @@ private: NS_CONTENT_DELETE_LIST_MEMBER(ImageObserver, this, mNext); } - nsCOMPtr mObserver; + nsCOMPtr mObserver; ImageObserver* mNext; }; diff --git a/content/base/src/nsObjectLoadingContent.h b/content/base/src/nsObjectLoadingContent.h index 0ae8125acef5..d5ee66b090dd 100644 --- a/content/base/src/nsObjectLoadingContent.h +++ b/content/base/src/nsObjectLoadingContent.h @@ -98,13 +98,6 @@ class nsObjectLoadingContent : public nsImageLoadingContent NS_DECL_NSIINTERFACEREQUESTOR NS_DECL_NSICHANNELEVENTSINK -#ifdef HAVE_CPP_AMBIGUITY_RESOLVING_USING - // Fix gcc compile warnings - using nsImageLoadingContent::OnStartRequest; - using nsImageLoadingContent::OnDataAvailable; - using nsImageLoadingContent::OnStopRequest; -#endif - /** * Object state. This is a bitmask of NS_EVENT_STATEs epresenting the * current state of the object. diff --git a/content/base/src/nsStubImageDecoderObserver.cpp b/content/base/src/nsStubImageDecoderObserver.cpp deleted file mode 100644 index d2a53b2e2597..000000000000 --- a/content/base/src/nsStubImageDecoderObserver.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* vim: set shiftwidth=4 tabstop=8 autoindent cindent expandtab: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsStubImageDecoderObserver.h" - -NS_IMETHODIMP -nsStubImageDecoderObserver::OnStartRequest(imgIRequest *aRequest) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsStubImageDecoderObserver::OnStartDecode(imgIRequest *aRequest) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsStubImageDecoderObserver::OnStartContainer(imgIRequest *aRequest, - imgIContainer *aContainer) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsStubImageDecoderObserver::OnStartFrame(imgIRequest *aRequest, - uint32_t aFrame) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsStubImageDecoderObserver::OnDataAvailable(imgIRequest *aRequest, - bool aCurrentFrame, - const nsIntRect * aRect) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsStubImageDecoderObserver::OnStopFrame(imgIRequest *aRequest, - uint32_t aFrame) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsStubImageDecoderObserver::OnStopContainer(imgIRequest *aRequest, - imgIContainer *aContainer) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsStubImageDecoderObserver::OnStopDecode(imgIRequest *aRequest, - nsresult status, - const PRUnichar *statusArg) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsStubImageDecoderObserver::OnStopRequest(imgIRequest *aRequest, - bool aIsLastPart) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsStubImageDecoderObserver::OnDiscard(imgIRequest *aRequest) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsStubImageDecoderObserver::OnImageIsAnimated(imgIRequest *aRequest) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsStubImageDecoderObserver::FrameChanged(imgIRequest* aRequest, - imgIContainer *aContainer, - const nsIntRect *aDirtyRect) -{ - return NS_OK; -} diff --git a/content/base/src/nsStubImageDecoderObserver.h b/content/base/src/nsStubImageDecoderObserver.h deleted file mode 100644 index 8bf4bd2b353b..000000000000 --- a/content/base/src/nsStubImageDecoderObserver.h +++ /dev/null @@ -1,35 +0,0 @@ -/* vim: set shiftwidth=4 tabstop=8 autoindent cindent expandtab: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * nsStubImageDecoderObserver is an implementation of the imgIDecoderObserver - * interface (except for the methods on nsISupports) that is intended to be - * used as a base class within the content/layout library. All methods do - * nothing. - */ - -#ifndef nsStubImageDecoderObserver_h_ -#define nsStubImageDecoderObserver_h_ - -#include "imgIDecoderObserver.h" - -/** - * There are two advantages to inheriting from nsStubImageDecoderObserver - * rather than directly from imgIDecoderObserver: - * 1. smaller compiled code size (since there's no need for the code - * for the empty virtual function implementations for every - * imgIDecoderObserver implementation) - * 2. the performance of document's loop over observers benefits from - * the fact that more of the functions called are the same (which - * can reduce instruction cache misses and perhaps improve branch - * prediction) - */ -class nsStubImageDecoderObserver : public imgIDecoderObserver { -public: - NS_DECL_IMGICONTAINEROBSERVER - NS_DECL_IMGIDECODEROBSERVER -}; - -#endif /* !defined(nsStubImageDecoderObserver_h_) */ diff --git a/content/base/src/nsXMLHttpRequest.cpp b/content/base/src/nsXMLHttpRequest.cpp index d555aba2abd6..9b2ae826b41c 100644 --- a/content/base/src/nsXMLHttpRequest.cpp +++ b/content/base/src/nsXMLHttpRequest.cpp @@ -4110,7 +4110,7 @@ NS_IMETHODIMP nsXMLHttpProgressEvent::GetPosition(uint32_t *aPosition) { WarnAboutLSProgressEvent(nsIDocument::ePosition); // XXX can we change the iface? - LL_L2UI(*aPosition, mCurProgress); + *aPosition = uint32_t(mCurProgress); return NS_OK; } @@ -4118,7 +4118,7 @@ NS_IMETHODIMP nsXMLHttpProgressEvent::GetTotalSize(uint32_t *aTotalSize) { WarnAboutLSProgressEvent(nsIDocument::eTotalSize); // XXX can we change the iface? - LL_L2UI(*aTotalSize, mMaxProgress); + *aTotalSize = uint32_t(mMaxProgress); return NS_OK; } diff --git a/content/canvas/public/nsICanvasRenderingContextInternal.h b/content/canvas/public/nsICanvasRenderingContextInternal.h index 8f534b1cb559..261039c8095c 100644 --- a/content/canvas/public/nsICanvasRenderingContextInternal.h +++ b/content/canvas/public/nsICanvasRenderingContextInternal.h @@ -132,8 +132,6 @@ protected: namespace mozilla { namespace dom { -extern bool AzureCanvasEnabled(); - } } diff --git a/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp b/content/canvas/src/CanvasRenderingContext2D.cpp similarity index 78% rename from content/canvas/src/nsCanvasRenderingContext2DAzure.cpp rename to content/canvas/src/CanvasRenderingContext2D.cpp index cedf70279f97..c3a10120d8f4 100644 --- a/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp +++ b/content/canvas/src/CanvasRenderingContext2D.cpp @@ -4,7 +4,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "base/basictypes.h" -#include "nsCanvasRenderingContext2DAzure.h" +#include "CanvasRenderingContext2D.h" #include "nsIDOMXULElement.h" @@ -86,6 +86,7 @@ #include "mozilla/ipc/DocumentRendererParent.h" #include "mozilla/ipc/PDocumentRendererParent.h" #include "mozilla/Preferences.h" +#include "mozilla/Telemetry.h" #include "mozilla/unused.h" #include "nsCCUncollectableMarker.h" #include "nsWrapperCacheInlines.h" @@ -106,17 +107,36 @@ using namespace mozilla; using namespace mozilla::CanvasUtils; using namespace mozilla::css; -using namespace mozilla::dom; using namespace mozilla::gfx; using namespace mozilla::ipc; using namespace mozilla::layers; namespace mgfx = mozilla::gfx; +#define NS_TEXTMETRICSAZURE_PRIVATE_IID \ + {0x9793f9e7, 0x9dc1, 0x4e9c, {0x81, 0xc8, 0xfc, 0xa7, 0x14, 0xf4, 0x30, 0x79}} + +nsresult +NS_NewCanvasRenderingContext2D(nsIDOMCanvasRenderingContext2D** aResult) +{ + Telemetry::Accumulate(Telemetry::CANVAS_2D_USED, 1); + nsRefPtr ctx = + new mozilla::dom::CanvasRenderingContext2D(); + + ctx.forget(aResult); + return NS_OK; +} + +namespace mozilla { +namespace dom { + static float kDefaultFontSize = 10.0; static NS_NAMED_LITERAL_STRING(kDefaultFontName, "sans-serif"); static NS_NAMED_LITERAL_STRING(kDefaultFontStyle, "10px sans-serif"); +// Cap sigma to avoid overly large temp surfaces. +const Float SIGMA_MAX = 100; + /* Memory reporter stuff */ static nsIMemoryReporter *gCanvasAzureMemoryReporter = nullptr; static int64_t gCanvasAzureMemoryUsed = 0; @@ -136,12 +156,12 @@ NS_MEMORY_REPORTER_IMPLEMENT(CanvasAzureMemory, "Memory used by 2D canvases. Each canvas requires (width * height * 4) " "bytes.") -class nsCanvasRadialGradientAzure : public nsCanvasGradientAzure +class CanvasRadialGradient : public CanvasGradient { public: - nsCanvasRadialGradientAzure(const Point &aBeginOrigin, Float aBeginRadius, - const Point &aEndOrigin, Float aEndRadius) - : nsCanvasGradientAzure(RADIAL) + CanvasRadialGradient(const Point &aBeginOrigin, Float aBeginRadius, + const Point &aEndOrigin, Float aEndRadius) + : CanvasGradient(RADIAL) , mCenter1(aBeginOrigin) , mCenter2(aEndOrigin) , mRadius1(aBeginRadius) @@ -155,11 +175,11 @@ public: Float mRadius2; }; -class nsCanvasLinearGradientAzure : public nsCanvasGradientAzure +class CanvasLinearGradient : public CanvasGradient { public: - nsCanvasLinearGradientAzure(const Point &aBegin, const Point &aEnd) - : nsCanvasGradientAzure(LINEAR) + CanvasLinearGradient(const Point &aBegin, const Point &aEnd) + : CanvasGradient(LINEAR) , mBegin(aBegin) , mEnd(aEnd) { @@ -181,8 +201,8 @@ protected: class CanvasGeneralPattern { public: - typedef nsCanvasRenderingContext2DAzure::Style Style; - typedef nsCanvasRenderingContext2DAzure::ContextState ContextState; + typedef CanvasRenderingContext2D::Style Style; + typedef CanvasRenderingContext2D::ContextState ContextState; CanvasGeneralPattern() : mPattern(nullptr) {} ~CanvasGeneralPattern() @@ -192,7 +212,7 @@ public: } } - Pattern& ForStyle(nsCanvasRenderingContext2DAzure *aCtx, + Pattern& ForStyle(CanvasRenderingContext2D *aCtx, Style aStyle, DrawTarget *aRT) { @@ -205,17 +225,17 @@ public: if (state.StyleIsColor(aStyle)) { mPattern = new (mColorPattern.addr()) ColorPattern(Color::FromABGR(state.colorStyles[aStyle])); } else if (state.gradientStyles[aStyle] && - state.gradientStyles[aStyle]->GetType() == nsCanvasGradientAzure::LINEAR) { - nsCanvasLinearGradientAzure *gradient = - static_cast(state.gradientStyles[aStyle].get()); + state.gradientStyles[aStyle]->GetType() == CanvasGradient::LINEAR) { + CanvasLinearGradient *gradient = + static_cast(state.gradientStyles[aStyle].get()); mPattern = new (mLinearGradientPattern.addr()) LinearGradientPattern(gradient->mBegin, gradient->mEnd, gradient->GetGradientStopsForTarget(aRT)); } else if (state.gradientStyles[aStyle] && - state.gradientStyles[aStyle]->GetType() == nsCanvasGradientAzure::RADIAL) { - nsCanvasRadialGradientAzure *gradient = - static_cast(state.gradientStyles[aStyle].get()); + state.gradientStyles[aStyle]->GetType() == CanvasGradient::RADIAL) { + CanvasRadialGradient *gradient = + static_cast(state.gradientStyles[aStyle].get()); mPattern = new (mRadialGradientPattern.addr()) RadialGradientPattern(gradient->mCenter1, gradient->mCenter2, gradient->mRadius1, @@ -229,7 +249,7 @@ public: } ExtendMode mode; - if (state.patternStyles[aStyle]->mRepeat == nsCanvasPatternAzure::NOREPEAT) { + if (state.patternStyles[aStyle]->mRepeat == CanvasPattern::NOREPEAT) { mode = EXTEND_CLAMP; } else { mode = EXTEND_REPEAT; @@ -262,9 +282,9 @@ public: class AdjustedTarget { public: - typedef nsCanvasRenderingContext2DAzure::ContextState ContextState; + typedef CanvasRenderingContext2D::ContextState ContextState; - AdjustedTarget(nsCanvasRenderingContext2DAzure *ctx, + AdjustedTarget(CanvasRenderingContext2D *ctx, mgfx::Rect *aBounds = nullptr) : mCtx(nullptr) { @@ -312,7 +332,7 @@ public: mTarget = mCtx->mTarget->CreateShadowDrawTarget(IntSize(int32_t(mTempRect.width), int32_t(mTempRect.height)), - FORMAT_B8G8R8A8, mSigma); + FORMAT_B8G8R8A8, mSigma); if (!mTarget) { // XXX - Deal with the situation where our temp size is too big to @@ -345,13 +365,13 @@ public: private: RefPtr mTarget; - nsCanvasRenderingContext2DAzure *mCtx; + CanvasRenderingContext2D *mCtx; Float mSigma; mgfx::Rect mTempRect; }; NS_IMETHODIMP -nsCanvasGradientAzure::AddColorStop(float offset, const nsAString& colorstr) +CanvasGradient::AddColorStop(float offset, const nsAString& colorstr) { if (!FloatValidate(offset) || offset < 0.0 || offset > 1.0) { return NS_ERROR_DOM_INDEX_SIZE_ERR; @@ -380,51 +400,44 @@ nsCanvasGradientAzure::AddColorStop(float offset, const nsAString& colorstr) return NS_OK; } -NS_DEFINE_STATIC_IID_ACCESSOR(nsCanvasGradientAzure, NS_CANVASGRADIENTAZURE_PRIVATE_IID) +NS_DEFINE_STATIC_IID_ACCESSOR(CanvasGradient, NS_CANVASGRADIENTAZURE_PRIVATE_IID) -NS_IMPL_ADDREF(nsCanvasGradientAzure) -NS_IMPL_RELEASE(nsCanvasGradientAzure) +NS_IMPL_ADDREF(CanvasGradient) +NS_IMPL_RELEASE(CanvasGradient) -// XXX -// DOMCI_DATA(CanvasGradient, nsCanvasGradientAzure) - -NS_INTERFACE_MAP_BEGIN(nsCanvasGradientAzure) - NS_INTERFACE_MAP_ENTRY(nsCanvasGradientAzure) +NS_INTERFACE_MAP_BEGIN(CanvasGradient) + NS_INTERFACE_MAP_ENTRY(mozilla::dom::CanvasGradient) NS_INTERFACE_MAP_ENTRY(nsIDOMCanvasGradient) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CanvasGradient) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_END -NS_DEFINE_STATIC_IID_ACCESSOR(nsCanvasPatternAzure, NS_CANVASPATTERNAZURE_PRIVATE_IID) +NS_DEFINE_STATIC_IID_ACCESSOR(CanvasPattern, NS_CANVASPATTERNAZURE_PRIVATE_IID) -NS_IMPL_ADDREF(nsCanvasPatternAzure) -NS_IMPL_RELEASE(nsCanvasPatternAzure) +NS_IMPL_ADDREF(CanvasPattern) +NS_IMPL_RELEASE(CanvasPattern) -// XXX -// DOMCI_DATA(CanvasPattern, nsCanvasPatternAzure) - -NS_INTERFACE_MAP_BEGIN(nsCanvasPatternAzure) - NS_INTERFACE_MAP_ENTRY(nsCanvasPatternAzure) +NS_INTERFACE_MAP_BEGIN(CanvasPattern) + NS_INTERFACE_MAP_ENTRY(mozilla::dom::CanvasPattern) NS_INTERFACE_MAP_ENTRY(nsIDOMCanvasPattern) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CanvasPattern) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_END /** - ** nsTextMetricsAzure + ** TextMetrics **/ -#define NS_TEXTMETRICSAZURE_PRIVATE_IID \ - {0x9793f9e7, 0x9dc1, 0x4e9c, {0x81, 0xc8, 0xfc, 0xa7, 0x14, 0xf4, 0x30, 0x79}} -class nsTextMetricsAzure : public nsIDOMTextMetrics +class TextMetrics : public nsIDOMTextMetrics { public: - nsTextMetricsAzure(float w) : width(w) { } + TextMetrics(float w) : width(w) { } - virtual ~nsTextMetricsAzure() { } + virtual ~TextMetrics() { } NS_DECLARE_STATIC_IID_ACCESSOR(NS_TEXTMETRICSAZURE_PRIVATE_IID) - NS_IMETHOD GetWidth(float* w) { + NS_IMETHOD GetWidth(float* w) + { *w = width; return NS_OK; } @@ -435,32 +448,26 @@ private: float width; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsTextMetricsAzure, NS_TEXTMETRICSAZURE_PRIVATE_IID) +NS_DEFINE_STATIC_IID_ACCESSOR(TextMetrics, NS_TEXTMETRICSAZURE_PRIVATE_IID) -NS_IMPL_ADDREF(nsTextMetricsAzure) -NS_IMPL_RELEASE(nsTextMetricsAzure) +NS_IMPL_ADDREF(TextMetrics) +NS_IMPL_RELEASE(TextMetrics) -// XXX -// DOMCI_DATA(TextMetrics, nsTextMetricsAzure) - -NS_INTERFACE_MAP_BEGIN(nsTextMetricsAzure) - NS_INTERFACE_MAP_ENTRY(nsTextMetricsAzure) +NS_INTERFACE_MAP_BEGIN(TextMetrics) + NS_INTERFACE_MAP_ENTRY(mozilla::dom::TextMetrics) NS_INTERFACE_MAP_ENTRY(nsIDOMTextMetrics) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(TextMetrics) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_END -// Cap sigma to avoid overly large temp surfaces. -const Float SIGMA_MAX = 100; - -class CanvasRenderingContext2DUserDataAzure : public LayerUserData { +class CanvasRenderingContext2DUserData : public LayerUserData { public: - CanvasRenderingContext2DUserDataAzure(nsCanvasRenderingContext2DAzure *aContext) + CanvasRenderingContext2DUserData(CanvasRenderingContext2D *aContext) : mContext(aContext) { aContext->mUserDatas.AppendElement(this); } - ~CanvasRenderingContext2DUserDataAzure() + ~CanvasRenderingContext2DUserData() { if (mContext) { mContext->mUserDatas.RemoveElement(this); @@ -468,13 +475,13 @@ public: } static void DidTransactionCallback(void* aData) { - CanvasRenderingContext2DUserDataAzure* self = - static_cast(aData); + CanvasRenderingContext2DUserData* self = + static_cast(aData); if (self->mContext) { self->mContext->MarkContextClean(); } } - bool IsForContext(nsCanvasRenderingContext2DAzure *aContext) + bool IsForContext(CanvasRenderingContext2D *aContext) { return mContext == aContext; } @@ -484,26 +491,26 @@ public: } private: - nsCanvasRenderingContext2DAzure *mContext; + CanvasRenderingContext2D *mContext; }; -NS_IMPL_CYCLE_COLLECTING_ADDREF(nsCanvasRenderingContext2DAzure) -NS_IMPL_CYCLE_COLLECTING_RELEASE(nsCanvasRenderingContext2DAzure) +NS_IMPL_CYCLE_COLLECTING_ADDREF(CanvasRenderingContext2D) +NS_IMPL_CYCLE_COLLECTING_RELEASE(CanvasRenderingContext2D) -NS_IMPL_CYCLE_COLLECTION_CLASS(nsCanvasRenderingContext2DAzure) -NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsCanvasRenderingContext2DAzure) +NS_IMPL_CYCLE_COLLECTION_CLASS(CanvasRenderingContext2D) +NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(CanvasRenderingContext2D) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mCanvasElement) NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER NS_IMPL_CYCLE_COLLECTION_UNLINK_END -NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsCanvasRenderingContext2DAzure) +NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(CanvasRenderingContext2D) NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER NS_IMPL_CYCLE_COLLECTION_TRACE_END -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsCanvasRenderingContext2DAzure) +NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(CanvasRenderingContext2D) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mCanvasElement, nsINode) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END -NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsCanvasRenderingContext2DAzure) +NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(CanvasRenderingContext2D) if (nsCCUncollectableMarker::sGeneration && tmp->IsBlack()) { nsGenericElement* canvasElement = tmp->mCanvasElement; if (canvasElement) { @@ -516,18 +523,15 @@ NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsCanvasRenderingContext2DAzure) } NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END -NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(nsCanvasRenderingContext2DAzure) +NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(CanvasRenderingContext2D) return nsCCUncollectableMarker::sGeneration && tmp->IsBlack(); NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END -NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(nsCanvasRenderingContext2DAzure) +NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(CanvasRenderingContext2D) return nsCCUncollectableMarker::sGeneration && tmp->IsBlack(); NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END -// XXX -// DOMCI_DATA(CanvasRenderingContext2D, nsCanvasRenderingContext2DAzure) - -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsCanvasRenderingContext2DAzure) +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CanvasRenderingContext2D) NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY NS_INTERFACE_MAP_ENTRY(nsIDOMCanvasRenderingContext2D) NS_INTERFACE_MAP_ENTRY(nsICanvasRenderingContextInternal) @@ -542,41 +546,14 @@ NS_INTERFACE_MAP_END // Initialize our static variables. -uint32_t nsCanvasRenderingContext2DAzure::sNumLivingContexts = 0; -uint8_t (*nsCanvasRenderingContext2DAzure::sUnpremultiplyTable)[256] = nullptr; -uint8_t (*nsCanvasRenderingContext2DAzure::sPremultiplyTable)[256] = nullptr; -DrawTarget* nsCanvasRenderingContext2DAzure::sErrorTarget = nullptr; +uint32_t CanvasRenderingContext2D::sNumLivingContexts = 0; +uint8_t (*CanvasRenderingContext2D::sUnpremultiplyTable)[256] = nullptr; +uint8_t (*CanvasRenderingContext2D::sPremultiplyTable)[256] = nullptr; +DrawTarget* CanvasRenderingContext2D::sErrorTarget = nullptr; -namespace mozilla { -namespace dom { -bool -AzureCanvasEnabled() -{ - return gfxPlatform::GetPlatform()->SupportsAzureCanvas(); -} -} -} - -nsresult -NS_NewCanvasRenderingContext2DAzure(nsIDOMCanvasRenderingContext2D** aResult) -{ - // XXX[nrc] remove this check when Thebes canvas is removed - // (because we will always support Azure) - if (!AzureCanvasEnabled()) { - return NS_ERROR_NOT_AVAILABLE; - } - - nsRefPtr ctx = new nsCanvasRenderingContext2DAzure(); - if (!ctx) - return NS_ERROR_OUT_OF_MEMORY; - - *aResult = ctx.forget().get(); - return NS_OK; -} - -nsCanvasRenderingContext2DAzure::nsCanvasRenderingContext2DAzure() +CanvasRenderingContext2D::CanvasRenderingContext2D() : mZero(false), mOpaque(false), mResetLayer(true) , mIPC(false) , mIsEntireFrameInvalid(false) @@ -587,10 +564,10 @@ nsCanvasRenderingContext2DAzure::nsCanvasRenderingContext2DAzure() SetIsDOMBinding(); } -nsCanvasRenderingContext2DAzure::~nsCanvasRenderingContext2DAzure() +CanvasRenderingContext2D::~CanvasRenderingContext2D() { Reset(); - // Drop references from all CanvasRenderingContext2DUserDataAzure to this context + // Drop references from all CanvasRenderingContext2DUserData to this context for (uint32_t i = 0; i < mUserDatas.Length(); ++i) { mUserDatas[i]->Forget(); } @@ -605,15 +582,15 @@ nsCanvasRenderingContext2DAzure::~nsCanvasRenderingContext2DAzure() } JSObject* -nsCanvasRenderingContext2DAzure::WrapObject(JSContext *cx, JSObject *scope, - bool *triedToWrap) +CanvasRenderingContext2D::WrapObject(JSContext *cx, JSObject *scope, + bool *triedToWrap) { return CanvasRenderingContext2DBinding::Wrap(cx, scope, this, triedToWrap); } bool -nsCanvasRenderingContext2DAzure::ParseColor(const nsAString& aString, - nscolor* aColor) +CanvasRenderingContext2D::ParseColor(const nsAString& aString, + nscolor* aColor) { nsIDocument* document = mCanvasElement ? mCanvasElement->OwnerDoc() @@ -642,7 +619,7 @@ nsCanvasRenderingContext2DAzure::ParseColor(const nsAString& aString, } nsresult -nsCanvasRenderingContext2DAzure::Reset() +CanvasRenderingContext2D::Reset() { if (mCanvasElement) { mCanvasElement->InvalidateCanvas(); @@ -677,8 +654,8 @@ WarnAboutUnexpectedStyle(nsHTMLCanvasElement* canvasElement) } void -nsCanvasRenderingContext2DAzure::SetStyleFromString(const nsAString& str, - Style whichStyle) +CanvasRenderingContext2D::SetStyleFromString(const nsAString& str, + Style whichStyle) { MOZ_ASSERT(!str.IsVoid()); @@ -691,9 +668,9 @@ nsCanvasRenderingContext2DAzure::SetStyleFromString(const nsAString& str, } void -nsCanvasRenderingContext2DAzure::SetStyleFromStringOrInterface(const nsAString& aStr, - nsISupports *aInterface, - Style aWhichStyle) +CanvasRenderingContext2D::SetStyleFromStringOrInterface(const nsAString& aStr, + nsISupports *aInterface, + Style aWhichStyle) { if (!aStr.IsVoid()) { SetStyleFromString(aStr, aWhichStyle); @@ -701,13 +678,13 @@ nsCanvasRenderingContext2DAzure::SetStyleFromStringOrInterface(const nsAString& } if (aInterface) { - nsCOMPtr grad(do_QueryInterface(aInterface)); + nsCOMPtr grad(do_QueryInterface(aInterface)); if (grad) { SetStyleFromGradient(grad, aWhichStyle); return; } - nsCOMPtr pattern(do_QueryInterface(aInterface)); + nsCOMPtr pattern(do_QueryInterface(aInterface)); if (pattern) { SetStyleFromPattern(pattern, aWhichStyle); return; @@ -718,9 +695,9 @@ nsCanvasRenderingContext2DAzure::SetStyleFromStringOrInterface(const nsAString& } nsISupports* -nsCanvasRenderingContext2DAzure::GetStyleAsStringOrInterface(nsAString& aStr, - CanvasMultiGetterType& aType, - Style aWhichStyle) +CanvasRenderingContext2D::GetStyleAsStringOrInterface(nsAString& aStr, + CanvasMultiGetterType& aType, + Style aWhichStyle) { const ContextState &state = CurrentState(); nsISupports* supports; @@ -742,7 +719,7 @@ nsCanvasRenderingContext2DAzure::GetStyleAsStringOrInterface(nsAString& aStr, // static void -nsCanvasRenderingContext2DAzure::StyleColorToString(const nscolor& aColor, nsAString& aStr) +CanvasRenderingContext2D::StyleColorToString(const nscolor& aColor, nsAString& aStr) { // We can't reuse the normal CSS color stringification code, // because the spec calls for a different algorithm for canvas. @@ -764,7 +741,7 @@ nsCanvasRenderingContext2DAzure::StyleColorToString(const nscolor& aColor, nsASt } nsresult -nsCanvasRenderingContext2DAzure::Redraw() +CanvasRenderingContext2D::Redraw() { if (mIsEntireFrameInvalid) { return NS_OK; @@ -790,7 +767,7 @@ nsCanvasRenderingContext2DAzure::Redraw() } void -nsCanvasRenderingContext2DAzure::Redraw(const mgfx::Rect &r) +CanvasRenderingContext2D::Redraw(const mgfx::Rect &r) { ++mInvalidateCount; @@ -823,7 +800,7 @@ nsCanvasRenderingContext2DAzure::Redraw(const mgfx::Rect &r) } void -nsCanvasRenderingContext2DAzure::RedrawUser(const gfxRect& r) +CanvasRenderingContext2D::RedrawUser(const gfxRect& r) { if (mIsEntireFrameInvalid) { ++mInvalidateCount; @@ -836,7 +813,7 @@ nsCanvasRenderingContext2DAzure::RedrawUser(const gfxRect& r) } void -nsCanvasRenderingContext2DAzure::EnsureTarget() +CanvasRenderingContext2D::EnsureTarget() { if (mTarget) { return; @@ -894,7 +871,7 @@ nsCanvasRenderingContext2DAzure::EnsureTarget() } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetDimensions(int32_t width, int32_t height) +CanvasRenderingContext2D::SetDimensions(int32_t width, int32_t height) { ClearTarget(); @@ -913,7 +890,7 @@ nsCanvasRenderingContext2DAzure::SetDimensions(int32_t width, int32_t height) } void -nsCanvasRenderingContext2DAzure::ClearTarget() +CanvasRenderingContext2D::ClearTarget() { Reset(); @@ -934,13 +911,17 @@ nsCanvasRenderingContext2DAzure::ClearTarget() } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::InitializeWithSurface(nsIDocShell *shell, gfxASurface *surface, int32_t width, int32_t height) +CanvasRenderingContext2D::InitializeWithSurface(nsIDocShell *shell, + gfxASurface *surface, + int32_t width, + int32_t height) { mDocShell = shell; mThebesSurface = surface; SetDimensions(width, height); - mTarget = gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(surface, IntSize(width, height)); + mTarget = gfxPlatform::GetPlatform()-> + CreateDrawTargetForSurface(surface, IntSize(width, height)); if (!mTarget) { EnsureErrorTarget(); mTarget = sErrorTarget; @@ -950,7 +931,7 @@ nsCanvasRenderingContext2DAzure::InitializeWithSurface(nsIDocShell *shell, gfxAS } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetIsOpaque(bool isOpaque) +CanvasRenderingContext2D::SetIsOpaque(bool isOpaque) { if (isOpaque != mOpaque) { mOpaque = isOpaque; @@ -961,7 +942,7 @@ nsCanvasRenderingContext2DAzure::SetIsOpaque(bool isOpaque) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetIsIPC(bool isIPC) +CanvasRenderingContext2D::SetIsIPC(bool isIPC) { if (isIPC != mIPC) { mIPC = isIPC; @@ -972,7 +953,7 @@ nsCanvasRenderingContext2DAzure::SetIsIPC(bool isIPC) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::Render(gfxContext *ctx, gfxPattern::GraphicsFilter aFilter, uint32_t aFlags) +CanvasRenderingContext2D::Render(gfxContext *ctx, gfxPattern::GraphicsFilter aFilter, uint32_t aFlags) { nsresult rv = NS_OK; @@ -1017,9 +998,9 @@ nsCanvasRenderingContext2DAzure::Render(gfxContext *ctx, gfxPattern::GraphicsFil } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetInputStream(const char *aMimeType, - const PRUnichar *aEncoderOptions, - nsIInputStream **aStream) +CanvasRenderingContext2D::GetInputStream(const char *aMimeType, + const PRUnichar *aEncoderOptions, + nsIInputStream **aStream) { EnsureTarget(); if (!IsTargetValid()) { @@ -1083,17 +1064,17 @@ nsCanvasRenderingContext2DAzure::GetInputStream(const char *aMimeType, } SurfaceFormat -nsCanvasRenderingContext2DAzure::GetSurfaceFormat() const +CanvasRenderingContext2D::GetSurfaceFormat() const { return mOpaque ? FORMAT_B8G8R8X8 : FORMAT_B8G8R8A8; } // -// nsCanvasRenderingContext2DAzure impl +// CanvasRenderingContext2D impl // NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetCanvas(nsIDOMHTMLCanvasElement **canvas) +CanvasRenderingContext2D::GetCanvas(nsIDOMHTMLCanvasElement **canvas) { if (mCanvasElement) { NS_IF_ADDREF(*canvas = mCanvasElement->GetOriginalCanvas()); @@ -1107,7 +1088,7 @@ nsCanvasRenderingContext2DAzure::GetCanvas(nsIDOMHTMLCanvasElement **canvas) // void -nsCanvasRenderingContext2DAzure::Save() +CanvasRenderingContext2D::Save() { EnsureTarget(); mStyleStack[mStyleStack.Length() - 1].transform = mTarget->GetTransform(); @@ -1116,14 +1097,14 @@ nsCanvasRenderingContext2DAzure::Save() } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::MozSave() +CanvasRenderingContext2D::MozSave() { Save(); return NS_OK; } void -nsCanvasRenderingContext2DAzure::Restore() +CanvasRenderingContext2D::Restore() { if (mStyleStack.Length() - 1 == 0) return; @@ -1140,7 +1121,7 @@ nsCanvasRenderingContext2DAzure::Restore() } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::MozRestore() +CanvasRenderingContext2D::MozRestore() { Restore(); return NS_OK; @@ -1151,7 +1132,7 @@ nsCanvasRenderingContext2DAzure::MozRestore() // void -nsCanvasRenderingContext2DAzure::Scale(double x, double y, ErrorResult& error) +CanvasRenderingContext2D::Scale(double x, double y, ErrorResult& error) { if (!FloatValidate(x,y)) { return; @@ -1168,7 +1149,7 @@ nsCanvasRenderingContext2DAzure::Scale(double x, double y, ErrorResult& error) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::Scale(float x, float y) +CanvasRenderingContext2D::Scale(float x, float y) { ErrorResult rv; Scale((double)x, (double)y, rv); @@ -1176,7 +1157,7 @@ nsCanvasRenderingContext2DAzure::Scale(float x, float y) } void -nsCanvasRenderingContext2DAzure::Rotate(double angle, ErrorResult& error) +CanvasRenderingContext2D::Rotate(double angle, ErrorResult& error) { if (!FloatValidate(angle)) { return; @@ -1194,7 +1175,7 @@ nsCanvasRenderingContext2DAzure::Rotate(double angle, ErrorResult& error) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::Rotate(float angle) +CanvasRenderingContext2D::Rotate(float angle) { ErrorResult rv; Rotate((double)angle, rv); @@ -1202,7 +1183,7 @@ nsCanvasRenderingContext2DAzure::Rotate(float angle) } void -nsCanvasRenderingContext2DAzure::Translate(double x, double y, ErrorResult& error) +CanvasRenderingContext2D::Translate(double x, double y, ErrorResult& error) { if (!FloatValidate(x,y)) { return; @@ -1219,7 +1200,7 @@ nsCanvasRenderingContext2DAzure::Translate(double x, double y, ErrorResult& erro } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::Translate(float x, float y) +CanvasRenderingContext2D::Translate(float x, float y) { ErrorResult rv; Translate((double)x, (double)y, rv); @@ -1227,9 +1208,9 @@ nsCanvasRenderingContext2DAzure::Translate(float x, float y) } void -nsCanvasRenderingContext2DAzure::Transform(double m11, double m12, double m21, - double m22, double dx, double dy, - ErrorResult& error) +CanvasRenderingContext2D::Transform(double m11, double m12, double m21, + double m22, double dx, double dy, + ErrorResult& error) { if (!FloatValidate(m11,m12,m21,m22,dx,dy)) { return; @@ -1246,7 +1227,7 @@ nsCanvasRenderingContext2DAzure::Transform(double m11, double m12, double m21, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::Transform(float m11, float m12, float m21, float m22, float dx, float dy) +CanvasRenderingContext2D::Transform(float m11, float m12, float m21, float m22, float dx, float dy) { ErrorResult rv; Transform((double)m11, (double)m12, (double)m21, (double)m22, (double)dx, @@ -1255,10 +1236,10 @@ nsCanvasRenderingContext2DAzure::Transform(float m11, float m12, float m21, floa } void -nsCanvasRenderingContext2DAzure::SetTransform(double m11, double m12, - double m21, double m22, - double dx, double dy, - ErrorResult& error) +CanvasRenderingContext2D::SetTransform(double m11, double m12, + double m21, double m22, + double dx, double dy, + ErrorResult& error) { if (!FloatValidate(m11,m12,m21,m22,dx,dy)) { return; @@ -1275,7 +1256,7 @@ nsCanvasRenderingContext2DAzure::SetTransform(double m11, double m12, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetTransform(float m11, float m12, float m21, float m22, float dx, float dy) +CanvasRenderingContext2D::SetTransform(float m11, float m12, float m21, float m22, float dx, float dy) { ErrorResult rv; SetTransform((double)m11, (double)m12, (double)m21, (double)m22, (double)dx, @@ -1287,15 +1268,15 @@ JSObject* MatrixToJSObject(JSContext* cx, const Matrix& matrix, ErrorResult& error) { jsval elts[] = { - DOUBLE_TO_JSVAL(matrix._11), DOUBLE_TO_JSVAL(matrix._12), - DOUBLE_TO_JSVAL(matrix._21), DOUBLE_TO_JSVAL(matrix._22), - DOUBLE_TO_JSVAL(matrix._31), DOUBLE_TO_JSVAL(matrix._32) + DOUBLE_TO_JSVAL(matrix._11), DOUBLE_TO_JSVAL(matrix._12), + DOUBLE_TO_JSVAL(matrix._21), DOUBLE_TO_JSVAL(matrix._22), + DOUBLE_TO_JSVAL(matrix._31), DOUBLE_TO_JSVAL(matrix._32) }; // XXX Should we enter GetWrapper()'s compartment? JSObject* obj = JS_NewArrayObject(cx, 6, elts); if (!obj) { - error.Throw(NS_ERROR_OUT_OF_MEMORY); + error.Throw(NS_ERROR_OUT_OF_MEMORY); } return obj; } @@ -1333,9 +1314,9 @@ ObjectToMatrix(JSContext* cx, JSObject& obj, Matrix& matrix, ErrorResult& error) } void -nsCanvasRenderingContext2DAzure::SetMozCurrentTransform(JSContext* cx, - JSObject& currentTransform, - ErrorResult& error) +CanvasRenderingContext2D::SetMozCurrentTransform(JSContext* cx, + JSObject& currentTransform, + ErrorResult& error) { EnsureTarget(); if (!IsTargetValid()) { @@ -1350,8 +1331,8 @@ nsCanvasRenderingContext2DAzure::SetMozCurrentTransform(JSContext* cx, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetMozCurrentTransform(JSContext* cx, - const jsval& matrix) +CanvasRenderingContext2D::SetMozCurrentTransform(JSContext* cx, + const jsval& matrix) { if (!matrix.isObject()) { return NS_ERROR_INVALID_ARG; @@ -1363,15 +1344,15 @@ nsCanvasRenderingContext2DAzure::SetMozCurrentTransform(JSContext* cx, } JSObject* -nsCanvasRenderingContext2DAzure::GetMozCurrentTransform(JSContext* cx, - ErrorResult& error) const +CanvasRenderingContext2D::GetMozCurrentTransform(JSContext* cx, + ErrorResult& error) const { return MatrixToJSObject(cx, mTarget ? mTarget->GetTransform() : Matrix(), error); } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetMozCurrentTransform(JSContext* cx, - jsval* matrix) +CanvasRenderingContext2D::GetMozCurrentTransform(JSContext* cx, + jsval* matrix) { ErrorResult rv; JSObject* obj = GetMozCurrentTransform(cx, rv); @@ -1382,9 +1363,9 @@ nsCanvasRenderingContext2DAzure::GetMozCurrentTransform(JSContext* cx, } void -nsCanvasRenderingContext2DAzure::SetMozCurrentTransformInverse(JSContext* cx, - JSObject& currentTransform, - ErrorResult& error) +CanvasRenderingContext2D::SetMozCurrentTransformInverse(JSContext* cx, + JSObject& currentTransform, + ErrorResult& error) { EnsureTarget(); if (!IsTargetValid()) { @@ -1402,8 +1383,8 @@ nsCanvasRenderingContext2DAzure::SetMozCurrentTransformInverse(JSContext* cx, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetMozCurrentTransformInverse(JSContext* cx, - const jsval& matrix) +CanvasRenderingContext2D::SetMozCurrentTransformInverse(JSContext* cx, + const jsval& matrix) { if (!matrix.isObject()) { return NS_ERROR_INVALID_ARG; @@ -1415,8 +1396,8 @@ nsCanvasRenderingContext2DAzure::SetMozCurrentTransformInverse(JSContext* cx, } JSObject* -nsCanvasRenderingContext2DAzure::GetMozCurrentTransformInverse(JSContext* cx, - ErrorResult& error) const +CanvasRenderingContext2D::GetMozCurrentTransformInverse(JSContext* cx, + ErrorResult& error) const { if (!mTarget) { return MatrixToJSObject(cx, Matrix(), error); @@ -1433,8 +1414,8 @@ nsCanvasRenderingContext2DAzure::GetMozCurrentTransformInverse(JSContext* cx, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetMozCurrentTransformInverse(JSContext* cx, - jsval* matrix) +CanvasRenderingContext2D::GetMozCurrentTransformInverse(JSContext* cx, + jsval* matrix) { ErrorResult rv; JSObject* obj = GetMozCurrentTransformInverse(cx, rv); @@ -1449,23 +1430,23 @@ nsCanvasRenderingContext2DAzure::GetMozCurrentTransformInverse(JSContext* cx, // NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetGlobalAlpha(float aGlobalAlpha) +CanvasRenderingContext2D::SetGlobalAlpha(float aGlobalAlpha) { SetGlobalAlpha((double)aGlobalAlpha); return NS_OK; } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetGlobalAlpha(float *aGlobalAlpha) +CanvasRenderingContext2D::GetGlobalAlpha(float *aGlobalAlpha) { *aGlobalAlpha = GlobalAlpha(); return NS_OK; } void -nsCanvasRenderingContext2DAzure::SetStyleFromJSValue(JSContext* cx, - JS::Value& value, - Style whichStyle) +CanvasRenderingContext2D::SetStyleFromJSValue(JSContext* cx, + JS::Value& value, + Style whichStyle) { if (value.isString()) { nsDependentJSString strokeStyle; @@ -1478,19 +1459,19 @@ nsCanvasRenderingContext2DAzure::SetStyleFromJSValue(JSContext* cx, if (value.isObject()) { nsCOMPtr holder; - nsCanvasGradientAzure* gradient; - nsresult rv = xpc_qsUnwrapArg(cx, value, &gradient, - static_cast(getter_AddRefs(holder)), - &value); + CanvasGradient* gradient; + nsresult rv = xpc_qsUnwrapArg(cx, value, &gradient, + static_cast(getter_AddRefs(holder)), + &value); if (NS_SUCCEEDED(rv)) { SetStyleFromGradient(gradient, whichStyle); return; } - nsCanvasPatternAzure* pattern; - rv = xpc_qsUnwrapArg(cx, value, &pattern, - static_cast(getter_AddRefs(holder)), - &value); + CanvasPattern* pattern; + rv = xpc_qsUnwrapArg(cx, value, &pattern, + static_cast(getter_AddRefs(holder)), + &value); if (NS_SUCCEEDED(rv)) { SetStyleFromPattern(pattern, whichStyle); return; @@ -1529,7 +1510,7 @@ WrapStyle(JSContext* cx, JSObject* obj, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetStrokeStyle(nsIVariant *aValue) +CanvasRenderingContext2D::SetStrokeStyle(nsIVariant *aValue) { if (!aValue) return NS_ERROR_FAILURE; @@ -1563,8 +1544,8 @@ nsCanvasRenderingContext2DAzure::SetStrokeStyle(nsIVariant *aValue) } JS::Value -nsCanvasRenderingContext2DAzure::GetStrokeStyle(JSContext* cx, - ErrorResult& error) +CanvasRenderingContext2D::GetStrokeStyle(JSContext* cx, + ErrorResult& error) { nsString str; CanvasMultiGetterType t; @@ -1573,7 +1554,7 @@ nsCanvasRenderingContext2DAzure::GetStrokeStyle(JSContext* cx, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetStrokeStyle(nsIVariant **aResult) +CanvasRenderingContext2D::GetStrokeStyle(nsIVariant **aResult) { nsCOMPtr wv = do_CreateInstance(NS_VARIANT_CONTRACTID); @@ -1602,7 +1583,7 @@ nsCanvasRenderingContext2DAzure::GetStrokeStyle(nsIVariant **aResult) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetFillStyle(nsIVariant *aValue) +CanvasRenderingContext2D::SetFillStyle(nsIVariant *aValue) { if (!aValue) { return NS_ERROR_FAILURE; @@ -1633,8 +1614,8 @@ nsCanvasRenderingContext2DAzure::SetFillStyle(nsIVariant *aValue) } JS::Value -nsCanvasRenderingContext2DAzure::GetFillStyle(JSContext* cx, - ErrorResult& error) +CanvasRenderingContext2D::GetFillStyle(JSContext* cx, + ErrorResult& error) { nsString str; CanvasMultiGetterType t; @@ -1643,7 +1624,7 @@ nsCanvasRenderingContext2DAzure::GetFillStyle(JSContext* cx, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetFillStyle(nsIVariant **aResult) +CanvasRenderingContext2D::GetFillStyle(nsIVariant **aResult) { nsCOMPtr wv = do_CreateInstance(NS_VARIANT_CONTRACTID); @@ -1672,7 +1653,7 @@ nsCanvasRenderingContext2DAzure::GetFillStyle(nsIVariant **aResult) } void -nsCanvasRenderingContext2DAzure::SetFillRule(const nsAString& aString) +CanvasRenderingContext2D::SetFillRule(const nsAString& aString) { FillRule rule; @@ -1687,39 +1668,39 @@ nsCanvasRenderingContext2DAzure::SetFillRule(const nsAString& aString) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetMozFillRule(const nsAString& aString) +CanvasRenderingContext2D::SetMozFillRule(const nsAString& aString) { SetFillRule(aString); return NS_OK; } void -nsCanvasRenderingContext2DAzure::GetFillRule(nsAString& aString) +CanvasRenderingContext2D::GetFillRule(nsAString& aString) { switch (CurrentState().fillRule) { case FILL_WINDING: - aString.AssignLiteral("nonzero"); break; + aString.AssignLiteral("nonzero"); break; case FILL_EVEN_ODD: - aString.AssignLiteral("evenodd"); break; + aString.AssignLiteral("evenodd"); break; } } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetMozFillRule(nsAString& aString) +CanvasRenderingContext2D::GetMozFillRule(nsAString& aString) { GetFillRule(aString); return NS_OK; } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetStrokeStyle_multi(const nsAString& aStr, nsISupports *aInterface) +CanvasRenderingContext2D::SetStrokeStyle_multi(const nsAString& aStr, nsISupports *aInterface) { SetStyleFromStringOrInterface(aStr, aInterface, STYLE_STROKE); return NS_OK; } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetStrokeStyle_multi(nsAString& aStr, nsISupports **aInterface, int32_t *aType) +CanvasRenderingContext2D::GetStrokeStyle_multi(nsAString& aStr, nsISupports **aInterface, int32_t *aType) { CanvasMultiGetterType type; NS_IF_ADDREF(*aInterface = GetStyleAsStringOrInterface(aStr, type, STYLE_STROKE)); @@ -1728,14 +1709,14 @@ nsCanvasRenderingContext2DAzure::GetStrokeStyle_multi(nsAString& aStr, nsISuppor } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetFillStyle_multi(const nsAString& aStr, nsISupports *aInterface) +CanvasRenderingContext2D::SetFillStyle_multi(const nsAString& aStr, nsISupports *aInterface) { SetStyleFromStringOrInterface(aStr, aInterface, STYLE_FILL); return NS_OK; } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetFillStyle_multi(nsAString& aStr, nsISupports **aInterface, int32_t *aType) +CanvasRenderingContext2D::GetFillStyle_multi(nsAString& aStr, nsISupports **aInterface, int32_t *aType) { CanvasMultiGetterType type; NS_IF_ADDREF(*aInterface = GetStyleAsStringOrInterface(aStr, type, STYLE_FILL)); @@ -1747,8 +1728,8 @@ nsCanvasRenderingContext2DAzure::GetFillStyle_multi(nsAString& aStr, nsISupports // gradients and patterns // already_AddRefed -nsCanvasRenderingContext2DAzure::CreateLinearGradient(double x0, double y0, double x1, double y1, - ErrorResult& aError) +CanvasRenderingContext2D::CreateLinearGradient(double x0, double y0, double x1, double y1, + ErrorResult& aError) { if (!FloatValidate(x0,y0,x1,y1)) { aError.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); @@ -1756,14 +1737,14 @@ nsCanvasRenderingContext2DAzure::CreateLinearGradient(double x0, double y0, doub } nsRefPtr grad = - new nsCanvasLinearGradientAzure(Point(x0, y0), Point(x1, y1)); + new CanvasLinearGradient(Point(x0, y0), Point(x1, y1)); return grad.forget(); } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::CreateLinearGradient(float x0, float y0, float x1, float y1, - nsIDOMCanvasGradient **_retval) +CanvasRenderingContext2D::CreateLinearGradient(float x0, float y0, float x1, float y1, + nsIDOMCanvasGradient **_retval) { ErrorResult rv; *_retval = CreateLinearGradient(x0, y0, x1, y1, rv).get(); @@ -1771,9 +1752,9 @@ nsCanvasRenderingContext2DAzure::CreateLinearGradient(float x0, float y0, float } already_AddRefed -nsCanvasRenderingContext2DAzure::CreateRadialGradient(double x0, double y0, double r0, - double x1, double y1, double r1, - ErrorResult& aError) +CanvasRenderingContext2D::CreateRadialGradient(double x0, double y0, double r0, + double x1, double y1, double r1, + ErrorResult& aError) { if (!FloatValidate(x0,y0,r0,x1,y1,r1)) { aError.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); @@ -1786,15 +1767,15 @@ nsCanvasRenderingContext2DAzure::CreateRadialGradient(double x0, double y0, doub } nsRefPtr grad = - new nsCanvasRadialGradientAzure(Point(x0, y0), r0, Point(x1, y1), r1); + new CanvasRadialGradient(Point(x0, y0), r0, Point(x1, y1), r1); return grad.forget(); } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::CreateRadialGradient(float x0, float y0, float r0, - float x1, float y1, float r1, - nsIDOMCanvasGradient **_retval) +CanvasRenderingContext2D::CreateRadialGradient(float x0, float y0, float r0, + float x1, float y1, float r1, + nsIDOMCanvasGradient **_retval) { ErrorResult rv; *_retval = CreateRadialGradient(x0, y0, r0, x1, y1, r1, rv).get(); @@ -1802,21 +1783,21 @@ nsCanvasRenderingContext2DAzure::CreateRadialGradient(float x0, float y0, float } already_AddRefed -nsCanvasRenderingContext2DAzure::CreatePattern(const HTMLImageOrCanvasOrVideoElement& element, - const nsAString& repeat, - ErrorResult& error) +CanvasRenderingContext2D::CreatePattern(const HTMLImageOrCanvasOrVideoElement& element, + const nsAString& repeat, + ErrorResult& error) { - nsCanvasPatternAzure::RepeatMode repeatMode = - nsCanvasPatternAzure::NOREPEAT; + CanvasPattern::RepeatMode repeatMode = + CanvasPattern::NOREPEAT; if (repeat.IsEmpty() || repeat.EqualsLiteral("repeat")) { - repeatMode = nsCanvasPatternAzure::REPEAT; + repeatMode = CanvasPattern::REPEAT; } else if (repeat.EqualsLiteral("repeat-x")) { - repeatMode = nsCanvasPatternAzure::REPEATX; + repeatMode = CanvasPattern::REPEATX; } else if (repeat.EqualsLiteral("repeat-y")) { - repeatMode = nsCanvasPatternAzure::REPEATY; + repeatMode = CanvasPattern::REPEATY; } else if (repeat.EqualsLiteral("no-repeat")) { - repeatMode = nsCanvasPatternAzure::NOREPEAT; + repeatMode = CanvasPattern::NOREPEAT; } else { error.Throw(NS_ERROR_DOM_SYNTAX_ERR); return NULL; @@ -1839,8 +1820,8 @@ nsCanvasRenderingContext2DAzure::CreatePattern(const HTMLImageOrCanvasOrVideoEle // This might not be an Azure canvas! RefPtr srcSurf = srcCanvas->GetSurfaceSnapshot(); - nsRefPtr pat = - new nsCanvasPatternAzure(srcSurf, repeatMode, htmlElement->NodePrincipal(), canvas->IsWriteOnly(), false); + nsRefPtr pat = + new CanvasPattern(srcSurf, repeatMode, htmlElement->NodePrincipal(), canvas->IsWriteOnly(), false); return pat.forget(); } @@ -1870,17 +1851,17 @@ nsCanvasRenderingContext2DAzure::CreatePattern(const HTMLImageOrCanvasOrVideoEle RefPtr srcSurf = gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(mTarget, res.mSurface); - nsRefPtr pat = - new nsCanvasPatternAzure(srcSurf, repeatMode, res.mPrincipal, + nsRefPtr pat = + new CanvasPattern(srcSurf, repeatMode, res.mPrincipal, res.mIsWriteOnly, res.mCORSUsed); return pat.forget(); } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::CreatePattern(nsIDOMHTMLElement *image, - const nsAString& repeat, - nsIDOMCanvasPattern **_retval) +CanvasRenderingContext2D::CreatePattern(nsIDOMHTMLElement *image, + const nsAString& repeat, + nsIDOMCanvasPattern **_retval) { HTMLImageOrCanvasOrVideoElement element; if (!ToHTMLImageOrCanvasOrVideoElement(image, element)) { @@ -1896,49 +1877,49 @@ nsCanvasRenderingContext2DAzure::CreatePattern(nsIDOMHTMLElement *image, // shadows // NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetShadowOffsetX(float x) +CanvasRenderingContext2D::SetShadowOffsetX(float x) { SetShadowOffsetX((double)x); return NS_OK; } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetShadowOffsetX(float *x) +CanvasRenderingContext2D::GetShadowOffsetX(float *x) { *x = static_cast(ShadowOffsetX()); return NS_OK; } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetShadowOffsetY(float y) +CanvasRenderingContext2D::SetShadowOffsetY(float y) { SetShadowOffsetY((double)y); return NS_OK; } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetShadowOffsetY(float *y) +CanvasRenderingContext2D::GetShadowOffsetY(float *y) { *y = static_cast(ShadowOffsetY()); return NS_OK; } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetShadowBlur(float blur) +CanvasRenderingContext2D::SetShadowBlur(float blur) { SetShadowBlur((double)blur); return NS_OK; } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetShadowBlur(float *blur) +CanvasRenderingContext2D::GetShadowBlur(float *blur) { *blur = ShadowBlur(); return NS_OK; } void -nsCanvasRenderingContext2DAzure::SetShadowColor(const nsAString& shadowColor) +CanvasRenderingContext2D::SetShadowColor(const nsAString& shadowColor) { nscolor color; if (!ParseColor(shadowColor, &color)) { @@ -1949,14 +1930,14 @@ nsCanvasRenderingContext2DAzure::SetShadowColor(const nsAString& shadowColor) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetMozShadowColor(const nsAString& colorstr) +CanvasRenderingContext2D::SetMozShadowColor(const nsAString& colorstr) { SetShadowColor(colorstr); return NS_OK; } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetMozShadowColor(nsAString& color) +CanvasRenderingContext2D::GetMozShadowColor(nsAString& color) { GetShadowColor(color); return NS_OK; @@ -1967,8 +1948,8 @@ nsCanvasRenderingContext2DAzure::GetMozShadowColor(nsAString& color) // void -nsCanvasRenderingContext2DAzure::ClearRect(double x, double y, double w, - double h) +CanvasRenderingContext2D::ClearRect(double x, double y, double w, + double h) { if (!FloatValidate(x,y,w,h) || !mTarget) { return; @@ -1980,15 +1961,15 @@ nsCanvasRenderingContext2DAzure::ClearRect(double x, double y, double w, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::ClearRect(float x, float y, float w, float h) +CanvasRenderingContext2D::ClearRect(float x, float y, float w, float h) { ClearRect((double)x, (double)y, (double)w, (double)h); return NS_OK; } void -nsCanvasRenderingContext2DAzure::FillRect(double x, double y, double w, - double h) +CanvasRenderingContext2D::FillRect(double x, double y, double w, + double h) { if (!FloatValidate(x,y,w,h)) { return; @@ -1997,11 +1978,11 @@ nsCanvasRenderingContext2DAzure::FillRect(double x, double y, double w, const ContextState &state = CurrentState(); if (state.patternStyles[STYLE_FILL]) { - nsCanvasPatternAzure::RepeatMode repeat = + CanvasPattern::RepeatMode repeat = state.patternStyles[STYLE_FILL]->mRepeat; // In the FillRect case repeat modes are easy to deal with. - bool limitx = repeat == nsCanvasPatternAzure::NOREPEAT || repeat == nsCanvasPatternAzure::REPEATY; - bool limity = repeat == nsCanvasPatternAzure::NOREPEAT || repeat == nsCanvasPatternAzure::REPEATX; + bool limitx = repeat == CanvasPattern::NOREPEAT || repeat == CanvasPattern::REPEATY; + bool limity = repeat == CanvasPattern::NOREPEAT || repeat == CanvasPattern::REPEATX; IntSize patternSize = state.patternStyles[STYLE_FILL]->mSurface->GetSize(); @@ -2059,15 +2040,15 @@ nsCanvasRenderingContext2DAzure::FillRect(double x, double y, double w, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::FillRect(float x, float y, float w, float h) +CanvasRenderingContext2D::FillRect(float x, float y, float w, float h) { FillRect((double)x, (double)y, (double)w, (double)h); return NS_OK; } void -nsCanvasRenderingContext2DAzure::StrokeRect(double x, double y, double w, - double h) +CanvasRenderingContext2D::StrokeRect(double x, double y, double w, + double h) { if (!FloatValidate(x,y,w,h)) { return; @@ -2140,7 +2121,7 @@ nsCanvasRenderingContext2DAzure::StrokeRect(double x, double y, double w, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::StrokeRect(float x, float y, float w, float h) +CanvasRenderingContext2D::StrokeRect(float x, float y, float w, float h) { StrokeRect((double)x, (double)y, (double)w, (double)h); return NS_OK; @@ -2151,7 +2132,7 @@ nsCanvasRenderingContext2DAzure::StrokeRect(float x, float y, float w, float h) // void -nsCanvasRenderingContext2DAzure::BeginPath() +CanvasRenderingContext2D::BeginPath() { mPath = nullptr; mPathBuilder = nullptr; @@ -2160,21 +2141,21 @@ nsCanvasRenderingContext2DAzure::BeginPath() } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::MozBeginPath() +CanvasRenderingContext2D::MozBeginPath() { BeginPath(); return NS_OK; } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::MozClosePath() +CanvasRenderingContext2D::MozClosePath() { ClosePath(); return NS_OK; } void -nsCanvasRenderingContext2DAzure::Fill() +CanvasRenderingContext2D::Fill() { EnsureUserSpacePath(); @@ -2196,14 +2177,14 @@ nsCanvasRenderingContext2DAzure::Fill() } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::MozFill() +CanvasRenderingContext2D::MozFill() { Fill(); return NS_OK; } void -nsCanvasRenderingContext2DAzure::Stroke() +CanvasRenderingContext2D::Stroke() { EnsureUserSpacePath(); @@ -2232,14 +2213,14 @@ nsCanvasRenderingContext2DAzure::Stroke() } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::MozStroke() +CanvasRenderingContext2D::MozStroke() { Stroke(); return NS_OK; } void -nsCanvasRenderingContext2DAzure::Clip() +CanvasRenderingContext2D::Clip() { EnsureUserSpacePath(); @@ -2252,38 +2233,38 @@ nsCanvasRenderingContext2DAzure::Clip() } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::MozClip() +CanvasRenderingContext2D::MozClip() { Clip(); return NS_OK; } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::MoveTo(float x, float y) +CanvasRenderingContext2D::MoveTo(float x, float y) { MoveTo((double)x, (double)y); return NS_OK; } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::LineTo(float x, float y) +CanvasRenderingContext2D::LineTo(float x, float y) { LineTo((double)x, (double)y); return NS_OK; } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::QuadraticCurveTo(float cpx, float cpy, float x, - float y) +CanvasRenderingContext2D::QuadraticCurveTo(float cpx, float cpy, float x, + float y) { QuadraticCurveTo((double)cpx, (double)cpy, (double)x, (double)y); return NS_OK; } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::BezierCurveTo(float cp1x, float cp1y, - float cp2x, float cp2y, - float x, float y) +CanvasRenderingContext2D::BezierCurveTo(float cp1x, float cp1y, + float cp2x, float cp2y, + float x, float y) { BezierCurveTo((double)cp1x, (double)cp1y, (double)cp2x, (double)cp2y, (double)x, (double)y); @@ -2291,9 +2272,9 @@ nsCanvasRenderingContext2DAzure::BezierCurveTo(float cp1x, float cp1y, } void -nsCanvasRenderingContext2DAzure::ArcTo(double x1, double y1, double x2, - double y2, double radius, - ErrorResult& error) +CanvasRenderingContext2D::ArcTo(double x1, double y1, double x2, + double y2, double radius, + ErrorResult& error) { if (!FloatValidate(x1, y1, x2, y2, radius)) { return; @@ -2325,7 +2306,7 @@ nsCanvasRenderingContext2DAzure::ArcTo(double x1, double y1, double x2, // Execute these calculations in double precision to avoid cumulative // rounding errors. double dir, a2, b2, c2, cosx, sinx, d, anx, any, - bnx, bny, x3, y3, x4, y4, cx, cy, angle0, angle1; + bnx, bny, x3, y3, x4, y4, cx, cy, angle0, angle1; bool anticlockwise; if (p0 == p1 || p1 == p2 || radius == 0) { @@ -2373,7 +2354,7 @@ nsCanvasRenderingContext2DAzure::ArcTo(double x1, double y1, double x2, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::ArcTo(float x1, float y1, float x2, float y2, float radius) +CanvasRenderingContext2D::ArcTo(float x1, float y1, float x2, float y2, float radius) { ErrorResult rv; ArcTo(x1, y1, x2, y2, radius, rv); @@ -2381,9 +2362,9 @@ nsCanvasRenderingContext2DAzure::ArcTo(float x1, float y1, float x2, float y2, f } void -nsCanvasRenderingContext2DAzure::Arc(double x, double y, double r, - double startAngle, double endAngle, - bool anticlockwise, ErrorResult& error) +CanvasRenderingContext2D::Arc(double x, double y, double r, + double startAngle, double endAngle, + bool anticlockwise, ErrorResult& error) { if (!FloatValidate(x, y, r, startAngle, endAngle)) { return; @@ -2400,10 +2381,10 @@ nsCanvasRenderingContext2DAzure::Arc(double x, double y, double r, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::Arc(float x, float y, - float r, - float startAngle, float endAngle, - bool ccw) +CanvasRenderingContext2D::Arc(float x, float y, + float r, + float startAngle, float endAngle, + bool ccw) { ErrorResult rv; Arc(x, y, r, startAngle, endAngle, ccw, rv); @@ -2411,7 +2392,7 @@ nsCanvasRenderingContext2DAzure::Arc(float x, float y, } void -nsCanvasRenderingContext2DAzure::Rect(double x, double y, double w, double h) +CanvasRenderingContext2D::Rect(double x, double y, double w, double h) { if (!FloatValidate(x, y, w, h)) { return; @@ -2435,14 +2416,14 @@ nsCanvasRenderingContext2DAzure::Rect(double x, double y, double w, double h) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::Rect(float x, float y, float w, float h) +CanvasRenderingContext2D::Rect(float x, float y, float w, float h) { Rect((double)x, (double)y, (double)w, (double)h); return NS_OK; } void -nsCanvasRenderingContext2DAzure::EnsureWritablePath() +CanvasRenderingContext2D::EnsureWritablePath() { if (mDSPathBuilder) { return; @@ -2476,7 +2457,7 @@ nsCanvasRenderingContext2DAzure::EnsureWritablePath() } void -nsCanvasRenderingContext2DAzure::EnsureUserSpacePath(bool aCommitTransform /* = true */) +CanvasRenderingContext2D::EnsureUserSpacePath(bool aCommitTransform /* = true */) { FillRule fillRule = CurrentState().fillRule; @@ -2525,7 +2506,7 @@ nsCanvasRenderingContext2DAzure::EnsureUserSpacePath(bool aCommitTransform /* = } void -nsCanvasRenderingContext2DAzure::TransformWillUpdate() +CanvasRenderingContext2D::TransformWillUpdate() { EnsureTarget(); @@ -2573,7 +2554,7 @@ CreateFontStyleRule(const nsAString& aFont, nsCSSParser parser(document->CSSLoader()); nsresult rv = parser.ParseStyleAttribute(EmptyString(), docURL, baseURL, - principal, getter_AddRefs(rule)); + principal, getter_AddRefs(rule)); if (NS_FAILED(rv)) { return rv; } @@ -2599,8 +2580,8 @@ CreateFontStyleRule(const nsAString& aFont, } void -nsCanvasRenderingContext2DAzure::SetFont(const nsAString& font, - ErrorResult& error) +CanvasRenderingContext2D::SetFont(const nsAString& font, + ErrorResult& error) { /* * If font is defined with relative units (e.g. ems) and the parent @@ -2710,17 +2691,17 @@ nsCanvasRenderingContext2DAzure::SetFont(const nsAString& font, const nscoord fontSize = nsStyleFont::UnZoomText(parentContext->PresContext(), fontStyle->mSize); bool printerFont = (presShell->GetPresContext()->Type() == nsPresContext::eContext_PrintPreview || - presShell->GetPresContext()->Type() == nsPresContext::eContext_Print); + presShell->GetPresContext()->Type() == nsPresContext::eContext_Print); gfxFontStyle style(fontStyle->mFont.style, - fontStyle->mFont.weight, - fontStyle->mFont.stretch, - NSAppUnitsToFloatPixels(fontSize, float(aupcp)), - language, - fontStyle->mFont.sizeAdjust, - fontStyle->mFont.systemFont, - printerFont, - fontStyle->mFont.languageOverride); + fontStyle->mFont.weight, + fontStyle->mFont.stretch, + NSAppUnitsToFloatPixels(fontSize, float(aupcp)), + language, + fontStyle->mFont.sizeAdjust, + fontStyle->mFont.systemFont, + printerFont, + fontStyle->mFont.languageOverride); fontStyle->mFont.AddFontFeaturesToStyle(&style); @@ -2738,7 +2719,7 @@ nsCanvasRenderingContext2DAzure::SetFont(const nsAString& font, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetMozFont(const nsAString& font) +CanvasRenderingContext2D::SetMozFont(const nsAString& font) { ErrorResult rv; SetFont(font, rv); @@ -2746,14 +2727,14 @@ nsCanvasRenderingContext2DAzure::SetMozFont(const nsAString& font) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetMozFont(nsAString& font) +CanvasRenderingContext2D::GetMozFont(nsAString& font) { font = GetFont(); return NS_OK; } void -nsCanvasRenderingContext2DAzure::SetTextAlign(const nsAString& ta) +CanvasRenderingContext2D::SetTextAlign(const nsAString& ta) { if (ta.EqualsLiteral("start")) CurrentState().textAlign = TEXT_ALIGN_START; @@ -2768,14 +2749,14 @@ nsCanvasRenderingContext2DAzure::SetTextAlign(const nsAString& ta) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetMozTextAlign(const nsAString& ta) +CanvasRenderingContext2D::SetMozTextAlign(const nsAString& ta) { SetTextAlign(ta); return NS_OK; } void -nsCanvasRenderingContext2DAzure::GetTextAlign(nsAString& ta) +CanvasRenderingContext2D::GetTextAlign(nsAString& ta) { switch (CurrentState().textAlign) { @@ -2798,14 +2779,14 @@ nsCanvasRenderingContext2DAzure::GetTextAlign(nsAString& ta) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetMozTextAlign(nsAString& ta) +CanvasRenderingContext2D::GetMozTextAlign(nsAString& ta) { GetTextAlign(ta); return NS_OK; } void -nsCanvasRenderingContext2DAzure::SetTextBaseline(const nsAString& tb) +CanvasRenderingContext2D::SetTextBaseline(const nsAString& tb) { if (tb.EqualsLiteral("top")) CurrentState().textBaseline = TEXT_BASELINE_TOP; @@ -2822,14 +2803,14 @@ nsCanvasRenderingContext2DAzure::SetTextBaseline(const nsAString& tb) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetMozTextBaseline(const nsAString& tb) +CanvasRenderingContext2D::SetMozTextBaseline(const nsAString& tb) { SetTextBaseline(tb); return NS_OK; } void -nsCanvasRenderingContext2DAzure::GetTextBaseline(nsAString& tb) +CanvasRenderingContext2D::GetTextBaseline(nsAString& tb) { switch (CurrentState().textBaseline) { @@ -2855,7 +2836,7 @@ nsCanvasRenderingContext2DAzure::GetTextBaseline(nsAString& tb) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetMozTextBaseline(nsAString& tb) +CanvasRenderingContext2D::GetMozTextBaseline(nsAString& tb) { GetTextBaseline(tb); return NS_OK; @@ -2875,16 +2856,16 @@ TextReplaceWhitespaceCharacters(nsAutoString& str) } void -nsCanvasRenderingContext2DAzure::FillText(const nsAString& text, double x, - double y, - const Optional& maxWidth, - ErrorResult& error) +CanvasRenderingContext2D::FillText(const nsAString& text, double x, + double y, + const Optional& maxWidth, + ErrorResult& error) { error = DrawOrMeasureText(text, x, y, maxWidth, TEXT_DRAW_OPERATION_FILL, nullptr); } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::FillText(const nsAString& text, float x, float y, float maxWidth) +CanvasRenderingContext2D::FillText(const nsAString& text, float x, float y, float maxWidth) { ErrorResult rv; Optional optionalMaxWidth; @@ -2895,16 +2876,16 @@ nsCanvasRenderingContext2DAzure::FillText(const nsAString& text, float x, float } void -nsCanvasRenderingContext2DAzure::StrokeText(const nsAString& text, double x, - double y, - const Optional& maxWidth, - ErrorResult& error) +CanvasRenderingContext2D::StrokeText(const nsAString& text, double x, + double y, + const Optional& maxWidth, + ErrorResult& error) { error = DrawOrMeasureText(text, x, y, maxWidth, TEXT_DRAW_OPERATION_STROKE, nullptr); } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::StrokeText(const nsAString& text, float x, float y, float maxWidth) +CanvasRenderingContext2D::StrokeText(const nsAString& text, float x, float y, float maxWidth) { ErrorResult rv; Optional optionalMaxWidth; @@ -2915,8 +2896,8 @@ nsCanvasRenderingContext2DAzure::StrokeText(const nsAString& text, float x, floa } already_AddRefed -nsCanvasRenderingContext2DAzure::MeasureText(const nsAString& rawText, - ErrorResult& error) +CanvasRenderingContext2D::MeasureText(const nsAString& rawText, + ErrorResult& error) { float width; Optional maxWidth; @@ -2925,14 +2906,14 @@ nsCanvasRenderingContext2DAzure::MeasureText(const nsAString& rawText, return NULL; } - nsRefPtr textMetrics = new nsTextMetricsAzure(width); + nsRefPtr textMetrics = new TextMetrics(width); return textMetrics.forget(); } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::MeasureText(const nsAString& rawText, - nsIDOMTextMetrics** _retval) +CanvasRenderingContext2D::MeasureText(const nsAString& rawText, + nsIDOMTextMetrics** _retval) { ErrorResult rv; *_retval = MeasureText(rawText, rv).get(); @@ -2942,9 +2923,9 @@ nsCanvasRenderingContext2DAzure::MeasureText(const nsAString& rawText, /** * Used for nsBidiPresUtils::ProcessText */ -struct NS_STACK_CLASS nsCanvasBidiProcessorAzure : public nsBidiPresUtils::BidiProcessor +struct NS_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcessor { - typedef nsCanvasRenderingContext2DAzure::ContextState ContextState; + typedef CanvasRenderingContext2D::ContextState ContextState; virtual void SetText(const PRUnichar* text, int32_t length, nsBidiDirection direction) { @@ -3082,19 +3063,19 @@ struct NS_STACK_CLASS nsCanvasBidiProcessorAzure : public nsBidiPresUtils::BidiP buffer.mNumGlyphs = glyphBuf.size(); Rect bounds(mBoundingBox.x, mBoundingBox.y, mBoundingBox.width, mBoundingBox.height); - if (mOp == nsCanvasRenderingContext2DAzure::TEXT_DRAW_OPERATION_FILL) { + if (mOp == CanvasRenderingContext2D::TEXT_DRAW_OPERATION_FILL) { AdjustedTarget(mCtx, &bounds)-> FillGlyphs(scaledFont, buffer, CanvasGeneralPattern(). - ForStyle(mCtx, nsCanvasRenderingContext2DAzure::STYLE_FILL, mCtx->mTarget), + ForStyle(mCtx, CanvasRenderingContext2D::STYLE_FILL, mCtx->mTarget), DrawOptions(mState->globalAlpha, mCtx->UsedOperation())); - } else if (mOp == nsCanvasRenderingContext2DAzure::TEXT_DRAW_OPERATION_STROKE) { + } else if (mOp == CanvasRenderingContext2D::TEXT_DRAW_OPERATION_STROKE) { RefPtr path = scaledFont->GetPathForGlyphs(buffer, mCtx->mTarget); const ContextState& state = *mState; AdjustedTarget(mCtx, &bounds)-> Stroke(path, CanvasGeneralPattern(). - ForStyle(mCtx, nsCanvasRenderingContext2DAzure::STYLE_STROKE, mCtx->mTarget), + ForStyle(mCtx, CanvasRenderingContext2D::STYLE_STROKE, mCtx->mTarget), StrokeOptions(state.lineWidth, state.lineJoin, state.lineCap, state.miterLimit, state.dash.Length(), @@ -3113,7 +3094,7 @@ struct NS_STACK_CLASS nsCanvasBidiProcessorAzure : public nsBidiPresUtils::BidiP nsRefPtr mThebes; // Pointer to the draw target we should fill our text to - nsCanvasRenderingContext2DAzure *mCtx; + CanvasRenderingContext2D *mCtx; // position of the left side of the string, alphabetic baseline gfxPoint mPt; @@ -3125,7 +3106,7 @@ struct NS_STACK_CLASS nsCanvasBidiProcessorAzure : public nsBidiPresUtils::BidiP uint32_t mAppUnitsPerDevPixel; // operation (fill or stroke) - nsCanvasRenderingContext2DAzure::TextDrawOperation mOp; + CanvasRenderingContext2D::TextDrawOperation mOp; // context state ContextState *mState; @@ -3138,12 +3119,12 @@ struct NS_STACK_CLASS nsCanvasBidiProcessorAzure : public nsBidiPresUtils::BidiP }; nsresult -nsCanvasRenderingContext2DAzure::DrawOrMeasureText(const nsAString& aRawText, - float aX, - float aY, - const Optional& aMaxWidth, - TextDrawOperation aOp, - float* aWidth) +CanvasRenderingContext2D::DrawOrMeasureText(const nsAString& aRawText, + float aX, + float aY, + const Optional& aMaxWidth, + TextDrawOperation aOp, + float* aWidth) { nsresult rv; @@ -3207,7 +3188,7 @@ nsCanvasRenderingContext2DAzure::DrawOrMeasureText(const nsAString& aRawText, // This is only needed to know if we can know the drawing bounding box easily. bool doDrawShadow = aOp == TEXT_DRAW_OPERATION_FILL && NeedToDrawShadow(); - nsCanvasBidiProcessorAzure processor; + CanvasBidiProcessor processor; GetAppUnitsValues(&processor.mAppUnitsPerDevPixel, nullptr); processor.mPt = gfxPoint(aX, aY); @@ -3348,7 +3329,7 @@ nsCanvasRenderingContext2DAzure::DrawOrMeasureText(const nsAString& aRawText, mTarget->SetTransform(oldTransform); - if (aOp == nsCanvasRenderingContext2DAzure::TEXT_DRAW_OPERATION_FILL && + if (aOp == CanvasRenderingContext2D::TEXT_DRAW_OPERATION_FILL && !doDrawShadow) { RedrawUser(boundingBox); return NS_OK; @@ -3359,7 +3340,7 @@ nsCanvasRenderingContext2DAzure::DrawOrMeasureText(const nsAString& aRawText, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetTextStyle(const nsAString& textStyle) +CanvasRenderingContext2D::SetTextStyle(const nsAString& textStyle) { ErrorResult rv; SetMozTextStyle(textStyle, rv); @@ -3367,13 +3348,13 @@ nsCanvasRenderingContext2DAzure::SetTextStyle(const nsAString& textStyle) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetTextStyle(nsAString& textStyle) +CanvasRenderingContext2D::GetTextStyle(nsAString& textStyle) { GetMozTextStyle(textStyle); return NS_OK; } -gfxFontGroup *nsCanvasRenderingContext2DAzure::GetCurrentFontStyle() +gfxFontGroup *CanvasRenderingContext2D::GetCurrentFontStyle() { // use lazy initilization for the font group since it's rather expensive if (!CurrentState().fontGroup) { @@ -3404,21 +3385,21 @@ gfxFontGroup *nsCanvasRenderingContext2DAzure::GetCurrentFontStyle() // NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetLineWidth(float width) +CanvasRenderingContext2D::SetLineWidth(float width) { SetLineWidth((double)width); return NS_OK; } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetLineWidth(float *width) +CanvasRenderingContext2D::GetLineWidth(float *width) { *width = LineWidth(); return NS_OK; } void -nsCanvasRenderingContext2DAzure::SetLineCap(const nsAString& capstyle) +CanvasRenderingContext2D::SetLineCap(const nsAString& capstyle) { CapStyle cap; @@ -3437,14 +3418,14 @@ nsCanvasRenderingContext2DAzure::SetLineCap(const nsAString& capstyle) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetMozLineCap(const nsAString& capstyle) +CanvasRenderingContext2D::SetMozLineCap(const nsAString& capstyle) { SetLineCap(capstyle); return NS_OK; } void -nsCanvasRenderingContext2DAzure::GetLineCap(nsAString& capstyle) +CanvasRenderingContext2D::GetLineCap(nsAString& capstyle) { switch (CurrentState().lineCap) { case CAP_BUTT: @@ -3460,14 +3441,14 @@ nsCanvasRenderingContext2DAzure::GetLineCap(nsAString& capstyle) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetMozLineCap(nsAString& capstyle) +CanvasRenderingContext2D::GetMozLineCap(nsAString& capstyle) { GetLineCap(capstyle); return NS_OK; } void -nsCanvasRenderingContext2DAzure::SetLineJoin(const nsAString& joinstyle) +CanvasRenderingContext2D::SetLineJoin(const nsAString& joinstyle) { JoinStyle j; @@ -3486,14 +3467,14 @@ nsCanvasRenderingContext2DAzure::SetLineJoin(const nsAString& joinstyle) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetMozLineJoin(const nsAString& joinstyle) +CanvasRenderingContext2D::SetMozLineJoin(const nsAString& joinstyle) { SetLineJoin(joinstyle); return NS_OK; } void -nsCanvasRenderingContext2DAzure::GetLineJoin(nsAString& joinstyle, ErrorResult& error) +CanvasRenderingContext2D::GetLineJoin(nsAString& joinstyle, ErrorResult& error) { switch (CurrentState().lineJoin) { case JOIN_ROUND: @@ -3511,7 +3492,7 @@ nsCanvasRenderingContext2DAzure::GetLineJoin(nsAString& joinstyle, ErrorResult& } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetMozLineJoin(nsAString& joinstyle) +CanvasRenderingContext2D::GetMozLineJoin(nsAString& joinstyle) { ErrorResult rv; nsString linejoin; @@ -3523,23 +3504,23 @@ nsCanvasRenderingContext2DAzure::GetMozLineJoin(nsAString& joinstyle) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetMiterLimit(float miter) +CanvasRenderingContext2D::SetMiterLimit(float miter) { SetMiterLimit((double)miter); return NS_OK; } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetMiterLimit(float *miter) +CanvasRenderingContext2D::GetMiterLimit(float *miter) { *miter = MiterLimit(); return NS_OK; } void -nsCanvasRenderingContext2DAzure::SetMozDash(JSContext* cx, - const JS::Value& mozDash, - ErrorResult& error) +CanvasRenderingContext2D::SetMozDash(JSContext* cx, + const JS::Value& mozDash, + ErrorResult& error) { FallibleTArray dash; error = JSValToDashArray(cx, mozDash, dash); @@ -3553,7 +3534,7 @@ nsCanvasRenderingContext2DAzure::SetMozDash(JSContext* cx, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetMozDash(JSContext *cx, const jsval& patternArray) +CanvasRenderingContext2D::SetMozDash(JSContext *cx, const jsval& patternArray) { ErrorResult rv; SetMozDash(cx, patternArray, rv); @@ -3561,7 +3542,7 @@ nsCanvasRenderingContext2DAzure::SetMozDash(JSContext *cx, const jsval& patternA } JS::Value -nsCanvasRenderingContext2DAzure::GetMozDash(JSContext* cx, ErrorResult& error) +CanvasRenderingContext2D::GetMozDash(JSContext* cx, ErrorResult& error) { JS::Value mozDash; error = DashArrayToJSVal(CurrentState().dash, cx, &mozDash); @@ -3569,7 +3550,7 @@ nsCanvasRenderingContext2DAzure::GetMozDash(JSContext* cx, ErrorResult& error) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetMozDash(JSContext* cx, jsval* dashArray) +CanvasRenderingContext2D::GetMozDash(JSContext* cx, jsval* dashArray) { ErrorResult rv; *dashArray = GetMozDash(cx, rv); @@ -3577,7 +3558,7 @@ nsCanvasRenderingContext2DAzure::GetMozDash(JSContext* cx, jsval* dashArray) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetMozDashOffset(float offset) +CanvasRenderingContext2D::SetMozDashOffset(float offset) { if (!FloatValidate(offset)) { return NS_ERROR_ILLEGAL_VALUE; @@ -3590,14 +3571,14 @@ nsCanvasRenderingContext2DAzure::SetMozDashOffset(float offset) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetMozDashOffset(float* offset) +CanvasRenderingContext2D::GetMozDashOffset(float* offset) { *offset = MozDashOffset(); return NS_OK; } bool -nsCanvasRenderingContext2DAzure::IsPointInPath(double x, double y) +CanvasRenderingContext2D::IsPointInPath(double x, double y) { if (!FloatValidate(x,y)) { return false; @@ -3614,7 +3595,7 @@ nsCanvasRenderingContext2DAzure::IsPointInPath(double x, double y) } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::IsPointInPath(float x, float y, bool *retVal) +CanvasRenderingContext2D::IsPointInPath(float x, float y, bool *retVal) { *retVal = IsPointInPath(x, y); return NS_OK; @@ -3637,12 +3618,12 @@ nsCanvasRenderingContext2DAzure::IsPointInPath(float x, float y, bool *retVal) // are all passed in. void -nsCanvasRenderingContext2DAzure::DrawImage(const HTMLImageOrCanvasOrVideoElement& image, - double sx, double sy, double sw, - double sh, double dx, double dy, - double dw, double dh, - uint8_t optional_argc, - ErrorResult& error) +CanvasRenderingContext2D::DrawImage(const HTMLImageOrCanvasOrVideoElement& image, + double sx, double sy, double sw, + double sh, double dx, double dy, + double dw, double dh, + uint8_t optional_argc, + ErrorResult& error) { MOZ_ASSERT(optional_argc == 0 || optional_argc == 2 || optional_argc == 6); @@ -3676,7 +3657,7 @@ nsCanvasRenderingContext2DAzure::DrawImage(const HTMLImageOrCanvasOrVideoElement // Do security check here. CanvasUtils::DoDrawImageSecurityCheck(mCanvasElement, element->NodePrincipal(), - canvas->IsWriteOnly(), + canvas->IsWriteOnly(), false); } imgSize = gfxIntSize(srcSurf->GetSize().width, srcSurf->GetSize().height); @@ -3784,10 +3765,10 @@ nsCanvasRenderingContext2DAzure::DrawImage(const HTMLImageOrCanvasOrVideoElement } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::DrawImage(nsIDOMElement *imgElt, float a1, - float a2, float a3, float a4, float a5, - float a6, float a7, float a8, - uint8_t optional_argc) +CanvasRenderingContext2D::DrawImage(nsIDOMElement *imgElt, float a1, + float a2, float a3, float a4, float a5, + float a6, float a7, float a8, + uint8_t optional_argc) { if (!(optional_argc == 0 || optional_argc == 2 || optional_argc == 6)) { return NS_ERROR_INVALID_ARG; @@ -3819,8 +3800,8 @@ nsCanvasRenderingContext2DAzure::DrawImage(nsIDOMElement *imgElt, float a1, } void -nsCanvasRenderingContext2DAzure::SetGlobalCompositeOperation(const nsAString& op, - ErrorResult& error) +CanvasRenderingContext2D::SetGlobalCompositeOperation(const nsAString& op, + ErrorResult& error) { CompositionOp comp_op; @@ -3847,7 +3828,7 @@ nsCanvasRenderingContext2DAzure::SetGlobalCompositeOperation(const nsAString& op } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetGlobalCompositeOperation(const nsAString& op) +CanvasRenderingContext2D::SetGlobalCompositeOperation(const nsAString& op) { ErrorResult rv; SetGlobalCompositeOperation(op, rv); @@ -3855,8 +3836,8 @@ nsCanvasRenderingContext2DAzure::SetGlobalCompositeOperation(const nsAString& op } void -nsCanvasRenderingContext2DAzure::GetGlobalCompositeOperation(nsAString& op, - ErrorResult& error) +CanvasRenderingContext2D::GetGlobalCompositeOperation(nsAString& op, + ErrorResult& error) { CompositionOp comp_op = CurrentState().op; @@ -3883,7 +3864,7 @@ nsCanvasRenderingContext2DAzure::GetGlobalCompositeOperation(nsAString& op, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetGlobalCompositeOperation(nsAString& op) +CanvasRenderingContext2D::GetGlobalCompositeOperation(nsAString& op) { nsString globalCompositeOperation; ErrorResult rv; @@ -3895,10 +3876,10 @@ nsCanvasRenderingContext2DAzure::GetGlobalCompositeOperation(nsAString& op) } void -nsCanvasRenderingContext2DAzure::DrawWindow(nsIDOMWindow* window, double x, - double y, double w, double h, - const nsAString& bgColor, - uint32_t flags, ErrorResult& error) +CanvasRenderingContext2D::DrawWindow(nsIDOMWindow* window, double x, + double y, double w, double h, + const nsAString& bgColor, + uint32_t flags, ErrorResult& error) { // protect against too-large surfaces that will cause allocation // or overflow issues @@ -3990,10 +3971,10 @@ nsCanvasRenderingContext2DAzure::DrawWindow(nsIDOMWindow* window, double x, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::DrawWindow(nsIDOMWindow* aWindow, float aX, float aY, - float aW, float aH, - const nsAString& aBGColor, - uint32_t flags) +CanvasRenderingContext2D::DrawWindow(nsIDOMWindow* aWindow, float aX, float aY, + float aW, float aH, + const nsAString& aBGColor, + uint32_t flags) { NS_ENSURE_ARG(aWindow); @@ -4003,12 +3984,12 @@ nsCanvasRenderingContext2DAzure::DrawWindow(nsIDOMWindow* aWindow, float aX, flo } void -nsCanvasRenderingContext2DAzure::AsyncDrawXULElement(nsIDOMXULElement* elem, - double x, double y, - double w, double h, - const nsAString& bgColor, - uint32_t flags, - ErrorResult& error) +CanvasRenderingContext2D::AsyncDrawXULElement(nsIDOMXULElement* elem, + double x, double y, + double w, double h, + const nsAString& bgColor, + uint32_t flags, + ErrorResult& error) { // We can't allow web apps to call this until we fix at least the // following potential security issues: @@ -4017,8 +3998,8 @@ nsCanvasRenderingContext2DAzure::AsyncDrawXULElement(nsIDOMXULElement* elem, // -- rendering native anonymous content (e.g., file input paths; // scrollbars should be allowed) if (!nsContentUtils::IsCallerTrustedForRead()) { - // not permitted to use DrawWindow - // XXX ERRMSG we need to report an error to developers here! (bug 329026) + // not permitted to use DrawWindow + // XXX ERRMSG we need to report an error to developers here! (bug 329026) error.Throw(NS_ERROR_DOM_SECURITY_ERR); return; } @@ -4089,11 +4070,11 @@ nsCanvasRenderingContext2DAzure::AsyncDrawXULElement(nsIDOMXULElement* elem, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::AsyncDrawXULElement(nsIDOMXULElement* aElem, - float aX, float aY, - float aW, float aH, - const nsAString& aBGColor, - uint32_t flags) +CanvasRenderingContext2D::AsyncDrawXULElement(nsIDOMXULElement* aElem, + float aX, float aY, + float aW, float aH, + const nsAString& aBGColor, + uint32_t flags) { NS_ENSURE_ARG(aElem); @@ -4107,7 +4088,7 @@ nsCanvasRenderingContext2DAzure::AsyncDrawXULElement(nsIDOMXULElement* aElem, // void -nsCanvasRenderingContext2DAzure::EnsureUnpremultiplyTable() { +CanvasRenderingContext2D::EnsureUnpremultiplyTable() { if (sUnpremultiplyTable) return; @@ -4134,9 +4115,9 @@ nsCanvasRenderingContext2DAzure::EnsureUnpremultiplyTable() { already_AddRefed -nsCanvasRenderingContext2DAzure::GetImageData(JSContext* aCx, double aSx, - double aSy, double aSw, - double aSh, ErrorResult& error) +CanvasRenderingContext2D::GetImageData(JSContext* aCx, double aSx, + double aSy, double aSw, + double aSh, ErrorResult& error) { EnsureTarget(); if (!IsTargetValid()) { @@ -4211,10 +4192,10 @@ nsCanvasRenderingContext2DAzure::GetImageData(JSContext* aCx, double aSx, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetImageData(double aSx, double aSy, - double aSw, double aSh, - JSContext* aCx, - nsIDOMImageData** aRetval) +CanvasRenderingContext2D::GetImageData(double aSx, double aSy, + double aSw, double aSh, + JSContext* aCx, + nsIDOMImageData** aRetval) { ErrorResult rv; *aRetval = GetImageData(aCx, aSx, aSy, aSw, aSh, rv).get(); @@ -4222,12 +4203,12 @@ nsCanvasRenderingContext2DAzure::GetImageData(double aSx, double aSy, } nsresult -nsCanvasRenderingContext2DAzure::GetImageDataArray(JSContext* aCx, - int32_t aX, - int32_t aY, - uint32_t aWidth, - uint32_t aHeight, - JSObject** aRetval) +CanvasRenderingContext2D::GetImageDataArray(JSContext* aCx, + int32_t aX, + int32_t aY, + uint32_t aWidth, + uint32_t aHeight, + JSObject** aRetval) { MOZ_ASSERT(aWidth && aHeight); @@ -4314,7 +4295,7 @@ nsCanvasRenderingContext2DAzure::GetImageDataArray(JSContext* aCx, } void -nsCanvasRenderingContext2DAzure::EnsurePremultiplyTable() { +CanvasRenderingContext2D::EnsurePremultiplyTable() { if (sPremultiplyTable) return; @@ -4333,7 +4314,7 @@ nsCanvasRenderingContext2DAzure::EnsurePremultiplyTable() { } void -nsCanvasRenderingContext2DAzure::EnsureErrorTarget() +CanvasRenderingContext2D::EnsureErrorTarget() { if (sErrorTarget) { return; @@ -4347,7 +4328,7 @@ nsCanvasRenderingContext2DAzure::EnsureErrorTarget() } void -nsCanvasRenderingContext2DAzure::FillRuleChanged() +CanvasRenderingContext2D::FillRuleChanged() { if (mPath) { mPathBuilder = mPath->CopyToBuilder(CurrentState().fillRule); @@ -4356,9 +4337,9 @@ nsCanvasRenderingContext2DAzure::FillRuleChanged() } void -nsCanvasRenderingContext2DAzure::PutImageData(JSContext* cx, - ImageData* imageData, double dx, - double dy, ErrorResult& error) +CanvasRenderingContext2D::PutImageData(JSContext* cx, + ImageData* imageData, double dx, + double dy, ErrorResult& error) { if (!FloatValidate(dx, dy)) { error.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); @@ -4373,12 +4354,12 @@ nsCanvasRenderingContext2DAzure::PutImageData(JSContext* cx, } void -nsCanvasRenderingContext2DAzure::PutImageData(JSContext* cx, - ImageData* imageData, double dx, - double dy, double dirtyX, - double dirtyY, double dirtyWidth, - double dirtyHeight, - ErrorResult& error) +CanvasRenderingContext2D::PutImageData(JSContext* cx, + ImageData* imageData, double dx, + double dy, double dirtyX, + double dirtyY, double dirtyWidth, + double dirtyHeight, + ErrorResult& error) { if (!FloatValidate(dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight)) { error.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); @@ -4399,9 +4380,9 @@ nsCanvasRenderingContext2DAzure::PutImageData(JSContext* cx, // void putImageData (in ImageData d, in float x, in float y); // void putImageData (in ImageData d, in double x, in double y, in double dirtyX, in double dirtyY, in double dirtyWidth, in double dirtyHeight); NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::PutImageData(const JS::Value&, double, double, - double, double, double, double, - JSContext*, uint8_t) +CanvasRenderingContext2D::PutImageData(const JS::Value&, double, double, + double, double, double, double, + JSContext*, uint8_t) { /* Should never be called -- the new binding code handles it, and C++ callers should call PutImageData_explicit */ @@ -4409,10 +4390,10 @@ nsCanvasRenderingContext2DAzure::PutImageData(const JS::Value&, double, double, } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::PutImageData_explicit(int32_t x, int32_t y, uint32_t w, uint32_t h, - unsigned char *aData, uint32_t aDataLen, - bool hasDirtyRect, int32_t dirtyX, int32_t dirtyY, - int32_t dirtyWidth, int32_t dirtyHeight) +CanvasRenderingContext2D::PutImageData_explicit(int32_t x, int32_t y, uint32_t w, uint32_t h, + unsigned char *aData, uint32_t aDataLen, + bool hasDirtyRect, int32_t dirtyX, int32_t dirtyY, + int32_t dirtyWidth, int32_t dirtyHeight) { if (w == 0 || h == 0) { return NS_ERROR_DOM_SYNTAX_ERR; @@ -4429,7 +4410,7 @@ nsCanvasRenderingContext2DAzure::PutImageData_explicit(int32_t x, int32_t y, uin CheckedInt32 checkedDirtyX = CheckedInt32(dirtyX) + dirtyWidth; if (!checkedDirtyX.isValid()) - return NS_ERROR_DOM_INDEX_SIZE_ERR; + return NS_ERROR_DOM_INDEX_SIZE_ERR; dirtyX = checkedDirtyX.value(); dirtyWidth = -dirtyWidth; @@ -4441,7 +4422,7 @@ nsCanvasRenderingContext2DAzure::PutImageData_explicit(int32_t x, int32_t y, uin CheckedInt32 checkedDirtyY = CheckedInt32(dirtyY) + dirtyHeight; if (!checkedDirtyY.isValid()) - return NS_ERROR_DOM_INDEX_SIZE_ERR; + return NS_ERROR_DOM_INDEX_SIZE_ERR; dirtyY = checkedDirtyY.value(); dirtyHeight = -dirtyHeight; @@ -4451,7 +4432,7 @@ nsCanvasRenderingContext2DAzure::PutImageData_explicit(int32_t x, int32_t y, uin dirtyRect = imageDataRect.Intersect(IntRect(dirtyX, dirtyY, dirtyWidth, dirtyHeight)); if (dirtyRect.Width() <= 0 || dirtyRect.Height() <= 0) - return NS_OK; + return NS_OK; } else { dirtyRect = imageDataRect; } @@ -4523,7 +4504,7 @@ nsCanvasRenderingContext2DAzure::PutImageData_explicit(int32_t x, int32_t y, uin } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetThebesSurface(gfxASurface **surface) +CanvasRenderingContext2D::GetThebesSurface(gfxASurface **surface) { EnsureTarget(); if (!mThebesSurface) { @@ -4546,7 +4527,7 @@ nsCanvasRenderingContext2DAzure::GetThebesSurface(gfxASurface **surface) } static already_AddRefed -CreateImageData(JSContext* cx, nsCanvasRenderingContext2DAzure* context, +CreateImageData(JSContext* cx, CanvasRenderingContext2D* context, uint32_t w, uint32_t h, ErrorResult& error) { if (w == 0) @@ -4573,8 +4554,8 @@ CreateImageData(JSContext* cx, nsCanvasRenderingContext2DAzure* context, } already_AddRefed -nsCanvasRenderingContext2DAzure::CreateImageData(JSContext* cx, double sw, - double sh, ErrorResult& error) +CanvasRenderingContext2D::CreateImageData(JSContext* cx, double sw, + double sh, ErrorResult& error) { if (!FloatValidate(sw, sh)) { error.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); @@ -4591,38 +4572,38 @@ nsCanvasRenderingContext2DAzure::CreateImageData(JSContext* cx, double sw, uint32_t w = NS_ABS(wi); uint32_t h = NS_ABS(hi); - return ::CreateImageData(cx, this, w, h, error); + return mozilla::dom::CreateImageData(cx, this, w, h, error); } already_AddRefed -nsCanvasRenderingContext2DAzure::CreateImageData(JSContext* cx, - ImageData* imagedata, - ErrorResult& error) +CanvasRenderingContext2D::CreateImageData(JSContext* cx, + ImageData* imagedata, + ErrorResult& error) { - return ::CreateImageData(cx, this, imagedata->GetWidth(), - imagedata->GetHeight(), error); + return mozilla::dom::CreateImageData(cx, this, imagedata->GetWidth(), + imagedata->GetHeight(), error); } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::CreateImageData(const JS::Value &arg1, - const JS::Value &arg2, - JSContext* cx, - uint8_t optional_argc, - nsIDOMImageData** retval) +CanvasRenderingContext2D::CreateImageData(const JS::Value &arg1, + const JS::Value &arg2, + JSContext* cx, + uint8_t optional_argc, + nsIDOMImageData** retval) { /* Should never be called; handled entirely in new bindings */ return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::GetMozImageSmoothingEnabled(bool *retVal) +CanvasRenderingContext2D::GetMozImageSmoothingEnabled(bool *retVal) { *retVal = ImageSmoothingEnabled(); return NS_OK; } NS_IMETHODIMP -nsCanvasRenderingContext2DAzure::SetMozImageSmoothingEnabled(bool val) +CanvasRenderingContext2D::SetMozImageSmoothingEnabled(bool val) { SetImageSmoothingEnabled(val); return NS_OK; @@ -4631,9 +4612,9 @@ nsCanvasRenderingContext2DAzure::SetMozImageSmoothingEnabled(bool val) static uint8_t g2DContextLayerUserData; already_AddRefed -nsCanvasRenderingContext2DAzure::GetCanvasLayer(nsDisplayListBuilder* aBuilder, - CanvasLayer *aOldLayer, - LayerManager *aManager) +CanvasRenderingContext2D::GetCanvasLayer(nsDisplayListBuilder* aBuilder, + CanvasLayer *aOldLayer, + LayerManager *aManager) { // Don't call EnsureTarget() ... if there isn't already a surface, then // we have nothing to paint and there is no need to create a surface just @@ -4649,8 +4630,8 @@ nsCanvasRenderingContext2DAzure::GetCanvasLayer(nsDisplayListBuilder* aBuilder, mTarget->Flush(); if (!mResetLayer && aOldLayer) { - CanvasRenderingContext2DUserDataAzure* userData = - static_cast( + CanvasRenderingContext2DUserData* userData = + static_cast( aOldLayer->GetUserData(&g2DContextLayerUserData)); if (userData && userData->IsForContext(this)) { NS_ADDREF(aOldLayer); @@ -4666,7 +4647,7 @@ nsCanvasRenderingContext2DAzure::GetCanvasLayer(nsDisplayListBuilder* aBuilder, MarkContextClean(); return nullptr; } - CanvasRenderingContext2DUserDataAzure *userData = nullptr; + CanvasRenderingContext2DUserData *userData = nullptr; // Make the layer tell us whenever a transaction finishes (including // the current transaction), so we can clear our invalidation state and // start invalidating again. We need to do this for all layers since @@ -4678,9 +4659,9 @@ nsCanvasRenderingContext2DAzure::GetCanvasLayer(nsDisplayListBuilder* aBuilder, // releasing the reference to the element. // The userData will receive DidTransactionCallbacks, which flush the // the invalidation state to indicate that the canvas is up to date. - userData = new CanvasRenderingContext2DUserDataAzure(this); + userData = new CanvasRenderingContext2DUserData(this); canvasLayer->SetDidTransactionCallback( - CanvasRenderingContext2DUserDataAzure::DidTransactionCallback, userData); + CanvasRenderingContext2DUserData::DidTransactionCallback, userData); canvasLayer->SetUserData(&g2DContextLayerUserData, userData); CanvasLayer::Data data; @@ -4699,7 +4680,7 @@ nsCanvasRenderingContext2DAzure::GetCanvasLayer(nsDisplayListBuilder* aBuilder, } void -nsCanvasRenderingContext2DAzure::MarkContextClean() +CanvasRenderingContext2D::MarkContextClean() { if (mInvalidateCount > 0) { mPredictManyRedrawCalls = mInvalidateCount > kCanvasMaxInvalidateCount; @@ -4710,7 +4691,16 @@ nsCanvasRenderingContext2DAzure::MarkContextClean() bool -nsCanvasRenderingContext2DAzure::ShouldForceInactiveLayer(LayerManager *aManager) +CanvasRenderingContext2D::ShouldForceInactiveLayer(LayerManager *aManager) { return !aManager->CanUseCanvasLayerForSize(gfxIntSize(mWidth, mHeight)); } + +} +} + +DOMCI_DATA(TextMetrics, mozilla::dom::TextMetrics) +DOMCI_DATA(CanvasGradient, mozilla::dom::CanvasGradient) +DOMCI_DATA(CanvasPattern, mozilla::dom::CanvasPattern) +DOMCI_DATA(CanvasRenderingContext2D, mozilla::dom::CanvasRenderingContext2D) + diff --git a/content/canvas/src/nsCanvasRenderingContext2DAzure.h b/content/canvas/src/CanvasRenderingContext2D.h similarity index 83% rename from content/canvas/src/nsCanvasRenderingContext2DAzure.h rename to content/canvas/src/CanvasRenderingContext2D.h index 83221a885d8a..974d2703262d 100644 --- a/content/canvas/src/nsCanvasRenderingContext2DAzure.h +++ b/content/canvas/src/CanvasRenderingContext2D.h @@ -2,8 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef nsCanvasRenderingContext2DAzure_h -#define nsCanvasRenderingContext2DAzure_h +#ifndef CanvasRenderingContext2D_h +#define CanvasRenderingContext2D_h #include #include "nsIDOMCanvasRenderingContext2D.h" @@ -19,24 +19,26 @@ #include "mozilla/dom/ImageData.h" #include "mozilla/dom/UnionTypes.h" +#define NS_CANVASGRADIENTAZURE_PRIVATE_IID \ + {0x28425a6a, 0x90e0, 0x4d42, {0x9c, 0x75, 0xff, 0x60, 0x09, 0xb3, 0x10, 0xa8}} +#define NS_CANVASPATTERNAZURE_PRIVATE_IID \ + {0xc9bacc25, 0x28da, 0x421e, {0x9a, 0x4b, 0xbb, 0xd6, 0x93, 0x05, 0x12, 0xbc}} + namespace mozilla { -namespace dom { -template class Optional; -} namespace gfx { struct Rect; class SourceSurface; } -} +namespace dom { extern const mozilla::gfx::Float SIGMA_MAX; +template class Optional; + /** - ** nsCanvasGradientAzure + ** CanvasGradient **/ -#define NS_CANVASGRADIENTAZURE_PRIVATE_IID \ - {0x28425a6a, 0x90e0, 0x4d42, {0x9c, 0x75, 0xff, 0x60, 0x09, 0xb3, 0x10, 0xa8}} -class nsCanvasGradientAzure : public nsIDOMCanvasGradient +class CanvasGradient : public nsIDOMCanvasGradient { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_CANVASGRADIENTAZURE_PRIVATE_IID) @@ -71,21 +73,19 @@ public: NS_IMETHOD AddColorStop(float offset, const nsAString& colorstr); protected: - nsCanvasGradientAzure(Type aType) : mType(aType) + CanvasGradient(Type aType) : mType(aType) {} nsTArray mRawStops; mozilla::RefPtr mStops; Type mType; - virtual ~nsCanvasGradientAzure() {} + virtual ~CanvasGradient() {} }; /** - ** nsCanvasPatternAzure + ** CanvasPattern **/ -#define NS_CANVASPATTERNAZURE_PRIVATE_IID \ - {0xc9bacc25, 0x28da, 0x421e, {0x9a, 0x4b, 0xbb, 0xd6, 0x93, 0x05, 0x12, 0xbc}} -class nsCanvasPatternAzure MOZ_FINAL : public nsIDOMCanvasPattern +class CanvasPattern MOZ_FINAL : public nsIDOMCanvasPattern { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_CANVASPATTERNAZURE_PRIVATE_IID) @@ -98,11 +98,11 @@ public: NOREPEAT }; - nsCanvasPatternAzure(mozilla::gfx::SourceSurface* aSurface, - RepeatMode aRepeat, - nsIPrincipal* principalForSecurityCheck, - bool forceWriteOnly, - bool CORSUsed) + CanvasPattern(mozilla::gfx::SourceSurface* aSurface, + RepeatMode aRepeat, + nsIPrincipal* principalForSecurityCheck, + bool forceWriteOnly, + bool CORSUsed) : mSurface(aSurface) , mRepeat(aRepeat) , mPrincipal(principalForSecurityCheck) @@ -120,13 +120,13 @@ public: const bool mCORSUsed; }; -struct nsCanvasBidiProcessorAzure; -class CanvasRenderingContext2DUserDataAzure; +struct CanvasBidiProcessor; +class CanvasRenderingContext2DUserData; /** - ** nsCanvasRenderingContext2DAzure + ** CanvasRenderingContext2D **/ -class nsCanvasRenderingContext2DAzure : +class CanvasRenderingContext2D : public nsIDOMCanvasRenderingContext2D, public nsICanvasRenderingContextInternal, public nsWrapperCache @@ -135,8 +135,8 @@ typedef mozilla::dom::HTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement HTMLImageOrCanvasOrVideoElement; public: - nsCanvasRenderingContext2DAzure(); - virtual ~nsCanvasRenderingContext2DAzure(); + CanvasRenderingContext2D(); + virtual ~CanvasRenderingContext2D(); virtual JSObject* WrapObject(JSContext *cx, JSObject *scope, bool *triedToWrap); @@ -480,8 +480,8 @@ public: NS_IMETHOD SetIsOpaque(bool isOpaque); NS_IMETHOD Reset(); already_AddRefed GetCanvasLayer(nsDisplayListBuilder* aBuilder, - CanvasLayer *aOldLayer, - LayerManager *aManager); + CanvasLayer *aOldLayer, + LayerManager *aManager); virtual bool ShouldForceInactiveLayer(LayerManager *aManager); void MarkContextClean(); NS_IMETHOD SetIsIPC(bool isIPC); @@ -495,7 +495,7 @@ public: // nsISupports interface + CC NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsCanvasRenderingContext2DAzure, + NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(CanvasRenderingContext2D, nsIDOMCanvasRenderingContext2D) // nsIDOMCanvasRenderingContext2D interface @@ -535,7 +535,7 @@ public: } } - friend class CanvasRenderingContext2DUserDataAzure; + friend class CanvasRenderingContext2DUserData; protected: nsresult GetImageDataArray(JSContext* aCx, int32_t aX, int32_t aY, @@ -572,12 +572,12 @@ protected: void SetStyleFromJSValue(JSContext* cx, JS::Value& value, Style whichStyle); void SetStyleFromString(const nsAString& str, Style whichStyle); - void SetStyleFromGradient(nsCanvasGradientAzure *gradient, Style whichStyle) + void SetStyleFromGradient(CanvasGradient *gradient, Style whichStyle) { CurrentState().SetGradientStyle(whichStyle, gradient); } - void SetStyleFromPattern(nsCanvasPatternAzure *pattern, Style whichStyle) + void SetStyleFromPattern(CanvasPattern *pattern, Style whichStyle) { CurrentState().SetPatternStyle(whichStyle, pattern); } @@ -704,7 +704,7 @@ protected: // This is needed for drawing in drawAsyncXULElement bool mIPC; - nsTArray mUserDatas; + nsTArray mUserDatas; // If mCanvasElement is not provided, then a docshell is nsCOMPtr mDocShell; @@ -836,109 +836,112 @@ protected: * the operation abstracted to a flag. */ nsresult DrawOrMeasureText(const nsAString& text, - float x, - float y, - const mozilla::dom::Optional& maxWidth, - TextDrawOperation op, - float* aWidth); + float x, + float y, + const mozilla::dom::Optional& maxWidth, + TextDrawOperation op, + float* aWidth); // state stack handling class ContextState { public: - ContextState() : textAlign(TEXT_ALIGN_START), - textBaseline(TEXT_BASELINE_ALPHABETIC), - lineWidth(1.0f), - miterLimit(10.0f), - globalAlpha(1.0f), - shadowBlur(0.0), - dashOffset(0.0f), - op(mozilla::gfx::OP_OVER), - fillRule(mozilla::gfx::FILL_WINDING), - lineCap(mozilla::gfx::CAP_BUTT), - lineJoin(mozilla::gfx::JOIN_MITER_OR_BEVEL), - imageSmoothingEnabled(true) - { } + ContextState() : textAlign(TEXT_ALIGN_START), + textBaseline(TEXT_BASELINE_ALPHABETIC), + lineWidth(1.0f), + miterLimit(10.0f), + globalAlpha(1.0f), + shadowBlur(0.0), + dashOffset(0.0f), + op(mozilla::gfx::OP_OVER), + fillRule(mozilla::gfx::FILL_WINDING), + lineCap(mozilla::gfx::CAP_BUTT), + lineJoin(mozilla::gfx::JOIN_MITER_OR_BEVEL), + imageSmoothingEnabled(true) + { } - ContextState(const ContextState& other) - : fontGroup(other.fontGroup), - font(other.font), - textAlign(other.textAlign), - textBaseline(other.textBaseline), - shadowColor(other.shadowColor), - transform(other.transform), - shadowOffset(other.shadowOffset), - lineWidth(other.lineWidth), - miterLimit(other.miterLimit), - globalAlpha(other.globalAlpha), - shadowBlur(other.shadowBlur), - dash(other.dash), - dashOffset(other.dashOffset), - op(other.op), - fillRule(other.fillRule), - lineCap(other.lineCap), - lineJoin(other.lineJoin), - imageSmoothingEnabled(other.imageSmoothingEnabled) - { - for (int i = 0; i < STYLE_MAX; i++) { - colorStyles[i] = other.colorStyles[i]; - gradientStyles[i] = other.gradientStyles[i]; - patternStyles[i] = other.patternStyles[i]; - } + ContextState(const ContextState& other) + : fontGroup(other.fontGroup), + font(other.font), + textAlign(other.textAlign), + textBaseline(other.textBaseline), + shadowColor(other.shadowColor), + transform(other.transform), + shadowOffset(other.shadowOffset), + lineWidth(other.lineWidth), + miterLimit(other.miterLimit), + globalAlpha(other.globalAlpha), + shadowBlur(other.shadowBlur), + dash(other.dash), + dashOffset(other.dashOffset), + op(other.op), + fillRule(other.fillRule), + lineCap(other.lineCap), + lineJoin(other.lineJoin), + imageSmoothingEnabled(other.imageSmoothingEnabled) + { + for (int i = 0; i < STYLE_MAX; i++) { + colorStyles[i] = other.colorStyles[i]; + gradientStyles[i] = other.gradientStyles[i]; + patternStyles[i] = other.patternStyles[i]; } + } - void SetColorStyle(Style whichStyle, nscolor color) { - colorStyles[whichStyle] = color; - gradientStyles[whichStyle] = nullptr; - patternStyles[whichStyle] = nullptr; - } + void SetColorStyle(Style whichStyle, nscolor color) + { + colorStyles[whichStyle] = color; + gradientStyles[whichStyle] = nullptr; + patternStyles[whichStyle] = nullptr; + } - void SetPatternStyle(Style whichStyle, nsCanvasPatternAzure* pat) { - gradientStyles[whichStyle] = nullptr; - patternStyles[whichStyle] = pat; - } + void SetPatternStyle(Style whichStyle, CanvasPattern* pat) + { + gradientStyles[whichStyle] = nullptr; + patternStyles[whichStyle] = pat; + } - void SetGradientStyle(Style whichStyle, nsCanvasGradientAzure* grad) { - gradientStyles[whichStyle] = grad; - patternStyles[whichStyle] = nullptr; - } + void SetGradientStyle(Style whichStyle, CanvasGradient* grad) + { + gradientStyles[whichStyle] = grad; + patternStyles[whichStyle] = nullptr; + } - /** - * returns true iff the given style is a solid color. - */ - bool StyleIsColor(Style whichStyle) const - { - return !(patternStyles[whichStyle] || gradientStyles[whichStyle]); - } + /** + * returns true iff the given style is a solid color. + */ + bool StyleIsColor(Style whichStyle) const + { + return !(patternStyles[whichStyle] || gradientStyles[whichStyle]); + } - std::vector > clipsPushed; + std::vector > clipsPushed; - nsRefPtr fontGroup; - nsRefPtr gradientStyles[STYLE_MAX]; - nsRefPtr patternStyles[STYLE_MAX]; + nsRefPtr fontGroup; + nsRefPtr gradientStyles[STYLE_MAX]; + nsRefPtr patternStyles[STYLE_MAX]; - nsString font; - TextAlign textAlign; - TextBaseline textBaseline; + nsString font; + TextAlign textAlign; + TextBaseline textBaseline; - nscolor colorStyles[STYLE_MAX]; - nscolor shadowColor; + nscolor colorStyles[STYLE_MAX]; + nscolor shadowColor; - mozilla::gfx::Matrix transform; - mozilla::gfx::Point shadowOffset; - mozilla::gfx::Float lineWidth; - mozilla::gfx::Float miterLimit; - mozilla::gfx::Float globalAlpha; - mozilla::gfx::Float shadowBlur; - FallibleTArray dash; - mozilla::gfx::Float dashOffset; + mozilla::gfx::Matrix transform; + mozilla::gfx::Point shadowOffset; + mozilla::gfx::Float lineWidth; + mozilla::gfx::Float miterLimit; + mozilla::gfx::Float globalAlpha; + mozilla::gfx::Float shadowBlur; + FallibleTArray dash; + mozilla::gfx::Float dashOffset; - mozilla::gfx::CompositionOp op; - mozilla::gfx::FillRule fillRule; - mozilla::gfx::CapStyle lineCap; - mozilla::gfx::JoinStyle lineJoin; + mozilla::gfx::CompositionOp op; + mozilla::gfx::FillRule fillRule; + mozilla::gfx::CapStyle lineCap; + mozilla::gfx::JoinStyle lineJoin; - bool imageSmoothingEnabled; + bool imageSmoothingEnabled; }; nsAutoTArray mStyleStack; @@ -951,7 +954,8 @@ protected: friend class AdjustedTarget; // other helpers - void GetAppUnitsValues(uint32_t *perDevPixel, uint32_t *perCSSPixel) { + void GetAppUnitsValues(uint32_t *perDevPixel, uint32_t *perCSSPixel) + { // If we don't have a canvas element, we just return something generic. uint32_t devPixel = 60; uint32_t cssPixel = 60; @@ -972,7 +976,10 @@ protected: *perCSSPixel = cssPixel; } - friend struct nsCanvasBidiProcessorAzure; + friend struct CanvasBidiProcessor; }; -#endif /* nsCanvasRenderingContext2DAzure_h */ +} +} + +#endif /* CanvasRenderingContext2D_h */ diff --git a/content/canvas/src/CustomQS_Canvas.h b/content/canvas/src/CustomQS_Canvas.h deleted file mode 100644 index 4f4e6594128c..000000000000 --- a/content/canvas/src/CustomQS_Canvas.h +++ /dev/null @@ -1,38 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef CustomQS_Canvas_h -#define CustomQS_Canvas_h - -#include "jsapi.h" - -#include "mozilla/dom/ImageData.h" - -#include "XPCQuickStubs.h" - -static bool -GetImageData(JSContext* cx, JS::Value& imageData, - uint32_t* width, uint32_t* height, JS::Anchor* array) -{ - if (!imageData.isObject()) { - return xpc_qsThrow(cx, NS_ERROR_DOM_TYPE_MISMATCH_ERR); - } - - nsIDOMImageData* domImageData; - xpc_qsSelfRef imageDataRef; - nsresult rv = xpc_qsUnwrapArg(cx, imageData, &domImageData, - &imageDataRef.ptr, &imageData); - if (NS_FAILED(rv)) { - return xpc_qsThrow(cx, rv); - } - - mozilla::dom::ImageData* concreteImageData = - static_cast(domImageData); - *width = concreteImageData->GetWidth(); - *height = concreteImageData->GetHeight(); - array->set(concreteImageData->GetDataObject()); - return true; -} - -#endif // CustomQS_Canvas_h diff --git a/content/canvas/src/CustomQS_Canvas2D.h b/content/canvas/src/CustomQS_Canvas2D.h deleted file mode 100644 index 32843945f8f1..000000000000 --- a/content/canvas/src/CustomQS_Canvas2D.h +++ /dev/null @@ -1,302 +0,0 @@ -/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsError.h" -#include "nsIDOMCanvasRenderingContext2D.h" -#include "mozilla/CheckedInt.h" -#include "nsMathUtils.h" -#include "CustomQS_Canvas.h" - -#include "jsapi.h" -#include "jsfriendapi.h" - -typedef NS_STDCALL_FUNCPROTO(nsresult, CanvasStyleSetterType, nsIDOMCanvasRenderingContext2D, - SetStrokeStyle_multi, (const nsAString &, nsISupports *)); -typedef NS_STDCALL_FUNCPROTO(nsresult, CanvasStyleGetterType, nsIDOMCanvasRenderingContext2D, - GetStrokeStyle_multi, (nsAString &, nsISupports **, int32_t *)); - -static JSBool -Canvas2D_SetStyleHelper(JSContext *cx, JSObject *obj, jsid id, JSMutableHandleValue vp, - CanvasStyleSetterType setfunc) -{ - XPC_QS_ASSERT_CONTEXT_OK(cx); - nsIDOMCanvasRenderingContext2D *self; - xpc_qsSelfRef selfref; - JS::AutoValueRooter tvr(cx); - if (!xpc_qsUnwrapThis(cx, obj, &self, &selfref.ptr, tvr.jsval_addr(), nullptr)) - return JS_FALSE; - - nsresult rv = NS_OK; - if (JSVAL_IS_STRING(vp)) { - xpc_qsDOMString arg0(cx, vp, vp.address(), - xpc_qsDOMString::eDefaultNullBehavior, - xpc_qsDOMString::eDefaultUndefinedBehavior); - if (!arg0.IsValid()) - return JS_FALSE; - - rv = (self->*setfunc)(arg0, nullptr); - } else { - nsISupports *arg0; - xpc_qsSelfRef arg0ref; - rv = xpc_qsUnwrapArg(cx, vp, &arg0, &arg0ref.ptr, vp.address()); - if (NS_FAILED(rv)) { - xpc_qsThrowBadSetterValue(cx, rv, JSVAL_TO_OBJECT(*tvr.jsval_addr()), id); - return JS_FALSE; - } - - rv = (self->*setfunc)(NullString(), arg0); - } - - if (NS_FAILED(rv)) - return xpc_qsThrowGetterSetterFailed(cx, rv, JSVAL_TO_OBJECT(*tvr.jsval_addr()), id); - - return JS_TRUE; -} - -static JSBool -Canvas2D_GetStyleHelper(JSContext *cx, JSObject *obj, jsid id, JSMutableHandleValue vp, - CanvasStyleGetterType getfunc) -{ - XPC_QS_ASSERT_CONTEXT_OK(cx); - nsIDOMCanvasRenderingContext2D *self; - xpc_qsSelfRef selfref; - XPCLazyCallContext lccx(JS_CALLER, cx, obj); - if (!xpc_qsUnwrapThis(cx, obj, &self, &selfref.ptr, vp.address(), &lccx)) - return JS_FALSE; - nsresult rv; - - nsString resultString; - nsCOMPtr resultInterface; - int32_t resultType; - rv = (self->*getfunc)(resultString, getter_AddRefs(resultInterface), &resultType); - if (NS_FAILED(rv)) - return xpc_qsThrowGetterSetterFailed(cx, rv, JSVAL_TO_OBJECT(vp), id); - - switch (resultType) { - case nsIDOMCanvasRenderingContext2D::CMG_STYLE_STRING: - return xpc::StringToJsval(cx, resultString, vp.address()); - - case nsIDOMCanvasRenderingContext2D::CMG_STYLE_PATTERN: - { - qsObjectHelper helper(resultInterface, - xpc_qsGetWrapperCache(resultInterface)); - return xpc_qsXPCOMObjectToJsval(lccx, helper, - &NS_GET_IID(nsIDOMCanvasPattern), - &interfaces[k_nsIDOMCanvasPattern], vp.address()); - } - case nsIDOMCanvasRenderingContext2D::CMG_STYLE_GRADIENT: - { - qsObjectHelper helper(resultInterface, - xpc_qsGetWrapperCache(resultInterface)); - return xpc_qsXPCOMObjectToJsval(lccx, helper, - &NS_GET_IID(nsIDOMCanvasGradient), - &interfaces[k_nsIDOMCanvasGradient], vp.address()); - } - default: - return xpc_qsThrowGetterSetterFailed(cx, NS_ERROR_FAILURE, JSVAL_TO_OBJECT(vp), id); - } -} - -static JSBool -nsIDOMCanvasRenderingContext2D_SetStrokeStyle(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JSMutableHandleValue vp) -{ - return Canvas2D_SetStyleHelper(cx, obj, id, vp, &nsIDOMCanvasRenderingContext2D::SetStrokeStyle_multi); -} - -static JSBool -nsIDOMCanvasRenderingContext2D_GetStrokeStyle(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp) -{ - return Canvas2D_GetStyleHelper(cx, obj, id, vp, &nsIDOMCanvasRenderingContext2D::GetStrokeStyle_multi); -} - -static JSBool -nsIDOMCanvasRenderingContext2D_SetFillStyle(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JSMutableHandleValue vp) -{ - return Canvas2D_SetStyleHelper(cx, obj, id, vp, &nsIDOMCanvasRenderingContext2D::SetFillStyle_multi); -} - -static JSBool -nsIDOMCanvasRenderingContext2D_GetFillStyle(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp) -{ - return Canvas2D_GetStyleHelper(cx, obj, id, vp, &nsIDOMCanvasRenderingContext2D::GetFillStyle_multi); -} - -static bool -CreateImageData(JSContext* cx, JSObject* obj, uint32_t w, uint32_t h, jsval* vp) -{ - using mozilla::CheckedInt; - - if (w == 0) - w = 1; - if (h == 0) - h = 1; - - CheckedInt len = CheckedInt(w) * h * 4; - if (!len.isValid()) { - return xpc_qsThrow(cx, NS_ERROR_DOM_INDEX_SIZE_ERR); - } - - // Create the fast typed array; it's initialized to 0 by default. - JSObject* darray = JS_NewUint8ClampedArray(cx, len.value()); - JS::AutoObjectRooter rd(cx, darray); - if (!darray) { - return false; - } - - XPCLazyCallContext lccx(JS_CALLER, cx, obj); - const nsIID *iid = &NS_GET_IID(nsIDOMImageData); - nsRefPtr imageData = - new mozilla::dom::ImageData(w, h, *darray); - qsObjectHelper helper(imageData, NULL); - return xpc_qsXPCOMObjectToJsval(lccx, helper, iid, - &interfaces[k_nsIDOMImageData], vp); -} - -static JSBool -nsIDOMCanvasRenderingContext2D_CreateImageData(JSContext *cx, unsigned argc, jsval *vp) -{ - XPC_QS_ASSERT_CONTEXT_OK(cx); - - JSObject* obj = JS_THIS_OBJECT(cx, vp); - if (!obj) { - return false; - } - - if (argc < 1) - return xpc_qsThrow(cx, NS_ERROR_XPC_NOT_ENOUGH_ARGS); - - jsval *argv = JS_ARGV(cx, vp); - - if (argc == 1) { - uint32_t data_width, data_height; - JS::Anchor darray; - if (!GetImageData(cx, argv[0], &data_width, &data_height, &darray)) { - return false; - } - - return CreateImageData(cx, obj, data_width, data_height, vp); - } - - double width, height; - if (!JS_ValueToNumber(cx, argv[0], &width) || - !JS_ValueToNumber(cx, argv[1], &height)) - return false; - - if (!NS_finite(width) || !NS_finite(height)) - return xpc_qsThrow(cx, NS_ERROR_DOM_NOT_SUPPORTED_ERR); - - if (!width || !height) - return xpc_qsThrow(cx, NS_ERROR_DOM_INDEX_SIZE_ERR); - - int32_t wi = JS_DoubleToInt32(width); - int32_t hi = JS_DoubleToInt32(height); - - uint32_t w = NS_ABS(wi); - uint32_t h = NS_ABS(hi); - return CreateImageData(cx, obj, w, h, vp); -} - -static JSBool -nsIDOMCanvasRenderingContext2D_PutImageData(JSContext *cx, unsigned argc, jsval *vp) -{ - XPC_QS_ASSERT_CONTEXT_OK(cx); - - JSObject *obj = JS_THIS_OBJECT(cx, vp); - if (!obj) - return JS_FALSE; - - nsresult rv; - - nsIDOMCanvasRenderingContext2D *self; - xpc_qsSelfRef selfref; - JS::AutoValueRooter tvr(cx); - if (!xpc_qsUnwrapThis(cx, obj, &self, &selfref.ptr, tvr.jsval_addr(), nullptr)) - return JS_FALSE; - - if (argc < 3) - return xpc_qsThrow(cx, NS_ERROR_XPC_NOT_ENOUGH_ARGS); - - jsval *argv = JS_ARGV(cx, vp); - - uint32_t w, h; - JS::Anchor darray; - if (!GetImageData(cx, argv[0], &w, &h, &darray)) { - return false; - } - - double xd, yd; - if (!JS_ValueToNumber(cx, argv[1], &xd) || - !JS_ValueToNumber(cx, argv[2], &yd)) { - return false; - } - - if (!NS_finite(xd) || !NS_finite(yd)) { - return xpc_qsThrow(cx, NS_ERROR_DOM_NOT_SUPPORTED_ERR); - } - - int32_t x = JS_DoubleToInt32(xd); - int32_t y = JS_DoubleToInt32(yd); - - // the optional dirty rect - bool hasDirtyRect = false; - int32_t dirtyX = 0, - dirtyY = 0, - dirtyWidth = w, - dirtyHeight = h; - - if (argc >= 7) { - double dx, dy, dw, dh; - if (!JS_ValueToNumber(cx, argv[3], &dx) || - !JS_ValueToNumber(cx, argv[4], &dy) || - !JS_ValueToNumber(cx, argv[5], &dw) || - !JS_ValueToNumber(cx, argv[6], &dh)) { - return false; - } - - if (!NS_finite(dx) || !NS_finite(dy) || - !NS_finite(dw) || !NS_finite(dh)) { - return xpc_qsThrow(cx, NS_ERROR_DOM_NOT_SUPPORTED_ERR); - } - - dirtyX = JS_DoubleToInt32(dx); - dirtyY = JS_DoubleToInt32(dy); - dirtyWidth = JS_DoubleToInt32(dw); - dirtyHeight = JS_DoubleToInt32(dh); - - hasDirtyRect = true; - } - - JS::AutoValueRooter tsrc_tvr(cx); - - JSObject * tsrc = NULL; - if (JS_IsInt8Array(darray.get(), cx) || - JS_IsUint8Array(darray.get(), cx) || - JS_IsUint8ClampedArray(darray.get(), cx)) - { - tsrc = darray.get(); - } else if (JS_IsTypedArrayObject(darray.get(), cx) || JS_IsArrayObject(cx, darray.get())) { - // ugh, this isn't a uint8 typed array, someone made their own object; convert it to a typed array - JSObject *nobj = JS_NewUint8ClampedArrayFromArray(cx, darray.get()); - if (!nobj) - return JS_FALSE; - - *tsrc_tvr.jsval_addr() = OBJECT_TO_JSVAL(nobj); - tsrc = nobj; - } else { - // yeah, no. - return xpc_qsThrow(cx, NS_ERROR_DOM_TYPE_MISMATCH_ERR); - } - - // make the call - MOZ_ASSERT(JS_IsTypedArrayObject(tsrc, cx)); - uint8_t* data = reinterpret_cast(JS_GetArrayBufferViewData(tsrc, cx)); - uint32_t byteLength = JS_GetTypedArrayByteLength(tsrc, cx); - rv = self->PutImageData_explicit(x, y, w, h, data, byteLength, hasDirtyRect, dirtyX, dirtyY, dirtyWidth, dirtyHeight); - if (NS_FAILED(rv)) - return xpc_qsThrowMethodFailed(cx, rv, vp); - - *vp = JSVAL_VOID; - return JS_TRUE; -} diff --git a/content/canvas/src/Makefile.in b/content/canvas/src/Makefile.in index f2299224a955..c1f7c6557680 100644 --- a/content/canvas/src/Makefile.in +++ b/content/canvas/src/Makefile.in @@ -17,8 +17,6 @@ LIBRARY_NAME = gkconcvs_s LIBXUL_LIBRARY = 1 EXPORTS = \ - CustomQS_Canvas.h \ - CustomQS_Canvas2D.h \ WebGLContext.h \ WebGLElementArrayCache.h \ WebGLExtensions.h \ @@ -27,14 +25,14 @@ EXPORTS = \ EXPORTS_NAMESPACES = mozilla/dom EXPORTS_mozilla/dom = \ + CanvasRenderingContext2D.h \ ImageData.h \ $(NULL) CPPSRCS = \ CanvasImageCache.cpp \ + CanvasRenderingContext2D.cpp \ CanvasUtils.cpp \ - nsCanvasRenderingContext2D.cpp \ - nsCanvasRenderingContext2DAzure.cpp \ DocumentRendererParent.cpp \ DocumentRendererChild.cpp \ ImageData.cpp \ diff --git a/content/canvas/src/nsCanvasRenderingContext2D.cpp b/content/canvas/src/nsCanvasRenderingContext2D.cpp deleted file mode 100644 index 21b718f7524a..000000000000 --- a/content/canvas/src/nsCanvasRenderingContext2D.cpp +++ /dev/null @@ -1,4405 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* vim:set ts=4 sw=4 et tw=78: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "base/basictypes.h" - -#include "nsIDOMXULElement.h" - -#include "prenv.h" - -#include "nsIServiceManager.h" -#include "nsMathUtils.h" - -#include "nsContentUtils.h" - -#include "nsIDocument.h" -#include "nsIDOMCanvasRenderingContext2D.h" -#include "nsICanvasRenderingContextInternal.h" -#include "nsHTMLCanvasElement.h" -#include "nsSVGEffects.h" -#include "nsPresContext.h" -#include "nsIPresShell.h" -#include "nsIVariant.h" - -#include "nsIInterfaceRequestorUtils.h" -#include "nsError.h" -#include "nsIScriptError.h" - -#include "nsCSSParser.h" -#include "mozilla/css/StyleRule.h" -#include "mozilla/css/Declaration.h" -#include "nsComputedDOMStyle.h" -#include "nsStyleSet.h" - -#include "nsPrintfCString.h" - -#include "nsReadableUtils.h" - -#include "nsColor.h" -#include "nsGfxCIID.h" -#include "nsIScriptSecurityManager.h" -#include "nsIDocShell.h" -#include "nsIDOMWindow.h" -#include "nsPIDOMWindow.h" -#include "nsIDocShellTreeItem.h" -#include "nsIDocShellTreeNode.h" -#include "nsIXPConnect.h" -#include "nsDisplayList.h" - -#include "nsTArray.h" - -#include "imgIEncoder.h" - -#include "gfxContext.h" -#include "gfxASurface.h" -#include "gfxImageSurface.h" -#include "gfxPlatform.h" -#include "gfxFont.h" -#include "gfxBlur.h" -#include "gfxUtils.h" -#include "nsRenderingContext.h" -#include "gfxSVGGlyphs.h" - -#include "nsFrameManager.h" -#include "nsFrameLoader.h" -#include "nsBidi.h" -#include "nsBidiPresUtils.h" -#include "Layers.h" -#include "CanvasUtils.h" -#include "nsIMemoryReporter.h" -#include "nsStyleUtil.h" -#include "CanvasImageCache.h" - -#include - -#include "jsapi.h" -#include "jsfriendapi.h" - -#include "mozilla/Assertions.h" -#include "mozilla/CheckedInt.h" -#include "mozilla/dom/ContentParent.h" -#include "mozilla/dom/ImageData.h" -#include "mozilla/dom/PBrowserParent.h" -#include "mozilla/ipc/DocumentRendererParent.h" -#include "mozilla/ipc/PDocumentRendererParent.h" -#include "mozilla/unused.h" - -#include "CustomQS_Canvas.h" -#include "jsfriendapi.h" - -// windows.h (included by chromium code) defines this, in its infinite wisdom -#undef DrawText - -using namespace mozilla; -using namespace mozilla::CanvasUtils; -using namespace mozilla::dom; -using namespace mozilla::ipc; -using namespace mozilla::layers; - -static float kDefaultFontSize = 10.0; -static NS_NAMED_LITERAL_STRING(kDefaultFontName, "sans-serif"); -static NS_NAMED_LITERAL_STRING(kDefaultFontStyle, "10px sans-serif"); - -/* Memory reporter stuff */ -static nsIMemoryReporter *gCanvasMemoryReporter = nullptr; -static int64_t gCanvasMemoryUsed = 0; - -static int64_t GetCanvasMemoryUsed() { - return gCanvasMemoryUsed; -} - -// This is KIND_OTHER because it's not always clear where in memory the pixels of -// a canvas are stored. Furthermore, this memory will be tracked by the -// underlying surface implementations. See bug 655638 for details. -NS_MEMORY_REPORTER_IMPLEMENT(CanvasMemory, - "canvas-2d-pixel-bytes", - KIND_OTHER, - UNITS_BYTES, - GetCanvasMemoryUsed, - "Memory used by 2D canvases. Each canvas requires (width * height * 4) " - "bytes.") - -static void -CopyContext(gfxContext* dest, gfxContext* src) -{ - dest->Multiply(src->CurrentMatrix()); - - nsRefPtr path = src->CopyPath(); - dest->NewPath(); - dest->AppendPath(path); - - nsRefPtr pattern = src->GetPattern(); - dest->SetPattern(pattern); - - dest->SetLineWidth(src->CurrentLineWidth()); - dest->SetLineCap(src->CurrentLineCap()); - dest->SetLineJoin(src->CurrentLineJoin()); - dest->SetMiterLimit(src->CurrentMiterLimit()); - dest->SetFillRule(src->CurrentFillRule()); - - dest->SetAntialiasMode(src->CurrentAntialiasMode()); - - AutoFallibleTArray dashes; - double dashOffset; - if (src->CurrentDash(dashes, &dashOffset)) { - dest->SetDash(dashes.Elements(), dashes.Length(), dashOffset); - } -} - -/** - ** nsCanvasGradient - **/ -#define NS_CANVASGRADIENT_PRIVATE_IID \ - { 0x491d39d8, 0x4058, 0x42bd, { 0xac, 0x76, 0x70, 0xd5, 0x62, 0x7f, 0x02, 0x10 } } -class nsCanvasGradient MOZ_FINAL : public nsIDOMCanvasGradient -{ -public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_CANVASGRADIENT_PRIVATE_IID) - - nsCanvasGradient(gfxPattern* pat) - : mPattern(pat) - { - } - - gfxPattern* GetPattern() { - return mPattern; - } - - /* nsIDOMCanvasGradient */ - NS_IMETHOD AddColorStop (float offset, - const nsAString& colorstr) - { - if (!FloatValidate(offset) || offset < 0.0 || offset > 1.0) - return NS_ERROR_DOM_INDEX_SIZE_ERR; - - nsCSSValue value; - nsCSSParser parser; - if (!parser.ParseColorString(colorstr, nullptr, 0, value)) { - return NS_ERROR_DOM_SYNTAX_ERR; - } - - nscolor color; - if (!nsRuleNode::ComputeColor(value, nullptr, nullptr, color)) { - return NS_ERROR_DOM_SYNTAX_ERR; - } - - mPattern->AddColorStop(offset, gfxRGBA(color)); - - return NS_OK; - } - - NS_DECL_ISUPPORTS - -protected: - nsRefPtr mPattern; -}; - -NS_DEFINE_STATIC_IID_ACCESSOR(nsCanvasGradient, NS_CANVASGRADIENT_PRIVATE_IID) - -NS_IMPL_ADDREF(nsCanvasGradient) -NS_IMPL_RELEASE(nsCanvasGradient) - -DOMCI_DATA(CanvasGradient, nsCanvasGradient) - -NS_INTERFACE_MAP_BEGIN(nsCanvasGradient) - NS_INTERFACE_MAP_ENTRY(nsCanvasGradient) - NS_INTERFACE_MAP_ENTRY(nsIDOMCanvasGradient) - NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CanvasGradient) - NS_INTERFACE_MAP_ENTRY(nsISupports) -NS_INTERFACE_MAP_END - -/** - ** nsCanvasPattern - **/ -#define NS_CANVASPATTERN_PRIVATE_IID \ - { 0xb85c6c8a, 0x0624, 0x4530, { 0xb8, 0xee, 0xff, 0xdf, 0x42, 0xe8, 0x21, 0x6d } } -class nsCanvasPattern MOZ_FINAL : public nsIDOMCanvasPattern -{ -public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_CANVASPATTERN_PRIVATE_IID) - - nsCanvasPattern(gfxPattern* pat, - nsIPrincipal* principalForSecurityCheck, - bool forceWriteOnly, - bool CORSUsed) - : mPattern(pat), - mPrincipal(principalForSecurityCheck), - mForceWriteOnly(forceWriteOnly), - mCORSUsed(CORSUsed) - { - } - - gfxPattern* GetPattern() const { - return mPattern; - } - - nsIPrincipal* Principal() const { return mPrincipal; } - bool GetForceWriteOnly() const { return mForceWriteOnly; } - bool GetCORSUsed() const { return mCORSUsed; } - - NS_DECL_ISUPPORTS - -protected: - nsRefPtr mPattern; - nsCOMPtr mPrincipal; - const bool mForceWriteOnly; - const bool mCORSUsed; -}; - -NS_DEFINE_STATIC_IID_ACCESSOR(nsCanvasPattern, NS_CANVASPATTERN_PRIVATE_IID) - -NS_IMPL_ADDREF(nsCanvasPattern) -NS_IMPL_RELEASE(nsCanvasPattern) - -DOMCI_DATA(CanvasPattern, nsCanvasPattern) - -NS_INTERFACE_MAP_BEGIN(nsCanvasPattern) - NS_INTERFACE_MAP_ENTRY(nsCanvasPattern) - NS_INTERFACE_MAP_ENTRY(nsIDOMCanvasPattern) - NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CanvasPattern) - NS_INTERFACE_MAP_ENTRY(nsISupports) -NS_INTERFACE_MAP_END - -/** - ** nsTextMetrics - **/ -#define NS_TEXTMETRICS_PRIVATE_IID \ - { 0xc5b1c2f9, 0xcb4f, 0x4394, { 0xaf, 0xe0, 0xc6, 0x59, 0x33, 0x80, 0x8b, 0xf3 } } -class nsTextMetrics : public nsIDOMTextMetrics -{ -public: - nsTextMetrics(float w) : width(w) { } - - virtual ~nsTextMetrics() { } - - NS_DECLARE_STATIC_IID_ACCESSOR(NS_TEXTMETRICS_PRIVATE_IID) - - NS_IMETHOD GetWidth(float* w) { - *w = width; - return NS_OK; - } - - NS_DECL_ISUPPORTS - -private: - float width; -}; - -NS_DEFINE_STATIC_IID_ACCESSOR(nsTextMetrics, NS_TEXTMETRICS_PRIVATE_IID) - -NS_IMPL_ADDREF(nsTextMetrics) -NS_IMPL_RELEASE(nsTextMetrics) - -DOMCI_DATA(TextMetrics, nsTextMetrics) - -NS_INTERFACE_MAP_BEGIN(nsTextMetrics) - NS_INTERFACE_MAP_ENTRY(nsTextMetrics) - NS_INTERFACE_MAP_ENTRY(nsIDOMTextMetrics) - NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(TextMetrics) - NS_INTERFACE_MAP_ENTRY(nsISupports) -NS_INTERFACE_MAP_END - -struct nsCanvasBidiProcessor; -class CanvasRenderingContext2DUserData; - -/** - ** nsCanvasRenderingContext2D - **/ -class nsCanvasRenderingContext2D : - public nsIDOMCanvasRenderingContext2D, - public nsICanvasRenderingContextInternal -{ -public: - nsCanvasRenderingContext2D(); - virtual ~nsCanvasRenderingContext2D(); - - nsresult Redraw(); - - // nsICanvasRenderingContextInternal - NS_IMETHOD SetDimensions(int32_t width, int32_t height); - void Initialize(nsIDocShell *shell, int32_t width, int32_t height); - NS_IMETHOD InitializeWithSurface(nsIDocShell *shell, gfxASurface *surface, int32_t width, int32_t height); - bool EnsureSurface(); - NS_IMETHOD Render(gfxContext *ctx, - gfxPattern::GraphicsFilter aFilter, - uint32_t aFlags = RenderFlagPremultAlpha); - NS_IMETHOD GetInputStream(const char* aMimeType, - const PRUnichar* aEncoderOptions, - nsIInputStream **aStream); - NS_IMETHOD GetThebesSurface(gfxASurface **surface); - mozilla::TemporaryRef GetSurfaceSnapshot() - { return nullptr; } - - NS_IMETHOD SetIsOpaque(bool isOpaque); - NS_IMETHOD Reset(); - virtual already_AddRefed GetCanvasLayer(nsDisplayListBuilder* aBuilder, - CanvasLayer *aOldLayer, - LayerManager *aManager); - virtual bool ShouldForceInactiveLayer(LayerManager *aManager); - virtual void MarkContextClean(); - NS_IMETHOD SetIsIPC(bool isIPC); - // this rect is in canvas device space - NS_IMETHOD Redraw(const gfxRect &r); - // this rect is in mThebes's current user space - NS_IMETHOD RedrawUser(const gfxRect &r); - - // nsISupports interface + CC - NS_DECL_CYCLE_COLLECTING_ISUPPORTS - - NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsCanvasRenderingContext2D, nsIDOMCanvasRenderingContext2D) - - // nsIDOMCanvasRenderingContext2D interface - NS_DECL_NSIDOMCANVASRENDERINGCONTEXT2D - - enum Style { - STYLE_STROKE = 0, - STYLE_FILL, - STYLE_SHADOW, - STYLE_MAX - }; - - class PathAutoSaveRestore - { - public: - PathAutoSaveRestore(nsCanvasRenderingContext2D* aCtx) : - mContext(aCtx->mThebes) - { - if (aCtx->mHasPath) { - mPath = mContext->CopyPath(); - } - } - ~PathAutoSaveRestore() - { - mContext->NewPath(); - if (mPath) { - mContext->AppendPath(mPath); - } - } - private: - gfxContext *mContext; - nsRefPtr mPath; - }; - friend class PathAutoSaveRestore; - friend class CanvasRenderingContext2DUserData; - -protected: - nsresult GetImageDataArray(JSContext* aCx, int32_t aX, int32_t aY, - uint32_t aWidth, uint32_t aHeight, - JSObject** aRetval); - - /** - * The number of living nsCanvasRenderingContexts. When this goes down to - * 0, we free the premultiply and unpremultiply tables, if they exist. - */ - static uint32_t sNumLivingContexts; - - /** - * Lookup table used to speed up GetImageData(). - */ - static uint8_t (*sUnpremultiplyTable)[256]; - - /** - * Lookup table used to speed up PutImageData(). - */ - static uint8_t (*sPremultiplyTable)[256]; - - // Some helpers. Doesn't modify acolor on failure. - nsresult SetStyleFromStringOrInterface(const nsAString& aStr, nsISupports *aInterface, Style aWhichStyle); - nsresult GetStyleAsStringOrInterface(nsAString& aStr, nsISupports **aInterface, int32_t *aType, Style aWhichStyle); - - // Returns whether a color was successfully parsed. - bool ParseColor(const nsAString& aString, nscolor* aColor); - - void StyleColorToString(const nscolor& aColor, nsAString& aStr); - - void DirtyAllStyles(); - /** - * applies the given style as the current source. If the given style is - * a solid color, aUseGlobalAlpha indicates whether to multiply the alpha - * by global alpha, and is ignored otherwise. - */ - void ApplyStyle(Style aWhichStyle, bool aUseGlobalAlpha = true); - - /** - * Creates the unpremultiply lookup table, if it doesn't exist. - */ - void EnsureUnpremultiplyTable(); - - /** - * Creates the premultiply lookup table, if it doesn't exist. - */ - void EnsurePremultiplyTable(); - - /** - * Returns the image format this canvas should be allocated using. Takes - * into account mOpaque, platform requirements, etc. - */ - gfxASurface::gfxImageFormat GetImageFormat() const; - - // Member vars - int32_t mWidth, mHeight; - bool mValid; - bool mZero; - bool mOpaque; - bool mResetLayer; - bool mIPC; - - // Initialize the Thebes rendering context - void CreateThebes(); - - // If mCanvasElement is not provided, then a docshell is - nsCOMPtr mDocShell; - nsTArray mUserDatas; - - // our drawing surfaces, contexts, and layers - nsRefPtr mThebes; - nsRefPtr mSurface; - bool mSurfaceCreated; - - uint32_t mSaveCount; - - /** - * Flag to avoid duplicate calls to InvalidateFrame. Set to true whenever - * Redraw is called, reset to false when Render is called. - */ - bool mIsEntireFrameInvalid; - /** - * When this is set, the first call to Redraw(gfxRect) should set - * mIsEntireFrameInvalid since we expect it will be followed by - * many more Redraw calls. - */ - bool mPredictManyRedrawCalls; - /** - * This is set whenever there's a nonempty path set by the API user. - */ - bool mHasPath; - - /** - * Number of times we've invalidated before calling redraw - */ - uint32_t mInvalidateCount; - static const uint32_t kCanvasMaxInvalidateCount = 100; - - /** - * Returns true iff the the given operator should affect areas of the - * destination where the source is transparent. Among other things, this - * implies that a fully transparent source would still affect the canvas. - */ - bool OperatorAffectsUncoveredAreas(gfxContext::GraphicsOperator op) const - { - return op == gfxContext::OPERATOR_IN || - op == gfxContext::OPERATOR_OUT || - op == gfxContext::OPERATOR_DEST_IN || - op == gfxContext::OPERATOR_DEST_ATOP; - } - - /** - * Returns true iff a shadow should be drawn along with a - * drawing operation. - */ - bool NeedToDrawShadow() - { - ContextState& state = CurrentState(); - - // The spec says we should not draw shadows when the alpha value is 0, - // regardless of the operator being used. - return state.StyleIsColor(STYLE_SHADOW) && - NS_GET_A(state.colorStyles[STYLE_SHADOW]) > 0 && - (state.shadowOffset != gfxPoint(0, 0) || state.shadowBlur != 0); - } - - /** - * Checks the current state to determine if an intermediate surface would - * be necessary to complete a drawing operation. Does not check the - * condition pertaining to global alpha and patterns since that does not - * pertain to all drawing operations. - */ - bool NeedToUseIntermediateSurface() - { - if (!mThebes) { - // Haven't created a surface yet, default is OVER. - return OperatorAffectsUncoveredAreas(gfxContext::OPERATOR_OVER); - } - - // certain operators always need an intermediate surface, except - // with quartz since quartz does compositing differently than cairo - return OperatorAffectsUncoveredAreas(mThebes->CurrentOperator()); - - // XXX there are other unhandled cases but they should be investigated - // first to ensure we aren't using an intermediate surface unecessarily - } - - /** - * If the current operator is "source" then clear the destination before we - * draw into it, to simulate the effect of an unbounded source operator. - */ - void ClearSurfaceForUnboundedSource() - { - if (!mThebes) { - // Haven't created a surface yet, default is OVER. - return; - } - - gfxContext::GraphicsOperator current = mThebes->CurrentOperator(); - if (current != gfxContext::OPERATOR_SOURCE) - return; - mThebes->SetOperator(gfxContext::OPERATOR_CLEAR); - // It doesn't really matter what the source is here, since Paint - // isn't bounded by the source and the mask covers the entire clip - // region. - mThebes->Paint(); - mThebes->SetOperator(current); - } - - /** - * Returns true iff the current source is such that global alpha would not - * be handled correctly without the use of an intermediate surface. - */ - bool NeedIntermediateSurfaceToHandleGlobalAlpha(Style aWhichStyle) - { - return CurrentState().globalAlpha != 1.0 && !CurrentState().StyleIsColor(aWhichStyle); - } - - /** - * Initializes the drawing of a shadow onto the canvas. The returned context - * should have the shadow shape drawn onto it, and then ShadowFinalize - * should be called. The return value is null if an error occurs. - * @param extents The extents of the shadow object, in device space. - * @param blur A newly contructed gfxAlphaBoxBlur, made with the default - * constructor and left uninitialized. - * @remark The lifetime of the return value is tied to the lifetime of - * the gfxAlphaBoxBlur, so it does not need to be ref counted. - */ - gfxContext* ShadowInitialize(const gfxRect& extents, gfxAlphaBoxBlur& blur); - - /** - * Completes a shadow drawing operation. - * @param blur The gfxAlphaBoxBlur that was passed to ShadowInitialize. - */ - void ShadowFinalize(gfxAlphaBoxBlur& blur); - - /** - * Draws the current path in the given style. Takes care of - * any shadow drawing and will use intermediate surfaces as needed. - * - * If dirtyRect is given, it will contain the user-space dirty - * rectangle of the draw operation. - */ - nsresult DrawPath(Style style, gfxRect *dirtyRect = nullptr); - - /** - * Draws a rectangle in the given style; used by FillRect and StrokeRect. - */ - nsresult DrawRect(const gfxRect& rect, Style style); - - /** - * Gets the pres shell from either the canvas element or the doc shell - */ - nsIPresShell *GetPresShell() { - if (mCanvasElement) { - return mCanvasElement->OwnerDoc()->GetShell(); - } - if (mDocShell) { - nsCOMPtr shell; - mDocShell->GetPresShell(getter_AddRefs(shell)); - return shell.get(); - } - return nullptr; - } - - // text - enum TextAlign { - TEXT_ALIGN_START, - TEXT_ALIGN_END, - TEXT_ALIGN_LEFT, - TEXT_ALIGN_RIGHT, - TEXT_ALIGN_CENTER - }; - - enum TextBaseline { - TEXT_BASELINE_TOP, - TEXT_BASELINE_HANGING, - TEXT_BASELINE_MIDDLE, - TEXT_BASELINE_ALPHABETIC, - TEXT_BASELINE_IDEOGRAPHIC, - TEXT_BASELINE_BOTTOM - }; - - gfxFontGroup* GetCurrentFontStyle(); - gfxTextRun* MakeTextRun(const PRUnichar* aText, - uint32_t aLength, - uint32_t aAppUnitsPerDevUnit, - uint32_t aFlags); - - enum TextDrawOperation { - TEXT_DRAW_OPERATION_FILL, - TEXT_DRAW_OPERATION_STROKE, - TEXT_DRAW_OPERATION_MEASURE - }; - - /* - * Implementation of the fillText, strokeText, and measure functions with - * the operation abstracted to a flag. - */ - nsresult DrawOrMeasureText(const nsAString& text, - float x, - float y, - float maxWidth, - TextDrawOperation op, - float* aWidth); - - // style handling - /* - * The previous set style. Is equal to STYLE_MAX when there is no valid - * previous style. - */ - Style mLastStyle; - bool mDirtyStyle[STYLE_MAX]; - - // state stack handling - class ContextState { - public: - ContextState() : shadowOffset(0.0, 0.0), - globalAlpha(1.0), - shadowBlur(0.0), - textAlign(TEXT_ALIGN_START), - textBaseline(TEXT_BASELINE_ALPHABETIC), - imageSmoothingEnabled(true) - { } - - ContextState(const ContextState& other) - : shadowOffset(other.shadowOffset), - globalAlpha(other.globalAlpha), - shadowBlur(other.shadowBlur), - font(other.font), - fontGroup(other.fontGroup), - textAlign(other.textAlign), - textBaseline(other.textBaseline), - imageSmoothingEnabled(other.imageSmoothingEnabled) - { - for (int i = 0; i < STYLE_MAX; i++) { - colorStyles[i] = other.colorStyles[i]; - gradientStyles[i] = other.gradientStyles[i]; - patternStyles[i] = other.patternStyles[i]; - } - } - - inline void SetColorStyle(Style whichStyle, nscolor color) { - colorStyles[whichStyle] = color; - gradientStyles[whichStyle] = nullptr; - patternStyles[whichStyle] = nullptr; - } - - inline void SetPatternStyle(Style whichStyle, nsCanvasPattern* pat) { - gradientStyles[whichStyle] = nullptr; - patternStyles[whichStyle] = pat; - } - - inline void SetGradientStyle(Style whichStyle, nsCanvasGradient* grad) { - gradientStyles[whichStyle] = grad; - patternStyles[whichStyle] = nullptr; - } - - /** - * returns true iff the given style is a solid color. - */ - inline bool StyleIsColor(Style whichStyle) const - { - return !(patternStyles[whichStyle] || - gradientStyles[whichStyle]); - } - - gfxPoint shadowOffset; - float globalAlpha; - float shadowBlur; - - nsString font; - nsRefPtr fontGroup; - TextAlign textAlign; - TextBaseline textBaseline; - - nscolor colorStyles[STYLE_MAX]; - nsCOMPtr gradientStyles[STYLE_MAX]; - nsCOMPtr patternStyles[STYLE_MAX]; - - bool imageSmoothingEnabled; - }; - - nsTArray mStyleStack; - - inline ContextState& CurrentState() { - return mStyleStack[mSaveCount]; - } - - // other helpers - void GetAppUnitsValues(uint32_t *perDevPixel, uint32_t *perCSSPixel) { - // If we don't have a canvas element, we just return something generic. - uint32_t devPixel = 60; - uint32_t cssPixel = 60; - - nsIPresShell *ps = GetPresShell(); - nsPresContext *pc; - - if (!ps) goto FINISH; - pc = ps->GetPresContext(); - if (!pc) goto FINISH; - devPixel = pc->AppUnitsPerDevPixel(); - cssPixel = pc->AppUnitsPerCSSPixel(); - - FINISH: - if (perDevPixel) - *perDevPixel = devPixel; - if (perCSSPixel) - *perCSSPixel = cssPixel; - } - - friend struct nsCanvasBidiProcessor; -}; - -class CanvasRenderingContext2DUserData : public LayerUserData { -public: - CanvasRenderingContext2DUserData(nsCanvasRenderingContext2D *aContext) - : mContext(aContext) - { - aContext->mUserDatas.AppendElement(this); - } - ~CanvasRenderingContext2DUserData() - { - if (mContext) { - mContext->mUserDatas.RemoveElement(this); - } - } - static void DidTransactionCallback(void* aData) - { - CanvasRenderingContext2DUserData* self = - static_cast(aData); - if (self->mContext) { - self->mContext->MarkContextClean(); - } - } - bool IsForContext(nsCanvasRenderingContext2D *aContext) - { - return mContext == aContext; - } - void Forget() - { - mContext = nullptr; - } - -private: - nsCanvasRenderingContext2D *mContext; -}; - -NS_IMPL_CYCLE_COLLECTING_ADDREF(nsCanvasRenderingContext2D) -NS_IMPL_CYCLE_COLLECTING_RELEASE(nsCanvasRenderingContext2D) - -NS_IMPL_CYCLE_COLLECTION_CLASS(nsCanvasRenderingContext2D) -NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsCanvasRenderingContext2D) - NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mCanvasElement) -NS_IMPL_CYCLE_COLLECTION_UNLINK_END -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsCanvasRenderingContext2D) - NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mCanvasElement, nsINode) -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END - -DOMCI_DATA(CanvasRenderingContext2D, nsCanvasRenderingContext2D) - -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsCanvasRenderingContext2D) - NS_INTERFACE_MAP_ENTRY(nsIDOMCanvasRenderingContext2D) - NS_INTERFACE_MAP_ENTRY(nsICanvasRenderingContextInternal) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, - nsICanvasRenderingContextInternal) - NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CanvasRenderingContext2D) -NS_INTERFACE_MAP_END - -/** - ** CanvasRenderingContext2D impl - **/ - - -// Initialize our static variables. -uint32_t nsCanvasRenderingContext2D::sNumLivingContexts = 0; -uint8_t (*nsCanvasRenderingContext2D::sUnpremultiplyTable)[256] = nullptr; -uint8_t (*nsCanvasRenderingContext2D::sPremultiplyTable)[256] = nullptr; - -nsresult -NS_NewCanvasRenderingContext2DThebes(nsIDOMCanvasRenderingContext2D** aResult) -{ - nsRefPtr ctx = new nsCanvasRenderingContext2D(); - if (!ctx) - return NS_ERROR_OUT_OF_MEMORY; - - *aResult = ctx.forget().get(); - return NS_OK; -} - -nsCanvasRenderingContext2D::nsCanvasRenderingContext2D() - : mValid(false), mZero(false), mOpaque(false), mResetLayer(true) - , mIPC(false) - , mSaveCount(0), mIsEntireFrameInvalid(false) - , mPredictManyRedrawCalls(false), mHasPath(false), mInvalidateCount(0) - , mLastStyle(STYLE_MAX), mStyleStack(20) -{ - sNumLivingContexts++; -} - -nsCanvasRenderingContext2D::~nsCanvasRenderingContext2D() -{ - Reset(); - // Drop references from all CanvasRenderingContext2DUserDatas to this context - for (uint32_t i = 0; i < mUserDatas.Length(); ++i) { - mUserDatas[i]->Forget(); - } - sNumLivingContexts--; - if (!sNumLivingContexts) { - delete[] sUnpremultiplyTable; - delete[] sPremultiplyTable; - sUnpremultiplyTable = nullptr; - sPremultiplyTable = nullptr; - } -} - -bool -nsCanvasRenderingContext2D::ParseColor(const nsAString& aString, - nscolor* aColor) -{ - nsIDocument* document = mCanvasElement - ? mCanvasElement->OwnerDoc() - : nullptr; - - // Pass the CSS Loader object to the parser, to allow parser error - // reports to include the outer window ID. - nsCSSParser parser(document ? document->CSSLoader() : nullptr); - nsCSSValue value; - if (!parser.ParseColorString(aString, nullptr, 0, value)) { - return false; - } - - nsIPresShell* presShell = GetPresShell(); - nsRefPtr parentContext; - if (mCanvasElement && mCanvasElement->IsInDoc()) { - // Inherit from the canvas element. - parentContext = nsComputedDOMStyle::GetStyleContextForElement( - mCanvasElement, nullptr, presShell); - } - - unused << nsRuleNode::ComputeColor( - value, presShell ? presShell->GetPresContext() : nullptr, parentContext, - *aColor); - return true; -} - -nsresult -nsCanvasRenderingContext2D::Reset() -{ - if (mCanvasElement) { - mCanvasElement->InvalidateCanvas(); - } - - // only do this for non-docshell created contexts, - // since those are the ones that we created a surface for - if (mValid && !mDocShell && mSurface) - gCanvasMemoryUsed -= mWidth * mHeight * 4; - - mSurface = nullptr; - mThebes = nullptr; - mValid = false; - mIsEntireFrameInvalid = false; - mPredictManyRedrawCalls = false; - return NS_OK; -} - -nsresult -nsCanvasRenderingContext2D::SetStyleFromStringOrInterface(const nsAString& aStr, - nsISupports *aInterface, - Style aWhichStyle) -{ - if (!aStr.IsVoid()) { - nscolor color; - if (!ParseColor(aStr, &color)) { - return NS_OK; - } - - CurrentState().SetColorStyle(aWhichStyle, color); - - mDirtyStyle[aWhichStyle] = true; - return NS_OK; - } - - if (aInterface) { - nsCOMPtr grad(do_QueryInterface(aInterface)); - if (grad) { - CurrentState().SetGradientStyle(aWhichStyle, grad); - mDirtyStyle[aWhichStyle] = true; - return NS_OK; - } - - nsCOMPtr pattern(do_QueryInterface(aInterface)); - if (pattern) { - CurrentState().SetPatternStyle(aWhichStyle, pattern); - mDirtyStyle[aWhichStyle] = true; - return NS_OK; - } - } - - nsContentUtils::ReportToConsole( - nsIScriptError::warningFlag, - "Canvas", - mCanvasElement ? mCanvasElement->OwnerDoc() : nullptr, - nsContentUtils::eDOM_PROPERTIES, - "UnexpectedCanvasVariantStyle"); - - return NS_OK; -} - -nsresult -nsCanvasRenderingContext2D::GetStyleAsStringOrInterface(nsAString& aStr, - nsISupports **aInterface, - int32_t *aType, - Style aWhichStyle) -{ - if (CurrentState().patternStyles[aWhichStyle]) { - aStr.SetIsVoid(true); - NS_ADDREF(*aInterface = CurrentState().patternStyles[aWhichStyle]); - *aType = CMG_STYLE_PATTERN; - } else if (CurrentState().gradientStyles[aWhichStyle]) { - aStr.SetIsVoid(true); - NS_ADDREF(*aInterface = CurrentState().gradientStyles[aWhichStyle]); - *aType = CMG_STYLE_GRADIENT; - } else { - StyleColorToString(CurrentState().colorStyles[aWhichStyle], aStr); - *aInterface = nullptr; - *aType = CMG_STYLE_STRING; - } - - return NS_OK; -} - -void -nsCanvasRenderingContext2D::StyleColorToString(const nscolor& aColor, nsAString& aStr) -{ - // We can't reuse the normal CSS color stringification code, - // because the spec calls for a different algorithm for canvas. - if (NS_GET_A(aColor) == 255) { - CopyUTF8toUTF16(nsPrintfCString("#%02x%02x%02x", - NS_GET_R(aColor), - NS_GET_G(aColor), - NS_GET_B(aColor)), - aStr); - } else { - CopyUTF8toUTF16(nsPrintfCString("rgba(%d, %d, %d, ", - NS_GET_R(aColor), - NS_GET_G(aColor), - NS_GET_B(aColor)), - aStr); - aStr.AppendFloat(nsStyleUtil::ColorComponentToFloat(NS_GET_A(aColor))); - aStr.Append(')'); - } -} - -void -nsCanvasRenderingContext2D::DirtyAllStyles() -{ - for (int i = 0; i < STYLE_MAX; i++) { - mDirtyStyle[i] = true; - } -} - -void -nsCanvasRenderingContext2D::ApplyStyle(Style aWhichStyle, - bool aUseGlobalAlpha) -{ - if (mLastStyle == aWhichStyle && - !mDirtyStyle[aWhichStyle] && - aUseGlobalAlpha) - { - // nothing to do, this is already the set style - return; - } - - if (!EnsureSurface()) { - return; - } - - // if not using global alpha, don't optimize with dirty bit - if (aUseGlobalAlpha) - mDirtyStyle[aWhichStyle] = false; - mLastStyle = aWhichStyle; - - nsCanvasPattern* pattern = CurrentState().patternStyles[aWhichStyle]; - if (pattern) { - if (mCanvasElement) - CanvasUtils::DoDrawImageSecurityCheck(mCanvasElement, - pattern->Principal(), - pattern->GetForceWriteOnly(), - pattern->GetCORSUsed()); - - gfxPattern* gpat = pattern->GetPattern(); - - if (CurrentState().imageSmoothingEnabled) - gpat->SetFilter(gfxPattern::FILTER_GOOD); - else - gpat->SetFilter(gfxPattern::FILTER_NEAREST); - - mThebes->SetPattern(gpat); - return; - } - - if (CurrentState().gradientStyles[aWhichStyle]) { - gfxPattern* gpat = CurrentState().gradientStyles[aWhichStyle]->GetPattern(); - mThebes->SetPattern(gpat); - return; - } - - gfxRGBA color(CurrentState().colorStyles[aWhichStyle]); - if (aUseGlobalAlpha) - color.a *= CurrentState().globalAlpha; - - mThebes->SetColor(color); -} - -nsresult -nsCanvasRenderingContext2D::Redraw() -{ - if (mIsEntireFrameInvalid) - return NS_OK; - mIsEntireFrameInvalid = true; - - if (!mCanvasElement) { - NS_ASSERTION(mDocShell, "Redraw with no canvas element or docshell!"); - return NS_OK; - } - - nsSVGEffects::InvalidateDirectRenderingObservers(mCanvasElement); - - mCanvasElement->InvalidateCanvasContent(nullptr); - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::Redraw(const gfxRect& r) -{ - ++mInvalidateCount; - - if (mIsEntireFrameInvalid) - return NS_OK; - - if (mPredictManyRedrawCalls || - mInvalidateCount > kCanvasMaxInvalidateCount) { - return Redraw(); - } - - if (!mCanvasElement) { - NS_ASSERTION(mDocShell, "Redraw with no canvas element or docshell!"); - return NS_OK; - } - - nsSVGEffects::InvalidateDirectRenderingObservers(mCanvasElement); - - mCanvasElement->InvalidateCanvasContent(&r); - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::RedrawUser(const gfxRect& r) -{ - if (mIsEntireFrameInvalid) { - ++mInvalidateCount; - return NS_OK; - } - - return Redraw(mThebes->UserToDevice(r)); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetDimensions(int32_t width, int32_t height) -{ - Initialize(NULL, width, height); - return NS_OK; -} - -void -nsCanvasRenderingContext2D::Initialize(nsIDocShell *docShell, int32_t width, int32_t height) -{ - Reset(); - - NS_ASSERTION(!docShell ^ !mCanvasElement, "Cannot set both docshell and canvas element"); - mDocShell = docShell; - - mWidth = width; - mHeight = height; - - mResetLayer = true; - mValid = true; - mSurfaceCreated = false; - - // set up the initial canvas defaults - mStyleStack.Clear(); - mSaveCount = 0; - - ContextState *state = mStyleStack.AppendElement(); - state->globalAlpha = 1.0; - - state->colorStyles[STYLE_FILL] = NS_RGB(0,0,0); - state->colorStyles[STYLE_STROKE] = NS_RGB(0,0,0); - state->colorStyles[STYLE_SHADOW] = NS_RGBA(0,0,0,0); - DirtyAllStyles(); - - // always force a redraw, because if the surface dimensions were reset - // then the surface became cleared, and we need to redraw everything. - Redraw(); - - return; -} - -void -nsCanvasRenderingContext2D::CreateThebes() -{ - mThebes = new gfxContext(mSurface); - mSurfaceCreated = true; - - mThebes->SetOperator(gfxContext::OPERATOR_CLEAR); - mThebes->NewPath(); - mThebes->Rectangle(gfxRect(0, 0, mWidth, mHeight)); - mThebes->Fill(); - - mThebes->SetLineWidth(1.0); - mThebes->SetOperator(gfxContext::OPERATOR_OVER); - mThebes->SetMiterLimit(10.0); - mThebes->SetLineCap(gfxContext::LINE_CAP_BUTT); - mThebes->SetLineJoin(gfxContext::LINE_JOIN_MITER); - - mThebes->NewPath(); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::InitializeWithSurface(nsIDocShell *docShell, - gfxASurface *surface, - int32_t width, - int32_t height) -{ - Initialize(docShell, width, height); - - mSurface = surface; - CreateThebes(); - return mValid ? NS_OK : NS_ERROR_OUT_OF_MEMORY; -} - -bool -nsCanvasRenderingContext2D::EnsureSurface() -{ - if (!mValid) { - return false; - } - - if (mSurface && mThebes && mSurfaceCreated) { - if (mSurface->CairoStatus()) { - return false; - } - return true; - } - - nsRefPtr surface; - - // Check that the dimensions are sane - if (gfxASurface::CheckSurfaceSize(gfxIntSize(mWidth, mHeight), 0xffff)) { - // Zero sized surfaces have problems, so just use a 1 by 1. - if (mHeight == 0 || mWidth == 0) { - mZero = true; - mHeight = 1; - mWidth = 1; - } else { - mZero = false; - } - - gfxASurface::gfxImageFormat format = GetImageFormat(); - - if (!PR_GetEnv("MOZ_CANVAS_IMAGE_SURFACE")) { - nsIDocument* ownerDoc = nullptr; - if (mCanvasElement) - ownerDoc = mCanvasElement->OwnerDoc(); - nsRefPtr layerManager = nullptr; - - if (ownerDoc) - layerManager = - nsContentUtils::PersistentLayerManagerForDocument(ownerDoc); - - if (layerManager) { - surface = layerManager->CreateOptimalSurface(gfxIntSize(mWidth, mHeight), format); - } else { - surface = gfxPlatform::GetPlatform()-> - CreateOffscreenSurface(gfxIntSize(mWidth, mHeight), gfxASurface::ContentFromFormat(format)); - } - } - - if (!surface || surface->CairoStatus()) { - // If we couldn't create a surface of the type we want, fall back - // to an image surface. This lets us handle surface sizes that - // the underlying cairo backend might not handle. - surface = new gfxImageSurface(gfxIntSize(mWidth, mHeight), format); - if (!surface || surface->CairoStatus()) { - surface = nullptr; - } - } - } - if (surface) { - if (gCanvasMemoryReporter == nullptr) { - gCanvasMemoryReporter = new NS_MEMORY_REPORTER_NAME(CanvasMemory); - NS_RegisterMemoryReporter(gCanvasMemoryReporter); - } - - gCanvasMemoryUsed += mWidth * mHeight * 4; - JSContext* context = nsContentUtils::GetCurrentJSContext(); - if (context) { - JS_updateMallocCounter(context, mWidth * mHeight * 4); - } - } else { - return false; - } - - mSurface = surface; - CreateThebes(); - - if (mSurface->CairoStatus()) { - return false; - } - return true; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetIsOpaque(bool isOpaque) -{ - if (isOpaque == mOpaque) - return NS_OK; - - mOpaque = isOpaque; - - if (mValid) { - /* If we've already been created, let SetDimensions take care of - * recreating our surface - */ - return SetDimensions(mWidth, mHeight); - } - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetIsIPC(bool isIPC) -{ - if (isIPC == mIPC) - return NS_OK; - - mIPC = isIPC; - - if (mValid) { - /* If we've already been created, let SetDimensions take care of - * recreating our surface - */ - return SetDimensions(mWidth, mHeight); - } - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::Render(gfxContext *ctx, gfxPattern::GraphicsFilter aFilter, uint32_t aFlags) -{ - nsresult rv = NS_OK; - - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - nsRefPtr pat = new gfxPattern(mSurface); - - pat->SetFilter(aFilter); - pat->SetExtend(gfxPattern::EXTEND_PAD); - - gfxContext::GraphicsOperator op = ctx->CurrentOperator(); - if (mOpaque) - ctx->SetOperator(gfxContext::OPERATOR_SOURCE); - - // XXX I don't want to use PixelSnapped here, but layout doesn't guarantee - // pixel alignment for this stuff! - ctx->NewPath(); - ctx->PixelSnappedRectangleAndSetPattern(gfxRect(0, 0, mWidth, mHeight), pat); - ctx->Fill(); - - if (mOpaque) - ctx->SetOperator(op); - - if (!(aFlags & RenderFlagPremultAlpha)) { - nsRefPtr curSurface = ctx->CurrentSurface(); - nsRefPtr gis = curSurface->GetAsImageSurface(); - NS_ABORT_IF_FALSE(gis, "If non-premult alpha, must be able to get image surface!"); - - gfxUtils::UnpremultiplyImageSurface(gis); - } - - return rv; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetInputStream(const char *aMimeType, - const PRUnichar *aEncoderOptions, - nsIInputStream **aStream) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - nsresult rv; - const char encoderPrefix[] = "@mozilla.org/image/encoder;2?type="; - nsAutoArrayPtr conid(new (std::nothrow) char[strlen(encoderPrefix) + strlen(aMimeType) + 1]); - - if (!conid) - return NS_ERROR_OUT_OF_MEMORY; - - strcpy(conid, encoderPrefix); - strcat(conid, aMimeType); - - nsCOMPtr encoder = do_CreateInstance(conid); - if (!encoder) - return NS_ERROR_FAILURE; - - nsAutoArrayPtr imageBuffer(new (std::nothrow) uint8_t[mWidth * mHeight * 4]); - if (!imageBuffer) - return NS_ERROR_OUT_OF_MEMORY; - - nsRefPtr imgsurf = new gfxImageSurface(imageBuffer.get(), - gfxIntSize(mWidth, mHeight), - mWidth * 4, - gfxASurface::ImageFormatARGB32); - - if (!imgsurf || imgsurf->CairoStatus()) - return NS_ERROR_FAILURE; - - nsRefPtr ctx = new gfxContext(imgsurf); - - if (!ctx || ctx->HasError()) - return NS_ERROR_FAILURE; - - ctx->SetOperator(gfxContext::OPERATOR_SOURCE); - ctx->SetSource(mSurface, gfxPoint(0, 0)); - ctx->Paint(); - - rv = encoder->InitFromData(imageBuffer.get(), - mWidth * mHeight * 4, mWidth, mHeight, mWidth * 4, - imgIEncoder::INPUT_FORMAT_HOSTARGB, - nsDependentString(aEncoderOptions)); - NS_ENSURE_SUCCESS(rv, rv); - - return CallQueryInterface(encoder, aStream); -} - -gfxASurface::gfxImageFormat -nsCanvasRenderingContext2D::GetImageFormat() const -{ - gfxASurface::gfxImageFormat format = gfxASurface::ImageFormatARGB32; - - if (mOpaque) - format = gfxASurface::ImageFormatRGB24; - - return format; -} - -// -// nsCanvasRenderingContext2D impl -// - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetCanvas(nsIDOMHTMLCanvasElement **canvas) -{ - if (mCanvasElement) { - NS_IF_ADDREF(*canvas = mCanvasElement->GetOriginalCanvas()); - } - - return NS_OK; -} - -// -// state -// - -NS_IMETHODIMP -nsCanvasRenderingContext2D::MozSave() -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - ContextState state = CurrentState(); - mStyleStack.AppendElement(state); - mThebes->Save(); - mSaveCount++; - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::MozRestore() -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (mSaveCount == 0) - return NS_OK; - - mStyleStack.RemoveElementAt(mSaveCount); - mThebes->Restore(); - - mLastStyle = STYLE_MAX; - DirtyAllStyles(); - - mSaveCount--; - return NS_OK; -} - -// -// transformations -// - -NS_IMETHODIMP -nsCanvasRenderingContext2D::Scale(float x, float y) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (!FloatValidate(x,y)) - return NS_OK; - - mThebes->Scale(x, y); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::Rotate(float angle) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (!FloatValidate(angle)) - return NS_OK; - - mThebes->Rotate(angle); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::Translate(float x, float y) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (!FloatValidate(x,y)) - return NS_OK; - - mThebes->Translate(gfxPoint(x, y)); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::Transform(float m11, float m12, float m21, float m22, float dx, float dy) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (!FloatValidate(m11,m12,m21,m22,dx,dy)) - return NS_OK; - - gfxMatrix matrix(m11, m12, m21, m22, dx, dy); - mThebes->Multiply(matrix); - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetTransform(float m11, float m12, float m21, float m22, float dx, float dy) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (!FloatValidate(m11,m12,m21,m22,dx,dy)) - return NS_OK; - - gfxMatrix matrix(m11, m12, m21, m22, dx, dy); - mThebes->SetMatrix(matrix); - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetMozCurrentTransform(JSContext* cx, - const jsval& matrix) -{ - nsresult rv; - gfxMatrix newCTM; - - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (!JSValToMatrix(cx, matrix, &newCTM, &rv)) { - return rv; - } - - mThebes->SetMatrix(newCTM); - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetMozCurrentTransform(JSContext* cx, - jsval* matrix) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - return MatrixToJSVal(mThebes->CurrentMatrix(), cx, matrix); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetMozCurrentTransformInverse(JSContext* cx, - const jsval& matrix) -{ - nsresult rv; - gfxMatrix newCTMInverse; - - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (!JSValToMatrix(cx, matrix, &newCTMInverse, &rv)) { - return rv; - } - - // XXX ERRMSG we need to report an error to developers here! (bug 329026) - if (!newCTMInverse.IsSingular()) { - mThebes->SetMatrix(newCTMInverse.Invert()); - } - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetMozCurrentTransformInverse(JSContext* cx, - jsval* matrix) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - gfxMatrix ctm = mThebes->CurrentMatrix(); - - if (!mThebes->CurrentMatrix().IsSingular()) { - ctm.Invert(); - } else { - double NaN = JSVAL_TO_DOUBLE(JS_GetNaNValue(cx)); - ctm = gfxMatrix(NaN, NaN, NaN, NaN, NaN, NaN); - } - - return MatrixToJSVal(ctm, cx, matrix); -} - -// -// colors -// - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetGlobalAlpha(float aGlobalAlpha) -{ - if (!FloatValidate(aGlobalAlpha) || aGlobalAlpha < 0.0 || aGlobalAlpha > 1.0) - return NS_OK; - - CurrentState().globalAlpha = aGlobalAlpha; - DirtyAllStyles(); - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetGlobalAlpha(float *aGlobalAlpha) -{ - *aGlobalAlpha = CurrentState().globalAlpha; - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetStrokeStyle(nsIVariant *aValue) -{ - if (!aValue) - return NS_ERROR_FAILURE; - - nsString str; - - nsresult rv; - uint16_t vtype; - rv = aValue->GetDataType(&vtype); - NS_ENSURE_SUCCESS(rv, rv); - - if (vtype == nsIDataType::VTYPE_INTERFACE || - vtype == nsIDataType::VTYPE_INTERFACE_IS) - { - nsIID *iid; - nsCOMPtr sup; - rv = aValue->GetAsInterface(&iid, getter_AddRefs(sup)); - NS_ENSURE_SUCCESS(rv, rv); - if (iid) - NS_Free(iid); - - str.SetIsVoid(true); - return SetStrokeStyle_multi(str, sup); - } - - rv = aValue->GetAsAString(str); - NS_ENSURE_SUCCESS(rv, rv); - - return SetStrokeStyle_multi(str, nullptr); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetStrokeStyle(nsIVariant **aResult) -{ - nsCOMPtr wv = do_CreateInstance(NS_VARIANT_CONTRACTID); - - nsCOMPtr sup; - nsString str; - int32_t t; - nsresult rv = GetStrokeStyle_multi(str, getter_AddRefs(sup), &t); - NS_ENSURE_SUCCESS(rv, rv); - - if (t == CMG_STYLE_STRING) { - rv = wv->SetAsAString(str); - } else if (t == CMG_STYLE_PATTERN) { - rv = wv->SetAsInterface(NS_GET_IID(nsIDOMCanvasPattern), - sup); - } else if (t == CMG_STYLE_GRADIENT) { - rv = wv->SetAsInterface(NS_GET_IID(nsIDOMCanvasGradient), - sup); - } else { - NS_ERROR("Unknown type from GetStroke/FillStyle_multi!"); - return NS_ERROR_FAILURE; - } - NS_ENSURE_SUCCESS(rv, rv); - - NS_IF_ADDREF(*aResult = wv.get()); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetFillStyle(nsIVariant *aValue) -{ - if (!aValue) - return NS_ERROR_FAILURE; - - nsString str; - nsresult rv; - uint16_t vtype; - rv = aValue->GetDataType(&vtype); - NS_ENSURE_SUCCESS(rv, rv); - - if (vtype == nsIDataType::VTYPE_INTERFACE || - vtype == nsIDataType::VTYPE_INTERFACE_IS) - { - nsIID *iid; - nsCOMPtr sup; - rv = aValue->GetAsInterface(&iid, getter_AddRefs(sup)); - NS_ENSURE_SUCCESS(rv, rv); - - str.SetIsVoid(true); - return SetFillStyle_multi(str, sup); - } - - rv = aValue->GetAsAString(str); - NS_ENSURE_SUCCESS(rv, rv); - - return SetFillStyle_multi(str, nullptr); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetFillStyle(nsIVariant **aResult) -{ - nsCOMPtr wv = do_CreateInstance(NS_VARIANT_CONTRACTID); - - nsCOMPtr sup; - nsString str; - int32_t t; - nsresult rv = GetFillStyle_multi(str, getter_AddRefs(sup), &t); - NS_ENSURE_SUCCESS(rv, rv); - - if (t == CMG_STYLE_STRING) { - rv = wv->SetAsAString(str); - } else if (t == CMG_STYLE_PATTERN) { - rv = wv->SetAsInterface(NS_GET_IID(nsIDOMCanvasPattern), - sup); - } else if (t == CMG_STYLE_GRADIENT) { - rv = wv->SetAsInterface(NS_GET_IID(nsIDOMCanvasGradient), - sup); - } else { - NS_ERROR("Unknown type from GetStroke/FillStyle_multi!"); - return NS_ERROR_FAILURE; - } - NS_ENSURE_SUCCESS(rv, rv); - - NS_IF_ADDREF(*aResult = wv.get()); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetStrokeStyle_multi(const nsAString& aStr, nsISupports *aInterface) -{ - return SetStyleFromStringOrInterface(aStr, aInterface, STYLE_STROKE); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetStrokeStyle_multi(nsAString& aStr, nsISupports **aInterface, int32_t *aType) -{ - return GetStyleAsStringOrInterface(aStr, aInterface, aType, STYLE_STROKE); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetFillStyle_multi(const nsAString& aStr, nsISupports *aInterface) -{ - return SetStyleFromStringOrInterface(aStr, aInterface, STYLE_FILL); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetFillStyle_multi(nsAString& aStr, nsISupports **aInterface, int32_t *aType) -{ - return GetStyleAsStringOrInterface(aStr, aInterface, aType, STYLE_FILL); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetMozFillRule(const nsAString& aString) -{ - gfxContext::FillRule rule; - - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (aString.EqualsLiteral("evenodd")) - rule = gfxContext::FILL_RULE_EVEN_ODD; - else if (aString.EqualsLiteral("nonzero")) - rule = gfxContext::FILL_RULE_WINDING; - else - // XXX ERRMSG we need to report an error to developers here! (bug 329026) - return NS_OK; - - mThebes->SetFillRule(rule); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetMozFillRule(nsAString& aString) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - switch (mThebes->CurrentFillRule()) { - case gfxContext::FILL_RULE_WINDING: - aString.AssignLiteral("nonzero"); break; - case gfxContext::FILL_RULE_EVEN_ODD: - aString.AssignLiteral("evenodd"); break; - } - return NS_OK; -} - -// -// gradients and patterns -// -NS_IMETHODIMP -nsCanvasRenderingContext2D::CreateLinearGradient(float x0, float y0, float x1, float y1, - nsIDOMCanvasGradient **_retval) -{ - if (!FloatValidate(x0,y0,x1,y1)) - return NS_ERROR_DOM_NOT_SUPPORTED_ERR; - - nsRefPtr gradpat = new gfxPattern(x0, y0, x1, y1); - if (!gradpat) - return NS_ERROR_OUT_OF_MEMORY; - - nsRefPtr grad = new nsCanvasGradient(gradpat); - if (!grad) - return NS_ERROR_OUT_OF_MEMORY; - - *_retval = grad.forget().get(); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::CreateRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, - nsIDOMCanvasGradient **_retval) -{ - if (!FloatValidate(x0,y0,r0,x1,y1,r1)) - return NS_ERROR_DOM_NOT_SUPPORTED_ERR; - - if (r0 < 0.0 || r1 < 0.0) - return NS_ERROR_DOM_INDEX_SIZE_ERR; - - nsRefPtr gradpat = new gfxPattern(x0, y0, r0, x1, y1, r1); - if (!gradpat) - return NS_ERROR_OUT_OF_MEMORY; - - nsRefPtr grad = new nsCanvasGradient(gradpat); - if (!grad) - return NS_ERROR_OUT_OF_MEMORY; - - *_retval = grad.forget().get(); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::CreatePattern(nsIDOMHTMLElement *image, - const nsAString& repeat, - nsIDOMCanvasPattern **_retval) -{ - nsCOMPtr content = do_QueryInterface(image); - if (!content) { - return NS_ERROR_DOM_TYPE_MISMATCH_ERR; - } - - gfxPattern::GraphicsExtend extend; - if (repeat.IsEmpty() || repeat.EqualsLiteral("repeat")) { - extend = gfxPattern::EXTEND_REPEAT; - } else if (repeat.EqualsLiteral("repeat-x")) { - // XX - extend = gfxPattern::EXTEND_REPEAT; - } else if (repeat.EqualsLiteral("repeat-y")) { - // XX - extend = gfxPattern::EXTEND_REPEAT; - } else if (repeat.EqualsLiteral("no-repeat")) { - extend = gfxPattern::EXTEND_NONE; - } else { - // XXX ERRMSG we need to report an error to developers here! (bug 329026) - return NS_ERROR_DOM_SYNTAX_ERR; - } - - nsHTMLCanvasElement* canvas = nsHTMLCanvasElement::FromContent(content); - if (canvas) { - nsIntSize size = canvas->GetSize(); - if (size.width == 0 || size.height == 0) { - return NS_ERROR_DOM_INVALID_STATE_ERR; - } - } - - // The canvas spec says that createPattern should use the first frame - // of animated images - nsLayoutUtils::SurfaceFromElementResult res = - nsLayoutUtils::SurfaceFromElement(content->AsElement(), - nsLayoutUtils::SFE_WANT_FIRST_FRAME | nsLayoutUtils::SFE_WANT_NEW_SURFACE); - if (!res.mSurface) - return NS_ERROR_NOT_AVAILABLE; - - nsRefPtr thebespat = new gfxPattern(res.mSurface); - - thebespat->SetExtend(extend); - - nsRefPtr pat = new nsCanvasPattern(thebespat, res.mPrincipal, - res.mIsWriteOnly, - res.mCORSUsed); - *_retval = pat.forget().get(); - return NS_OK; -} - -// -// shadows -// -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetShadowOffsetX(float x) -{ - if (!FloatValidate(x)) - return NS_OK; - - CurrentState().shadowOffset.x = x; - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetShadowOffsetX(float *x) -{ - *x = static_cast(CurrentState().shadowOffset.x); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetShadowOffsetY(float y) -{ - if (!FloatValidate(y)) - return NS_OK; - - CurrentState().shadowOffset.y = y; - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetShadowOffsetY(float *y) -{ - *y = static_cast(CurrentState().shadowOffset.y); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetShadowBlur(float blur) -{ - if (!FloatValidate(blur) || blur < 0.0) - return NS_OK; - - CurrentState().shadowBlur = blur; - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetShadowBlur(float *blur) -{ - *blur = CurrentState().shadowBlur; - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D:: SetMozShadowColor(const nsAString& aColor) -{ - nscolor color; - if (!ParseColor(aColor, &color)) { - return NS_OK; - } - - CurrentState().SetColorStyle(STYLE_SHADOW, color); - - mDirtyStyle[STYLE_SHADOW] = true; - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetMozShadowColor(nsAString& color) -{ - StyleColorToString(CurrentState().colorStyles[STYLE_SHADOW], color); - - return NS_OK; -} - -static const gfxFloat SIGMA_MAX = 100; - -gfxContext* -nsCanvasRenderingContext2D::ShadowInitialize(const gfxRect& extents, gfxAlphaBoxBlur& blur) -{ - gfxIntSize blurRadius; - - float shadowBlur = CurrentState().shadowBlur; - gfxFloat sigma = shadowBlur / 2; - // limit to avoid overly huge temp images - if (sigma > SIGMA_MAX) - sigma = SIGMA_MAX; - blurRadius = gfxAlphaBoxBlur::CalculateBlurRadius(gfxPoint(sigma, sigma)); - - // calculate extents - gfxRect drawExtents = extents; - - // intersect with clip to avoid making overly huge temp images - gfxMatrix matrix = mThebes->CurrentMatrix(); - mThebes->IdentityMatrix(); - gfxRect clipExtents = mThebes->GetClipExtents(); - mThebes->SetMatrix(matrix); - // outset by the blur radius so that blurs can leak onto the canvas even - // when the shape is outside the clipping area - clipExtents.Inflate(blurRadius.width, blurRadius.height); - drawExtents = drawExtents.Intersect(clipExtents - CurrentState().shadowOffset); - - gfxContext* ctx = blur.Init(drawExtents, gfxIntSize(0,0), blurRadius, nullptr, nullptr); - - if (!ctx) - return nullptr; - - return ctx; -} - -void -nsCanvasRenderingContext2D::ShadowFinalize(gfxAlphaBoxBlur& blur) -{ - if (!EnsureSurface()) - return; - - ApplyStyle(STYLE_SHADOW); - // canvas matrix was already applied, don't apply it twice, but do - // apply the shadow offset - gfxMatrix matrix = mThebes->CurrentMatrix(); - mThebes->IdentityMatrix(); - mThebes->Translate(CurrentState().shadowOffset); - - blur.Paint(mThebes); - mThebes->SetMatrix(matrix); -} - -nsresult -nsCanvasRenderingContext2D::DrawPath(Style style, gfxRect *dirtyRect) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - bool doUseIntermediateSurface = false; - - if (mSurface->GetType() == gfxASurface::SurfaceTypeD2D) { - if (style != STYLE_FILL) { - // D2D does all operators correctly even if transparent areas of SOURCE - // affect dest. We need to use an intermediate surface for STROKE because - // we can't clip to the actual stroke shape easily, but prefer a geometric - // clip over an intermediate surface for a FILL. - doUseIntermediateSurface = NeedIntermediateSurfaceToHandleGlobalAlpha(style); - } - } else { - /* - * Need an intermediate surface when: - * - globalAlpha != 1 and gradients/patterns are used (need to paint_with_alpha) - * - certain operators are used - */ - doUseIntermediateSurface = NeedToUseIntermediateSurface() || - NeedIntermediateSurfaceToHandleGlobalAlpha(style); - } - - bool doDrawShadow = NeedToDrawShadow(); - - // Clear the surface if we need to simulate unbounded SOURCE operator - ClearSurfaceForUnboundedSource(); - - if (doDrawShadow) { - gfxMatrix matrix = mThebes->CurrentMatrix(); - mThebes->IdentityMatrix(); - - // calculate extents of path - gfxRect drawExtents; - if (style == STYLE_FILL) - drawExtents = mThebes->GetUserFillExtent(); - else // STYLE_STROKE - drawExtents = mThebes->GetUserStrokeExtent(); - - mThebes->SetMatrix(matrix); - - gfxAlphaBoxBlur blur; - - // no need for a ref here, the blur owns the context - gfxContext* ctx = ShadowInitialize(drawExtents, blur); - if (ctx) { - ApplyStyle(style, false); - CopyContext(ctx, mThebes); - ctx->SetOperator(gfxContext::OPERATOR_SOURCE); - - if (style == STYLE_FILL) - ctx->Fill(); - else - ctx->Stroke(); - - ShadowFinalize(blur); - } - } - - if (doUseIntermediateSurface) { - nsRefPtr path = mThebes->CopyPath(); - // if the path didn't copy correctly then we can't restore it, so bail - if (!path) - return NS_ERROR_FAILURE; - - // draw onto a pushed group - mThebes->PushGroup(gfxASurface::CONTENT_COLOR_ALPHA); - - // XXX for some reason clipping messes up the path when push/popping - // copying the path seems to fix it, for unknown reasons - mThebes->NewPath(); - mThebes->AppendPath(path); - - // don't want operators to be applied twice, - if (mSurface->GetType() != gfxASurface::SurfaceTypeD2D) { - mThebes->SetOperator(gfxContext::OPERATOR_SOURCE); - } else { - // In the case of D2D OPERATOR_OVER is much faster. So we can just - // use that since it's the same as SOURCE for a transparent - // destinations. It would be nice if cairo backends could make this - // optimization internally but I see no very good way of doing this. - mThebes->SetOperator(gfxContext::OPERATOR_OVER); - } - } - - ApplyStyle(style); - - if (style == STYLE_FILL) { - if (!doUseIntermediateSurface && - CurrentState().globalAlpha != 1.0 && - !CurrentState().StyleIsColor(style)) - { - mThebes->Clip(); - mThebes->Paint(CurrentState().globalAlpha); - } else { - mThebes->Fill(); - } - } else - mThebes->Stroke(); - - // XXX do some more work to calculate the extents of shadows - // XXX handle stroke extents - if (dirtyRect && style == STYLE_FILL && !doDrawShadow) { - *dirtyRect = mThebes->GetUserPathExtent(); - } - - if (doUseIntermediateSurface) { - mThebes->PopGroupToSource(); - DirtyAllStyles(); - - mThebes->Paint(CurrentState().StyleIsColor(style) ? 1.0 : CurrentState().globalAlpha); - } - - if (dirtyRect) { - if (style != STYLE_FILL || doDrawShadow) { - // just use the clip extents - *dirtyRect = mThebes->GetClipExtents(); - } - } - - return NS_OK; -} - -// -// rects -// - -NS_IMETHODIMP -nsCanvasRenderingContext2D::ClearRect(float x, float y, float w, float h) -{ - if (!mSurfaceCreated) - return NS_OK; - - if (!FloatValidate(x,y,w,h)) - return NS_OK; - - PathAutoSaveRestore pathSR(this); - gfxContextAutoSaveRestore autoSR(mThebes); - - mThebes->SetOperator(gfxContext::OPERATOR_CLEAR); - mThebes->NewPath(); - mThebes->Rectangle(gfxRect(x, y, w, h)); - mThebes->Fill(); - - return RedrawUser(mThebes->GetUserPathExtent()); -} - -nsresult -nsCanvasRenderingContext2D::DrawRect(const gfxRect& rect, Style style) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (!FloatValidate(rect.X(), rect.Y(), rect.Width(), rect.Height())) - return NS_OK; - - PathAutoSaveRestore pathSR(this); - - mThebes->NewPath(); - mThebes->Rectangle(rect); - - gfxRect dirty; - nsresult rv = DrawPath(style, &dirty); - if (NS_FAILED(rv)) - return rv; - - return RedrawUser(dirty); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::FillRect(float x, float y, float w, float h) -{ - return DrawRect(gfxRect(x, y, w, h), STYLE_FILL); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::StrokeRect(float x, float y, float w, float h) -{ - if (w == 0.f && h == 0.f) { - return NS_OK; - } - return DrawRect(gfxRect(x, y, w, h), STYLE_STROKE); -} - -// -// path bits -// - -NS_IMETHODIMP -nsCanvasRenderingContext2D::MozBeginPath() -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - mHasPath = false; - mThebes->NewPath(); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::MozClosePath() -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - mThebes->ClosePath(); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::MozFill() -{ - gfxRect dirty; - nsresult rv = DrawPath(STYLE_FILL, &dirty); - if (NS_FAILED(rv)) - return rv; - return RedrawUser(dirty); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::MozStroke() -{ - gfxRect dirty; - nsresult rv = DrawPath(STYLE_STROKE, &dirty); - if (NS_FAILED(rv)) - return rv; - return RedrawUser(dirty); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::MozClip() -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - mThebes->Clip(); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::MoveTo(float x, float y) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (!FloatValidate(x,y)) - return NS_OK; - - mHasPath = true; - mThebes->MoveTo(gfxPoint(x, y)); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::LineTo(float x, float y) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (!FloatValidate(x,y)) - return NS_OK; - - mHasPath = true; - mThebes->LineTo(gfxPoint(x, y)); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::QuadraticCurveTo(float cpx, float cpy, float x, float y) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (!FloatValidate(cpx,cpy,x,y)) - return NS_OK; - - // we will always have a current point, since beginPath forces - // a moveto(0,0) - gfxPoint c = mThebes->CurrentPoint(); - gfxPoint p(x,y); - gfxPoint cp(cpx, cpy); - - mHasPath = true; - mThebes->CurveTo((c+cp*2)/3.0, (p+cp*2)/3.0, p); - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::BezierCurveTo(float cp1x, float cp1y, - float cp2x, float cp2y, - float x, float y) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (!FloatValidate(cp1x,cp1y,cp2x,cp2y,x,y)) - return NS_OK; - - mHasPath = true; - mThebes->CurveTo(gfxPoint(cp1x, cp1y), - gfxPoint(cp2x, cp2y), - gfxPoint(x, y)); - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::ArcTo(float x1, float y1, float x2, float y2, float radius) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (!FloatValidate(x1,y1,x2,y2,radius)) - return NS_OK; - - if (radius < 0) - return NS_ERROR_DOM_INDEX_SIZE_ERR; - - mHasPath = true; - - gfxPoint p0 = mThebes->CurrentPoint(); - - double dir, a2, b2, c2, cosx, sinx, d, anx, any, bnx, bny, x3, y3, x4, y4, cx, cy, angle0, angle1; - bool anticlockwise; - - if ((x1 == p0.x && y1 == p0.y) || (x1 == x2 && y1 == y2) || radius == 0) { - mThebes->LineTo(gfxPoint(x1, y1)); - return NS_OK; - } - - dir = (x2-x1)*(p0.y-y1) + (y2-y1)*(x1-p0.x); - if (dir == 0) { - mThebes->LineTo(gfxPoint(x1, y1)); - return NS_OK; - } - - a2 = (p0.x-x1)*(p0.x-x1) + (p0.y-y1)*(p0.y-y1); - b2 = (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2); - c2 = (p0.x-x2)*(p0.x-x2) + (p0.y-y2)*(p0.y-y2); - cosx = (a2+b2-c2)/(2*sqrt(a2*b2)); - - sinx = sqrt(1 - cosx*cosx); - d = radius / ((1 - cosx) / sinx); - - anx = (x1-p0.x) / sqrt(a2); - any = (y1-p0.y) / sqrt(a2); - bnx = (x1-x2) / sqrt(b2); - bny = (y1-y2) / sqrt(b2); - x3 = x1 - anx*d; - y3 = y1 - any*d; - x4 = x1 - bnx*d; - y4 = y1 - bny*d; - anticlockwise = (dir < 0); - cx = x3 + any*radius*(anticlockwise ? 1 : -1); - cy = y3 - anx*radius*(anticlockwise ? 1 : -1); - angle0 = atan2((y3-cy), (x3-cx)); - angle1 = atan2((y4-cy), (x4-cx)); - - mThebes->LineTo(gfxPoint(x3, y3)); - - if (anticlockwise) - mThebes->NegativeArc(gfxPoint(cx, cy), radius, angle0, angle1); - else - mThebes->Arc(gfxPoint(cx, cy), radius, angle0, angle1); - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::Arc(float x, float y, float r, float startAngle, float endAngle, bool ccw) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (!FloatValidate(x,y,r,startAngle,endAngle)) - return NS_OK; - - if (r < 0.0) - return NS_ERROR_DOM_INDEX_SIZE_ERR; - - gfxPoint p(x,y); - - mHasPath = true; - if (ccw) - mThebes->NegativeArc(p, r, startAngle, endAngle); - else - mThebes->Arc(p, r, startAngle, endAngle); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::Rect(float x, float y, float w, float h) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (!FloatValidate(x,y,w,h)) - return NS_OK; - - mHasPath = true; - mThebes->Rectangle(gfxRect(x, y, w, h)); - return NS_OK; -} - -// -// text -// - -/** - * Helper function for SetFont that creates a style rule for the given font. - * @param aFont The CSS font string - * @param aNode The canvas element - * @param aResult Pointer in which to place the new style rule. - * @remark Assumes all pointer arguments are non-null. - */ -static nsresult -CreateFontStyleRule(const nsAString& aFont, - nsINode* aNode, - css::StyleRule** aResult) -{ - nsRefPtr rule; - bool changed; - - nsIPrincipal* principal = aNode->NodePrincipal(); - nsIDocument* document = aNode->OwnerDoc(); - - nsIURI* docURL = document->GetDocumentURI(); - nsIURI* baseURL = document->GetDocBaseURI(); - - // Pass the CSS Loader object to the parser, to allow parser error reports - // to include the outer window ID. - nsCSSParser parser(document->CSSLoader()); - - nsresult rv = parser.ParseStyleAttribute(EmptyString(), docURL, baseURL, - principal, getter_AddRefs(rule)); - if (NS_FAILED(rv)) - return rv; - - rv = parser.ParseProperty(eCSSProperty_font, aFont, docURL, baseURL, - principal, rule->GetDeclaration(), &changed, - false); - if (NS_FAILED(rv)) - return rv; - - rv = parser.ParseProperty(eCSSProperty_line_height, - NS_LITERAL_STRING("normal"), docURL, baseURL, - principal, rule->GetDeclaration(), &changed, - false); - if (NS_FAILED(rv)) - return rv; - - rule->RuleMatched(); - - rule.forget(aResult); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetMozFont(const nsAString& font) -{ - nsresult rv; - - /* - * If font is defined with relative units (e.g. ems) and the parent - * style context changes in between calls, setting the font to the - * same value as previous could result in a different computed value, - * so we cannot have the optimization where we check if the new font - * string is equal to the old one. - */ - - if (!mCanvasElement && !mDocShell) { - NS_WARNING("Canvas element must be non-null or a docshell must be provided"); - return NS_ERROR_FAILURE; - } - - nsIPresShell* presShell = GetPresShell(); - if (!presShell) - return NS_ERROR_FAILURE; - nsIDocument* document = presShell->GetDocument(); - - nsCOMArray rules; - - nsRefPtr rule; - rv = CreateFontStyleRule(font, document, getter_AddRefs(rule)); - if (NS_FAILED(rv)) - return rv; - - css::Declaration *declaration = rule->GetDeclaration(); - // The easiest way to see whether we got a syntax error or whether - // we got 'inherit' or 'initial' is to look at font-size-adjust, - // which the shorthand resets to either 'none' or - // '-moz-system-font'. - // We know the declaration is not !important, so we can use - // GetNormalBlock(). - const nsCSSValue *fsaVal = - declaration->GetNormalBlock()->ValueFor(eCSSProperty_font_size_adjust); - if (!fsaVal || (fsaVal->GetUnit() != eCSSUnit_None && - fsaVal->GetUnit() != eCSSUnit_System_Font)) { - // We got an all-property value or a syntax error. The spec says - // this value must be ignored. - return NS_OK; - } - - rules.AppendObject(rule); - - nsStyleSet* styleSet = presShell->StyleSet(); - - // have to get a parent style context for inherit-like relative - // values (2em, bolder, etc.) - nsRefPtr parentContext; - - if (mCanvasElement && mCanvasElement->IsInDoc()) { - // inherit from the canvas element - parentContext = nsComputedDOMStyle::GetStyleContextForElement( - mCanvasElement, - nullptr, - presShell); - } else { - // otherwise inherit from default - nsRefPtr parentRule; - rv = CreateFontStyleRule(kDefaultFontStyle, - document, - getter_AddRefs(parentRule)); - if (NS_FAILED(rv)) - return rv; - nsCOMArray parentRules; - parentRules.AppendObject(parentRule); - parentContext = styleSet->ResolveStyleForRules(nullptr, parentRules); - } - - if (!parentContext) - return NS_ERROR_FAILURE; - - nsRefPtr sc = - styleSet->ResolveStyleForRules(parentContext, rules); - if (!sc) - return NS_ERROR_FAILURE; - const nsStyleFont* fontStyle = sc->GetStyleFont(); - - NS_ASSERTION(fontStyle, "Could not obtain font style"); - - nsIAtom* language = sc->GetStyleFont()->mLanguage; - if (!language) { - language = presShell->GetPresContext()->GetLanguageFromCharset(); - } - - // use CSS pixels instead of dev pixels to avoid being affected by page zoom - const uint32_t aupcp = nsPresContext::AppUnitsPerCSSPixel(); - // un-zoom the font size to avoid being affected by text-only zoom - // - // Purposely ignore the font size that respects the user's minimum - // font preference (fontStyle->mFont.size) in favor of the - // computed size (fontStyle->mSize). See - // https://bugzilla.mozilla.org/show_bug.cgi?id=698652. - const nscoord fontSize = nsStyleFont::UnZoomText(parentContext->PresContext(), fontStyle->mSize); - - bool printerFont = (presShell->GetPresContext()->Type() == nsPresContext::eContext_PrintPreview || - presShell->GetPresContext()->Type() == nsPresContext::eContext_Print); - - gfxFontStyle style(fontStyle->mFont.style, - fontStyle->mFont.weight, - fontStyle->mFont.stretch, - NSAppUnitsToFloatPixels(fontSize, float(aupcp)), - language, - fontStyle->mFont.sizeAdjust, - fontStyle->mFont.systemFont, - printerFont, - fontStyle->mFont.languageOverride); - - fontStyle->mFont.AddFontFeaturesToStyle(&style); - - CurrentState().fontGroup = - gfxPlatform::GetPlatform()->CreateFontGroup(fontStyle->mFont.name, - &style, - presShell->GetPresContext()->GetUserFontSet()); - NS_ASSERTION(CurrentState().fontGroup, "Could not get font group"); - - // The font getter is required to be reserialized based on what we - // parsed (including having line-height removed). (Older drafts of - // the spec required font sizes be converted to pixels, but that no - // longer seems to be required.) - declaration->GetValue(eCSSProperty_font, CurrentState().font); - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetMozFont(nsAString& font) -{ - /* will initilize the value if not set, else does nothing */ - GetCurrentFontStyle(); - - font = CurrentState().font; - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetMozTextAlign(const nsAString& ta) -{ - if (ta.EqualsLiteral("start")) - CurrentState().textAlign = TEXT_ALIGN_START; - else if (ta.EqualsLiteral("end")) - CurrentState().textAlign = TEXT_ALIGN_END; - else if (ta.EqualsLiteral("left")) - CurrentState().textAlign = TEXT_ALIGN_LEFT; - else if (ta.EqualsLiteral("right")) - CurrentState().textAlign = TEXT_ALIGN_RIGHT; - else if (ta.EqualsLiteral("center")) - CurrentState().textAlign = TEXT_ALIGN_CENTER; - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetMozTextAlign(nsAString& ta) -{ - switch (CurrentState().textAlign) - { - case TEXT_ALIGN_START: - ta.AssignLiteral("start"); - break; - case TEXT_ALIGN_END: - ta.AssignLiteral("end"); - break; - case TEXT_ALIGN_LEFT: - ta.AssignLiteral("left"); - break; - case TEXT_ALIGN_RIGHT: - ta.AssignLiteral("right"); - break; - case TEXT_ALIGN_CENTER: - ta.AssignLiteral("center"); - break; - } - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetMozTextBaseline(const nsAString& tb) -{ - if (tb.EqualsLiteral("top")) - CurrentState().textBaseline = TEXT_BASELINE_TOP; - else if (tb.EqualsLiteral("hanging")) - CurrentState().textBaseline = TEXT_BASELINE_HANGING; - else if (tb.EqualsLiteral("middle")) - CurrentState().textBaseline = TEXT_BASELINE_MIDDLE; - else if (tb.EqualsLiteral("alphabetic")) - CurrentState().textBaseline = TEXT_BASELINE_ALPHABETIC; - else if (tb.EqualsLiteral("ideographic")) - CurrentState().textBaseline = TEXT_BASELINE_IDEOGRAPHIC; - else if (tb.EqualsLiteral("bottom")) - CurrentState().textBaseline = TEXT_BASELINE_BOTTOM; - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetMozTextBaseline(nsAString& tb) -{ - switch (CurrentState().textBaseline) - { - case TEXT_BASELINE_TOP: - tb.AssignLiteral("top"); - break; - case TEXT_BASELINE_HANGING: - tb.AssignLiteral("hanging"); - break; - case TEXT_BASELINE_MIDDLE: - tb.AssignLiteral("middle"); - break; - case TEXT_BASELINE_ALPHABETIC: - tb.AssignLiteral("alphabetic"); - break; - case TEXT_BASELINE_IDEOGRAPHIC: - tb.AssignLiteral("ideographic"); - break; - case TEXT_BASELINE_BOTTOM: - tb.AssignLiteral("bottom"); - break; - } - - return NS_OK; -} - -/* - * Helper function that replaces the whitespace characters in a string - * with U+0020 SPACE. The whitespace characters are defined as U+0020 SPACE, - * U+0009 CHARACTER TABULATION (tab), U+000A LINE FEED (LF), U+000B LINE - * TABULATION, U+000C FORM FEED (FF), and U+000D CARRIAGE RETURN (CR). - * @param str The string whose whitespace characters to replace. - */ -static inline void -TextReplaceWhitespaceCharacters(nsAutoString& str) -{ - str.ReplaceChar("\x09\x0A\x0B\x0C\x0D", PRUnichar(' ')); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::FillText(const nsAString& text, float x, float y, float maxWidth) -{ - return DrawOrMeasureText(text, x, y, maxWidth, TEXT_DRAW_OPERATION_FILL, nullptr); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::StrokeText(const nsAString& text, float x, float y, float maxWidth) -{ - return DrawOrMeasureText(text, x, y, maxWidth, TEXT_DRAW_OPERATION_STROKE, nullptr); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::MeasureText(const nsAString& rawText, - nsIDOMTextMetrics** _retval) -{ - float width; - - nsresult rv = DrawOrMeasureText(rawText, 0, 0, 0, TEXT_DRAW_OPERATION_MEASURE, &width); - - if (NS_FAILED(rv)) - return rv; - - nsRefPtr textMetrics = new nsTextMetrics(width); - if (!textMetrics.get()) - return NS_ERROR_OUT_OF_MEMORY; - - *_retval = textMetrics.forget().get(); - - return NS_OK; -} - -/** - * Used for nsBidiPresUtils::ProcessText - */ -struct NS_STACK_CLASS nsCanvasBidiProcessor : public nsBidiPresUtils::BidiProcessor -{ - virtual void SetText(const PRUnichar* text, int32_t length, nsBidiDirection direction) - { - mFontgrp->UpdateFontList(); // ensure user font generation is current - mTextRun = mFontgrp->MakeTextRun(text, - length, - mThebes, - mAppUnitsPerDevPixel, - direction==NSBIDI_RTL ? gfxTextRunFactory::TEXT_IS_RTL : 0); - } - - virtual nscoord GetWidth() - { - gfxTextRun::Metrics textRunMetrics = mTextRun->MeasureText(0, - mTextRun->GetLength(), - mDoMeasureBoundingBox ? - gfxFont::TIGHT_INK_EXTENTS : - gfxFont::LOOSE_INK_EXTENTS, - mThebes, - nullptr); - - // this only measures the height; the total width is gotten from the - // the return value of ProcessText. - if (mDoMeasureBoundingBox) { - textRunMetrics.mBoundingBox.Scale(1.0 / mAppUnitsPerDevPixel); - mBoundingBox = mBoundingBox.Union(textRunMetrics.mBoundingBox); - } - - return NSToCoordRound(textRunMetrics.mAdvanceWidth); - } - - virtual void DrawText(nscoord xOffset, nscoord width) - { - gfxPoint point = mPt; - point.x += xOffset; - - // offset is given in terms of left side of string - if (mTextRun->IsRightToLeft()) { - // Bug 581092 - don't use rounded pixel width to advance to - // right-hand end of run, because this will cause different - // glyph positioning for LTR vs RTL drawing of the same - // glyph string on OS X and DWrite where textrun widths may - // involve fractional pixels. - gfxTextRun::Metrics textRunMetrics = - mTextRun->MeasureText(0, - mTextRun->GetLength(), - mDoMeasureBoundingBox ? - gfxFont::TIGHT_INK_EXTENTS : - gfxFont::LOOSE_INK_EXTENTS, - mThebes, - nullptr); - point.x += textRunMetrics.mAdvanceWidth; - // old code was: - // point.x += width * mAppUnitsPerDevPixel; - // TODO: restore this if/when we move to fractional coords - // throughout the text layout process - } - - nsRefPtr pattern = mThebes->GetPattern(); - - bool isFill = mOp == nsCanvasRenderingContext2D::TEXT_DRAW_OPERATION_FILL; - SimpleTextObjectPaint objectPaint(isFill ? pattern.get() : nullptr, - isFill ? nullptr : pattern.get(), - mThebes->CurrentMatrix()); - - mTextRun->Draw(mThebes, - point, - isFill ? gfxFont::GLYPH_FILL : gfxFont::GLYPH_STROKE, - 0, - mTextRun->GetLength(), - nullptr, - nullptr, - &objectPaint); - } - - // current text run - nsAutoPtr mTextRun; - - // pointer to the context, may not be the canvas's context - // if an intermediate surface is being used - gfxContext* mThebes; - - // position of the left side of the string, alphabetic baseline - gfxPoint mPt; - - // current font - gfxFontGroup* mFontgrp; - - // dev pixel conversion factor - uint32_t mAppUnitsPerDevPixel; - - // operation (fill or stroke) - nsCanvasRenderingContext2D::TextDrawOperation mOp; - - // union of bounding boxes of all runs, needed for shadows - gfxRect mBoundingBox; - - // true iff the bounding box should be measured - bool mDoMeasureBoundingBox; -}; - -nsresult -nsCanvasRenderingContext2D::DrawOrMeasureText(const nsAString& aRawText, - float aX, - float aY, - float aMaxWidth, - TextDrawOperation aOp, - float* aWidth) -{ - nsresult rv; - - if (!FloatValidate(aX, aY, aMaxWidth)) - return NS_ERROR_DOM_SYNTAX_ERR; - - // spec isn't clear on what should happen if aMaxWidth <= 0, so - // treat it as an invalid argument - // technically, 0 should be an invalid value as well, but 0 is the default - // arg, and there is no way to tell if the default was used - if (aMaxWidth < 0) - return NS_ERROR_INVALID_ARG; - - if (!mCanvasElement && !mDocShell) { - NS_WARNING("Canvas element must be non-null or a docshell must be provided"); - return NS_ERROR_FAILURE; - } - - nsCOMPtr presShell = GetPresShell(); - if (!presShell) - return NS_ERROR_FAILURE; - - nsIDocument* document = presShell->GetDocument(); - - // replace all the whitespace characters with U+0020 SPACE - nsAutoString textToDraw(aRawText); - TextReplaceWhitespaceCharacters(textToDraw); - - // for now, default to ltr if not in doc - bool isRTL = false; - - if (mCanvasElement && mCanvasElement->IsInDoc()) { - // try to find the closest context - nsRefPtr canvasStyle = - nsComputedDOMStyle::GetStyleContextForElement(mCanvasElement, - nullptr, - presShell); - if (!canvasStyle) - return NS_ERROR_FAILURE; - isRTL = canvasStyle->GetStyleVisibility()->mDirection == - NS_STYLE_DIRECTION_RTL; - } else { - isRTL = GET_BIDI_OPTION_DIRECTION(document->GetBidiOptions()) == IBMBIDI_TEXTDIRECTION_RTL; - } - - Style style = aOp == TEXT_DRAW_OPERATION_FILL ? STYLE_FILL : STYLE_STROKE; - - bool doDrawShadow = NeedToDrawShadow(); - bool doUseIntermediateSurface = NeedToUseIntermediateSurface() - || NeedIntermediateSurfaceToHandleGlobalAlpha(style); - - // Clear the surface if we need to simulate unbounded SOURCE operator - ClearSurfaceForUnboundedSource(); - - nsCanvasBidiProcessor processor; - - GetAppUnitsValues(&processor.mAppUnitsPerDevPixel, NULL); - processor.mPt = gfxPoint(aX, aY); - nsRefPtr ctx; - if (mThebes) { - processor.mThebes = mThebes; - } else { - ctx = presShell->GetReferenceRenderingContext(); - processor.mThebes = ctx->ThebesContext(); - } - processor.mOp = aOp; - processor.mBoundingBox = gfxRect(0, 0, 0, 0); - processor.mDoMeasureBoundingBox = doDrawShadow || !mIsEntireFrameInvalid; - - processor.mFontgrp = GetCurrentFontStyle(); - NS_ASSERTION(processor.mFontgrp, "font group is null"); - - nscoord totalWidthCoord; - - // calls bidi algo twice since it needs the full text width and the - // bounding boxes before rendering anything - nsBidi bidiEngine; - rv = nsBidiPresUtils::ProcessText(textToDraw.get(), - textToDraw.Length(), - isRTL ? NSBIDI_RTL : NSBIDI_LTR, - presShell->GetPresContext(), - processor, - nsBidiPresUtils::MODE_MEASURE, - nullptr, - 0, - &totalWidthCoord, - &bidiEngine); - if (NS_FAILED(rv)) - return rv; - - float totalWidth = float(totalWidthCoord) / processor.mAppUnitsPerDevPixel; - if (aWidth) - *aWidth = totalWidth; - - // if only measuring, don't need to do any more work - if (aOp==TEXT_DRAW_OPERATION_MEASURE) - return NS_OK; - - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - processor.mThebes = mThebes; - - // offset pt.x based on text align - gfxFloat anchorX; - - if (CurrentState().textAlign == TEXT_ALIGN_CENTER) - anchorX = .5; - else if (CurrentState().textAlign == TEXT_ALIGN_LEFT || - (!isRTL && CurrentState().textAlign == TEXT_ALIGN_START) || - (isRTL && CurrentState().textAlign == TEXT_ALIGN_END)) - anchorX = 0; - else - anchorX = 1; - - processor.mPt.x -= anchorX * totalWidth; - - // offset pt.y based on text baseline - processor.mFontgrp->UpdateFontList(); // ensure user font generation is current - NS_ASSERTION(processor.mFontgrp->FontListLength()>0, "font group contains no fonts"); - const gfxFont::Metrics& fontMetrics = processor.mFontgrp->GetFontAt(0)->GetMetrics(); - - gfxFloat anchorY; - - switch (CurrentState().textBaseline) - { - case TEXT_BASELINE_HANGING: - // fall through; best we can do with the information available - case TEXT_BASELINE_TOP: - anchorY = fontMetrics.emAscent; - break; - break; - case TEXT_BASELINE_MIDDLE: - anchorY = (fontMetrics.emAscent - fontMetrics.emDescent) * .5f; - break; - case TEXT_BASELINE_IDEOGRAPHIC: - // fall through; best we can do with the information available - case TEXT_BASELINE_ALPHABETIC: - anchorY = 0; - break; - case TEXT_BASELINE_BOTTOM: - anchorY = -fontMetrics.emDescent; - break; - } - - processor.mPt.y += anchorY; - - // correct bounding box to get it to be the correct size/position - processor.mBoundingBox.width = totalWidth; - processor.mBoundingBox.MoveBy(processor.mPt); - - processor.mPt.x *= processor.mAppUnitsPerDevPixel; - processor.mPt.y *= processor.mAppUnitsPerDevPixel; - - // if text is over aMaxWidth, then scale the text horizontally such that its - // width is precisely aMaxWidth - gfxContextAutoSaveRestore autoSR; - if (aMaxWidth > 0 && totalWidth > aMaxWidth) { - autoSR.SetContext(mThebes); - // translate the anchor point to 0, then scale and translate back - gfxPoint trans(aX, 0); - mThebes->Translate(trans); - mThebes->Scale(aMaxWidth/totalWidth, 1); - mThebes->Translate(-trans); - } - - // save the previous bounding box - gfxRect boundingBox = processor.mBoundingBox; - - // don't ever need to measure the bounding box twice - processor.mDoMeasureBoundingBox = false; - - if (doDrawShadow) { - // for some reason the box is too tight, probably rounding error - processor.mBoundingBox.Inflate(2.0); - - // this is unnecessarily big is max-width scaling is involved, but it - // will still produce correct output - gfxRect drawExtents = mThebes->UserToDevice(processor.mBoundingBox); - gfxAlphaBoxBlur blur; - - gfxContext* ctx = ShadowInitialize(drawExtents, blur); - - if (ctx) { - ApplyStyle(style, false); - CopyContext(ctx, mThebes); - ctx->SetOperator(gfxContext::OPERATOR_SOURCE); - processor.mThebes = ctx; - - rv = nsBidiPresUtils::ProcessText(textToDraw.get(), - textToDraw.Length(), - isRTL ? NSBIDI_RTL : NSBIDI_LTR, - presShell->GetPresContext(), - processor, - nsBidiPresUtils::MODE_DRAW, - nullptr, - 0, - nullptr, - &bidiEngine); - if (NS_FAILED(rv)) - return rv; - - ShadowFinalize(blur); - } - - processor.mThebes = mThebes; - } - - gfxContextPathAutoSaveRestore pathSR(mThebes, false); - - if (doUseIntermediateSurface) { - mThebes->PushGroup(gfxASurface::CONTENT_COLOR_ALPHA); - - // don't want operators to be applied twice - mThebes->SetOperator(gfxContext::OPERATOR_SOURCE); - } - - ApplyStyle(style); - - rv = nsBidiPresUtils::ProcessText(textToDraw.get(), - textToDraw.Length(), - isRTL ? NSBIDI_RTL : NSBIDI_LTR, - presShell->GetPresContext(), - processor, - nsBidiPresUtils::MODE_DRAW, - nullptr, - 0, - nullptr, - &bidiEngine); - - // this needs to be restored before function can return - if (doUseIntermediateSurface) { - mThebes->PopGroupToSource(); - DirtyAllStyles(); - } - - if (NS_FAILED(rv)) - return rv; - - if (doUseIntermediateSurface) - mThebes->Paint(CurrentState().StyleIsColor(style) ? 1.0 : CurrentState().globalAlpha); - - if (aOp == nsCanvasRenderingContext2D::TEXT_DRAW_OPERATION_FILL && !doDrawShadow) - return RedrawUser(boundingBox); - - return Redraw(); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetTextStyle(const nsAString& textStyle) -{ - // font and mozTextStyle are the same value - return SetMozFont(textStyle); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetTextStyle(nsAString& textStyle) -{ - // font and mozTextStyle are the same value - return GetMozFont(textStyle); -} - -gfxFontGroup* -nsCanvasRenderingContext2D::GetCurrentFontStyle() -{ - // use lazy initilization for the font group since it's rather expensive - if(!CurrentState().fontGroup) { - nsresult rv = SetTextStyle(kDefaultFontStyle); - if (NS_FAILED(rv)) { - gfxFontStyle style; - style.size = kDefaultFontSize; - CurrentState().fontGroup = - gfxPlatform::GetPlatform()->CreateFontGroup(kDefaultFontName, - &style, - nullptr); - if (CurrentState().fontGroup) { - CurrentState().font = kDefaultFontStyle; - rv = NS_OK; - } else { - rv = NS_ERROR_OUT_OF_MEMORY; - } - } - - NS_ASSERTION(NS_SUCCEEDED(rv), "Default canvas font is invalid"); - } - - return CurrentState().fontGroup; -} - -gfxTextRun* -nsCanvasRenderingContext2D::MakeTextRun(const PRUnichar* aText, - uint32_t aLength, - uint32_t aAppUnitsPerDevUnit, - uint32_t aFlags) -{ - gfxFontGroup* currentFontStyle = GetCurrentFontStyle(); - if (!currentFontStyle) - return nullptr; - currentFontStyle->UpdateFontList(); // ensure user font generation is current - return currentFontStyle->MakeTextRun(aText, aLength, - mThebes, aAppUnitsPerDevUnit, aFlags); -} - - -// -// line caps/joins -// -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetLineWidth(float width) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (!FloatValidate(width) || width <= 0.0) - return NS_OK; - - mThebes->SetLineWidth(width); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetLineWidth(float *width) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - gfxFloat d = mThebes->CurrentLineWidth(); - *width = static_cast(d); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetMozLineCap(const nsAString& capstyle) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - gfxContext::GraphicsLineCap cap; - - if (capstyle.EqualsLiteral("butt")) - cap = gfxContext::LINE_CAP_BUTT; - else if (capstyle.EqualsLiteral("round")) - cap = gfxContext::LINE_CAP_ROUND; - else if (capstyle.EqualsLiteral("square")) - cap = gfxContext::LINE_CAP_SQUARE; - else - // XXX ERRMSG we need to report an error to developers here! (bug 329026) - return NS_OK; - - mThebes->SetLineCap(cap); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetMozLineCap(nsAString& capstyle) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - gfxContext::GraphicsLineCap cap = mThebes->CurrentLineCap(); - - if (cap == gfxContext::LINE_CAP_BUTT) - capstyle.AssignLiteral("butt"); - else if (cap == gfxContext::LINE_CAP_ROUND) - capstyle.AssignLiteral("round"); - else if (cap == gfxContext::LINE_CAP_SQUARE) - capstyle.AssignLiteral("square"); - else - return NS_ERROR_FAILURE; - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetMozLineJoin(const nsAString& joinstyle) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - gfxContext::GraphicsLineJoin j; - - if (joinstyle.EqualsLiteral("round")) - j = gfxContext::LINE_JOIN_ROUND; - else if (joinstyle.EqualsLiteral("bevel")) - j = gfxContext::LINE_JOIN_BEVEL; - else if (joinstyle.EqualsLiteral("miter")) - j = gfxContext::LINE_JOIN_MITER; - else - // XXX ERRMSG we need to report an error to developers here! (bug 329026) - return NS_OK; - - mThebes->SetLineJoin(j); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetMozLineJoin(nsAString& joinstyle) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - gfxContext::GraphicsLineJoin j = mThebes->CurrentLineJoin(); - - if (j == gfxContext::LINE_JOIN_ROUND) - joinstyle.AssignLiteral("round"); - else if (j == gfxContext::LINE_JOIN_BEVEL) - joinstyle.AssignLiteral("bevel"); - else if (j == gfxContext::LINE_JOIN_MITER) - joinstyle.AssignLiteral("miter"); - else - return NS_ERROR_FAILURE; - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetMiterLimit(float miter) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (!FloatValidate(miter) || miter <= 0.0) - return NS_OK; - - mThebes->SetMiterLimit(miter); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetMiterLimit(float *miter) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - gfxFloat d = mThebes->CurrentMiterLimit(); - *miter = static_cast(d); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetMozDash(JSContext *cx, const jsval& patternArray) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - AutoFallibleTArray dashes; - nsresult rv = JSValToDashArray(cx, patternArray, dashes); - if (NS_SUCCEEDED(rv)) { - mThebes->SetDash(dashes.Elements(), dashes.Length(), - mThebes->CurrentDashOffset()); - } - return rv; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetMozDash(JSContext* cx, jsval* dashArray) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - AutoFallibleTArray dashes; - if (!mThebes->CurrentDash(dashes, nullptr)) { - dashes.SetLength(0); - } - return DashArrayToJSVal(dashes, cx, dashArray); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetMozDashOffset(float offset) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (!FloatValidate(offset)) { - return NS_ERROR_ILLEGAL_VALUE; - } - - AutoFallibleTArray dashes; - if (!mThebes->CurrentDash(dashes, nullptr)) { - // Either no dash is set or the cairo call failed. Either - // way, eat the error. - - // XXX ERRMSG we need to report an error to developers here! (bug 329026) - return NS_OK; - } - NS_ABORT_IF_FALSE(dashes.Length() > 0, - "CurrentDash() should have returned false"); - - mThebes->SetDash(dashes.Elements(), dashes.Length(), - gfxFloat(offset)); - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetMozDashOffset(float* offset) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - *offset = float(mThebes->CurrentDashOffset()); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::IsPointInPath(float x, float y, bool *retVal) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (!FloatValidate(x,y)) { - *retVal = false; - return NS_OK; - } - - gfxPoint pt(x, y); - *retVal = mThebes->PointInFill(mThebes->DeviceToUser(pt)); - return NS_OK; -} - -// -// image -// - -// drawImage(in HTMLImageElement image, in float dx, in float dy); -// -- render image from 0,0 at dx,dy top-left coords -// drawImage(in HTMLImageElement image, in float dx, in float dy, in float sw, in float sh); -// -- render image from 0,0 at dx,dy top-left coords clipping it to sw,sh -// drawImage(in HTMLImageElement image, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh); -// -- render the region defined by (sx,sy,sw,wh) in image-local space into the region (dx,dy,dw,dh) on the canvas - -NS_IMETHODIMP -nsCanvasRenderingContext2D::DrawImage(nsIDOMElement *imgElt, float a1, - float a2, float a3, float a4, float a5, - float a6, float a7, float a8, - uint8_t optional_argc) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - nsCOMPtr content = do_QueryInterface(imgElt); - if (!content) { - return NS_ERROR_DOM_TYPE_MISMATCH_ERR; - } - - nsHTMLCanvasElement* canvas = nsHTMLCanvasElement::FromContent(content); - if (canvas) { - nsIntSize size = canvas->GetSize(); - if (size.width == 0 || size.height == 0) { - return NS_ERROR_DOM_INVALID_STATE_ERR; - } - } - - gfxMatrix matrix; - nsRefPtr pattern; - gfxIntSize imgSize; - nsRefPtr imgsurf = - CanvasImageCache::Lookup(content->AsElement(), mCanvasElement, &imgSize); - - if (!imgsurf) { - // The canvas spec says that drawImage should draw the first frame - // of animated images - uint32_t sfeFlags = nsLayoutUtils::SFE_WANT_FIRST_FRAME; - nsLayoutUtils::SurfaceFromElementResult res = - nsLayoutUtils::SurfaceFromElement(content->AsElement(), sfeFlags); - if (!res.mSurface) { - // Spec says to silently do nothing if the element is still loading. - return res.mIsStillLoading ? NS_OK : NS_ERROR_NOT_AVAILABLE; - } - - // Force a copy if we're using drawImage with our destination - // as a source to work around some Cairo self-copy semantics issues. - if (res.mSurface == mSurface) { - sfeFlags |= nsLayoutUtils::SFE_WANT_NEW_SURFACE; - res = nsLayoutUtils::SurfaceFromElement(content->AsElement(), - sfeFlags); - if (!res.mSurface) - return NS_ERROR_NOT_AVAILABLE; - } - - imgsurf = res.mSurface.forget(); - imgSize = res.mSize; - - if (mCanvasElement) { - CanvasUtils::DoDrawImageSecurityCheck(mCanvasElement, - res.mPrincipal, - res.mIsWriteOnly, - res.mCORSUsed); - } - - if (res.mImageRequest) { - CanvasImageCache::NotifyDrawImage(content->AsElement(), mCanvasElement, - res.mImageRequest, imgsurf, imgSize); - } - } - - double sx,sy,sw,sh; - double dx,dy,dw,dh; - if (optional_argc == 0) { - dx = a1; - dy = a2; - sx = sy = 0.0; - dw = sw = (double) imgSize.width; - dh = sh = (double) imgSize.height; - } else if (optional_argc == 2) { - dx = a1; - dy = a2; - dw = a3; - dh = a4; - sx = sy = 0.0; - sw = (double) imgSize.width; - sh = (double) imgSize.height; - } else if (optional_argc == 6) { - sx = a1; - sy = a2; - sw = a3; - sh = a4; - dx = a5; - dy = a6; - dw = a7; - dh = a8; - } else { - // XXX ERRMSG we need to report an error to developers here! (bug 329026) - return NS_ERROR_INVALID_ARG; - } - - if (dw == 0.0 || dh == 0.0) { - // not really failure, but nothing to do -- - // and noone likes a divide-by-zero - return NS_OK; - } - - if (!FloatValidate(sx, sy, sw, sh) || !FloatValidate(dx, dy, dw, dh)) { - return NS_OK; - } - - // check args - if (sx < 0.0 || sy < 0.0 || - sw < 0.0 || sw > (double) imgSize.width || - sh < 0.0 || sh > (double) imgSize.height || - dw < 0.0 || dh < 0.0) - { - // XXX ERRMSG we need to report an error to developers here! (bug 329026) - return NS_ERROR_DOM_INDEX_SIZE_ERR; - } - - matrix.Translate(gfxPoint(sx, sy)); - matrix.Scale(sw/dw, sh/dh); - - pattern = new gfxPattern(imgsurf); - pattern->SetMatrix(matrix); - pattern->SetExtend(gfxPattern::EXTEND_PAD); - - if (CurrentState().imageSmoothingEnabled) - pattern->SetFilter(gfxPattern::FILTER_GOOD); - else - pattern->SetFilter(gfxPattern::FILTER_NEAREST); - - PathAutoSaveRestore pathSR(this); - - // Clear the surface if we need to simulate unbounded SOURCE operator - ClearSurfaceForUnboundedSource(); - - { - gfxContextMatrixAutoSaveRestore autoMatrixSR(mThebes); - - mThebes->Translate(gfxPoint(dx, dy)); - - gfxRect clip(0, 0, dw, dh); - - if (NeedToDrawShadow()) { - gfxRect drawExtents = mThebes->UserToDevice(clip); - gfxAlphaBoxBlur blur; - - gfxContext* ctx = ShadowInitialize(drawExtents, blur); - - if (ctx) { - CopyContext(ctx, mThebes); - ctx->SetPattern(pattern); - ctx->SetOperator(gfxContext::OPERATOR_SOURCE); - ctx->Clip(clip); - ctx->Paint(); - - ShadowFinalize(blur); - } - } - - mThebes->SetPattern(pattern); - DirtyAllStyles(); - - bool doUseIntermediateSurface = NeedToUseIntermediateSurface(); - if (doUseIntermediateSurface) { - gfxContextAutoSaveRestore autoSR(mThebes); - - // draw onto a pushed group - mThebes->PushGroup(gfxASurface::CONTENT_COLOR_ALPHA); - mThebes->Clip(clip); - - // don't want operators to be applied twice - mThebes->SetOperator(gfxContext::OPERATOR_SOURCE); - - mThebes->Paint(); - mThebes->PopGroupToSource(); - mThebes->Paint(CurrentState().globalAlpha); - } else if (CurrentState().globalAlpha == 1.0f && - mThebes->CurrentOperator() == gfxContext::OPERATOR_OVER) { - /* Direct2D isn't very good at clipping so use Fill() when we can */ - mThebes->NewPath(); - mThebes->Rectangle(clip); - mThebes->Fill(); - } else { - gfxContextAutoSaveRestore autoSR(mThebes); - - /* we need to use to clip instead of fill for globalAlpha */ - mThebes->Clip(clip); - mThebes->Paint(CurrentState().globalAlpha); - } - - RedrawUser(clip); - } - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetGlobalCompositeOperation(const nsAString& op) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - gfxContext::GraphicsOperator thebes_op; - -#define CANVAS_OP_TO_THEBES_OP(cvsop,thebesop) \ - if (op.EqualsLiteral(cvsop)) \ - thebes_op = gfxContext::OPERATOR_##thebesop; - - CANVAS_OP_TO_THEBES_OP("copy", SOURCE) - else CANVAS_OP_TO_THEBES_OP("destination-atop", DEST_ATOP) - else CANVAS_OP_TO_THEBES_OP("destination-in", DEST_IN) - else CANVAS_OP_TO_THEBES_OP("destination-out", DEST_OUT) - else CANVAS_OP_TO_THEBES_OP("destination-over", DEST_OVER) - else CANVAS_OP_TO_THEBES_OP("lighter", ADD) - else CANVAS_OP_TO_THEBES_OP("source-atop", ATOP) - else CANVAS_OP_TO_THEBES_OP("source-in", IN) - else CANVAS_OP_TO_THEBES_OP("source-out", OUT) - else CANVAS_OP_TO_THEBES_OP("source-over", OVER) - else CANVAS_OP_TO_THEBES_OP("xor", XOR) - // XXX ERRMSG we need to report an error to developers here! (bug 329026) - else return NS_OK; - -#undef CANVAS_OP_TO_THEBES_OP - - mThebes->SetOperator(thebes_op); - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetGlobalCompositeOperation(nsAString& op) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - gfxContext::GraphicsOperator thebes_op = mThebes->CurrentOperator(); - -#define CANVAS_OP_TO_THEBES_OP(cvsop,thebesop) \ - if (thebes_op == gfxContext::OPERATOR_##thebesop) \ - op.AssignLiteral(cvsop); - - CANVAS_OP_TO_THEBES_OP("copy", SOURCE) - else CANVAS_OP_TO_THEBES_OP("destination-atop", DEST_ATOP) - else CANVAS_OP_TO_THEBES_OP("destination-in", DEST_IN) - else CANVAS_OP_TO_THEBES_OP("destination-out", DEST_OUT) - else CANVAS_OP_TO_THEBES_OP("destination-over", DEST_OVER) - else CANVAS_OP_TO_THEBES_OP("lighter", ADD) - else CANVAS_OP_TO_THEBES_OP("source-atop", ATOP) - else CANVAS_OP_TO_THEBES_OP("source-in", IN) - else CANVAS_OP_TO_THEBES_OP("source-out", OUT) - else CANVAS_OP_TO_THEBES_OP("source-over", OVER) - else CANVAS_OP_TO_THEBES_OP("xor", XOR) - else return NS_ERROR_FAILURE; - -#undef CANVAS_OP_TO_THEBES_OP - - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::DrawWindow(nsIDOMWindow* aWindow, float aX, float aY, - float aW, float aH, - const nsAString& aBGColor, - uint32_t flags) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - NS_ENSURE_ARG(aWindow != nullptr); - - // protect against too-large surfaces that will cause allocation - // or overflow issues - if (!gfxASurface::CheckSurfaceSize(gfxIntSize(int32_t(aW), int32_t(aH)), - 0xffff)) - return NS_ERROR_FAILURE; - - // We can't allow web apps to call this until we fix at least the - // following potential security issues: - // -- rendering cross-domain IFRAMEs and then extracting the results - // -- rendering the user's theme and then extracting the results - // -- rendering native anonymous content (e.g., file input paths; - // scrollbars should be allowed) - if (!nsContentUtils::IsCallerTrustedForRead()) { - // not permitted to use DrawWindow - // XXX ERRMSG we need to report an error to developers here! (bug 329026) - return NS_ERROR_DOM_SECURITY_ERR; - } - - // Flush layout updates - if (!(flags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DO_NOT_FLUSH)) - nsContentUtils::FlushLayoutForTree(aWindow); - - nsRefPtr presContext; - nsCOMPtr win = do_QueryInterface(aWindow); - if (win) { - nsIDocShell* docshell = win->GetDocShell(); - if (docshell) { - docshell->GetPresContext(getter_AddRefs(presContext)); - } - } - if (!presContext) - return NS_ERROR_FAILURE; - - nscolor bgColor; - if (!ParseColor(aBGColor, &bgColor)) { - return NS_ERROR_FAILURE; - } - - nsRect r(nsPresContext::CSSPixelsToAppUnits(aX), - nsPresContext::CSSPixelsToAppUnits(aY), - nsPresContext::CSSPixelsToAppUnits(aW), - nsPresContext::CSSPixelsToAppUnits(aH)); - uint32_t renderDocFlags = (nsIPresShell::RENDER_IGNORE_VIEWPORT_SCROLLING | - nsIPresShell::RENDER_DOCUMENT_RELATIVE); - if (flags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DRAW_CARET) { - renderDocFlags |= nsIPresShell::RENDER_CARET; - } - if (flags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DRAW_VIEW) { - renderDocFlags &= ~(nsIPresShell::RENDER_IGNORE_VIEWPORT_SCROLLING | - nsIPresShell::RENDER_DOCUMENT_RELATIVE); - } - if (flags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_USE_WIDGET_LAYERS) { - renderDocFlags |= nsIPresShell::RENDER_USE_WIDGET_LAYERS; - } - if (flags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_ASYNC_DECODE_IMAGES) { - renderDocFlags |= nsIPresShell::RENDER_ASYNC_DECODE_IMAGES; - } - - nsresult rv = presContext->PresShell()-> - RenderDocument(r, renderDocFlags, bgColor, mThebes); - - // get rid of the pattern surface ref, just in case - mThebes->SetColor(gfxRGBA(1,1,1,1)); - DirtyAllStyles(); - - // note that aX and aY are coordinates in the document that - // we're drawing; aX and aY are drawn to 0,0 in current user - // space. - RedrawUser(gfxRect(0, 0, aW, aH)); - - return rv; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::AsyncDrawXULElement(nsIDOMXULElement* aElem, float aX, float aY, - float aW, float aH, - const nsAString& aBGColor, - uint32_t flags) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - NS_ENSURE_ARG(aElem != nullptr); - - // We can't allow web apps to call this until we fix at least the - // following potential security issues: - // -- rendering cross-domain IFRAMEs and then extracting the results - // -- rendering the user's theme and then extracting the results - // -- rendering native anonymous content (e.g., file input paths; - // scrollbars should be allowed) - if (!nsContentUtils::IsCallerTrustedForRead()) { - // not permitted to use DrawWindow - // XXX ERRMSG we need to report an error to developers here! (bug 329026) - return NS_ERROR_DOM_SECURITY_ERR; - } - - nsCOMPtr loaderOwner = do_QueryInterface(aElem); - if (!loaderOwner) - return NS_ERROR_FAILURE; - - nsRefPtr frameloader = loaderOwner->GetFrameLoader(); - if (!frameloader) - return NS_ERROR_FAILURE; - - PBrowserParent *child = frameloader->GetRemoteBrowser(); - if (!child) { - nsCOMPtr window = - do_GetInterface(frameloader->GetExistingDocShell()); - if (!window) - return NS_ERROR_FAILURE; - - return DrawWindow(window, aX, aY, aW, aH, aBGColor, flags); - } - - // protect against too-large surfaces that will cause allocation - // or overflow issues - if (!gfxASurface::CheckSurfaceSize(gfxIntSize(aW, aH), 0xffff)) - return NS_ERROR_FAILURE; - - bool flush = - (flags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DO_NOT_FLUSH) == 0; - - uint32_t renderDocFlags = nsIPresShell::RENDER_IGNORE_VIEWPORT_SCROLLING; - if (flags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DRAW_CARET) { - renderDocFlags |= nsIPresShell::RENDER_CARET; - } - if (flags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DRAW_VIEW) { - renderDocFlags &= ~nsIPresShell::RENDER_IGNORE_VIEWPORT_SCROLLING; - } - - nsRect rect(nsPresContext::CSSPixelsToAppUnits(aX), - nsPresContext::CSSPixelsToAppUnits(aY), - nsPresContext::CSSPixelsToAppUnits(aW), - nsPresContext::CSSPixelsToAppUnits(aH)); - if (mIPC) { - PDocumentRendererParent *pdocrender = - child->SendPDocumentRendererConstructor(rect, - mThebes->CurrentMatrix(), - nsString(aBGColor), - renderDocFlags, flush, - nsIntSize(mWidth, mHeight)); - if (!pdocrender) - return NS_ERROR_FAILURE; - - DocumentRendererParent *docrender = - static_cast(pdocrender); - - docrender->SetCanvasContext(this, mThebes); - } - - return NS_OK; -} - -// -// device pixel getting/setting -// - -void -nsCanvasRenderingContext2D::EnsureUnpremultiplyTable() { - if (sUnpremultiplyTable) - return; - - // Infallably alloc the unpremultiply table. - sUnpremultiplyTable = new uint8_t[256][256]; - - // It's important that the array be indexed first by alpha and then by rgb - // value. When we unpremultiply a pixel, we're guaranteed to do three - // lookups with the same alpha; indexing by alpha first makes it likely that - // those three lookups will be close to one another in memory, thus - // increasing the chance of a cache hit. - - // a == 0 case - for (uint32_t c = 0; c <= 255; c++) { - sUnpremultiplyTable[0][c] = c; - } - - for (int a = 1; a <= 255; a++) { - for (int c = 0; c <= 255; c++) { - sUnpremultiplyTable[a][c] = (uint8_t)((c * 255) / a); - } - } -} - - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetImageData(double aSx, double aSy, - double aSw, double aSh, - JSContext* aCx, - nsIDOMImageData** aRetval) -{ - if (!mCanvasElement && !mDocShell) { - NS_ERROR("No canvas element and no docshell in GetImageData!!!"); - return NS_ERROR_DOM_SECURITY_ERR; - } - - // Check only if we have a canvas element; if we were created with a docshell, - // then it's special internal use. - if (mCanvasElement && mCanvasElement->IsWriteOnly() && - !nsContentUtils::IsCallerTrustedForRead()) { - // XXX ERRMSG we need to report an error to developers here! (bug 329026) - return NS_ERROR_DOM_SECURITY_ERR; - } - - if (!EnsureSurface()) { - return NS_ERROR_FAILURE; - } - - if (!NS_finite(aSx) || !NS_finite(aSy) || - !NS_finite(aSw) || !NS_finite(aSh)) { - return NS_ERROR_DOM_NOT_SUPPORTED_ERR; - } - - if (!aSw || !aSh) { - return NS_ERROR_DOM_INDEX_SIZE_ERR; - } - - int32_t x = JS_DoubleToInt32(aSx); - int32_t y = JS_DoubleToInt32(aSy); - int32_t wi = JS_DoubleToInt32(aSw); - int32_t hi = JS_DoubleToInt32(aSh); - - // Handle negative width and height by flipping the rectangle over in the - // relevant direction. - uint32_t w, h; - if (aSw < 0) { - w = -wi; - x -= w; - } else { - w = wi; - } - if (aSh < 0) { - h = -hi; - y -= h; - } else { - h = hi; - } - - if (w == 0) { - w = 1; - } - if (h == 0) { - h = 1; - } - - JSObject* array; - nsresult rv = GetImageDataArray(aCx, x, y, w, h, &array); - NS_ENSURE_SUCCESS(rv, rv); - MOZ_ASSERT(array); - - nsRefPtr imageData = new ImageData(w, h, *array); - imageData.forget(aRetval); - return NS_OK; -} - -nsresult -nsCanvasRenderingContext2D::GetImageDataArray(JSContext* aCx, - int32_t aX, - int32_t aY, - uint32_t aWidth, - uint32_t aHeight, - JSObject** aRetval) -{ - MOZ_ASSERT(aWidth && aHeight); - - CheckedInt len = CheckedInt(aWidth) * aHeight * 4; - if (!len.isValid()) { - return NS_ERROR_DOM_INDEX_SIZE_ERR; - } - - CheckedInt rightMost = CheckedInt(aX) + aWidth; - CheckedInt bottomMost = CheckedInt(aY) + aHeight; - - if (!rightMost.isValid() || !bottomMost.isValid()) { - return NS_ERROR_DOM_SYNTAX_ERR; - } - - JSObject* darray = JS_NewUint8ClampedArray(aCx, len.value()); - if (!darray) { - return NS_ERROR_OUT_OF_MEMORY; - } - - uint8_t* data = JS_GetUint8ClampedArrayData(darray, aCx); - - /* Copy the surface contents to the buffer */ - nsRefPtr tmpsurf = - new gfxImageSurface(data, - gfxIntSize(aWidth, aHeight), - aWidth * 4, - gfxASurface::ImageFormatARGB32); - - if (tmpsurf->CairoStatus()) - return NS_ERROR_FAILURE; - - nsRefPtr tmpctx = new gfxContext(tmpsurf); - - if (tmpctx->HasError()) - return NS_ERROR_FAILURE; - - if (!mZero) { - gfxRect srcRect(0, 0, mWidth, mHeight); - gfxRect destRect(aX, aY, aWidth, aHeight); - - bool finishedPainting = false; - // In the common case, we want to avoid the Rectangle call. - if (!srcRect.Contains(destRect)) { - // If the requested area is entirely outside the canvas, we're done. - gfxRect tmp = srcRect.Intersect(destRect); - finishedPainting = tmp.IsEmpty(); - - // Set clipping region if necessary. - if (!finishedPainting) { - tmpctx->Rectangle(tmp); - } - } - - if (!finishedPainting) { - tmpctx->SetOperator(gfxContext::OPERATOR_SOURCE); - tmpctx->SetSource(mSurface, gfxPoint(-aX, -aY)); - tmpctx->Paint(); - } - } - - // make sure sUnpremultiplyTable has been created - EnsureUnpremultiplyTable(); - - // NOTE! dst is the same as src, and this relies on reading - // from src and advancing that ptr before writing to dst. - uint8_t *src = data; - uint8_t *dst = data; - - for (uint32_t j = 0; j < aHeight; ++j) { - for (uint32_t i = 0; i < aWidth; ++i) { - // XXX Is there some useful swizzle MMX we can use here? -#ifdef IS_LITTLE_ENDIAN - uint8_t b = *src++; - uint8_t g = *src++; - uint8_t r = *src++; - uint8_t a = *src++; -#else - uint8_t a = *src++; - uint8_t r = *src++; - uint8_t g = *src++; - uint8_t b = *src++; -#endif - // Convert to non-premultiplied color - *dst++ = sUnpremultiplyTable[a][r]; - *dst++ = sUnpremultiplyTable[a][g]; - *dst++ = sUnpremultiplyTable[a][b]; - *dst++ = a; - } - } - - *aRetval = darray; - return NS_OK; -} - -void -nsCanvasRenderingContext2D::EnsurePremultiplyTable() { - if (sPremultiplyTable) - return; - - // Infallably alloc the premultiply table. - sPremultiplyTable = new uint8_t[256][256]; - - // Like the unpremultiply table, it's important that we index the premultiply - // table with the alpha value as the first index to ensure good cache - // performance. - - for (int a = 0; a <= 255; a++) { - for (int c = 0; c <= 255; c++) { - sPremultiplyTable[a][c] = (a * c + 254) / 255; - } - } -} - -// void putImageData (in jsval d, in double x, in double y); -// void putImageData (in jsval d, in double x, in double y, in double dirtyX, in double dirtyY, in double dirtyWidth, in double dirtyHeight); -NS_IMETHODIMP -nsCanvasRenderingContext2D::PutImageData(const JS::Value& dataArg, - double xd, double yd, - double dirtyXd, double dirtyYd, - double dirtyWidthd, - double dirtyHeightd, - JSContext* cx, - uint8_t optional_argc) -{ - // GetImageData wants a non-const JS::Value - JS::Value dataVal(dataArg); - - // Total copy/paste from the quickstub - uint32_t w, h; - JS::Anchor darray; - if (!::GetImageData(cx, dataVal, &w, &h, &darray)) { - return NS_ERROR_UNEXPECTED; - } - - if (!FloatValidate(xd, yd)) { - return NS_ERROR_DOM_NOT_SUPPORTED_ERR; - } - - int32_t x = JS_DoubleToInt32(xd); - int32_t y = JS_DoubleToInt32(yd); - - // The dirty rect is optional - bool hasDirtyRect = false; - int32_t dirtyX = 0, dirtyY = 0, dirtyWidth = w, dirtyHeight = h; - - if (optional_argc != 0 && optional_argc != 4) { - // Wrong number of arguments - return NS_ERROR_DOM_NOT_SUPPORTED_ERR; - } - - if (optional_argc == 4) { - if (!FloatValidate(dirtyXd, dirtyYd, dirtyWidthd, dirtyHeightd)) { - return NS_ERROR_DOM_NOT_SUPPORTED_ERR; - } - - dirtyX = JS_DoubleToInt32(dirtyXd); - dirtyY = JS_DoubleToInt32(dirtyYd); - dirtyWidth = JS_DoubleToInt32(dirtyWidthd); - dirtyHeight = JS_DoubleToInt32(dirtyHeightd); - - hasDirtyRect = true; - } - - uint8_t* data = - reinterpret_cast(JS_GetArrayBufferViewData(darray.get(), cx)); - uint32_t byteLength = JS_GetTypedArrayByteLength(darray.get(), cx); - - return PutImageData_explicit(x, y, w, h, data, byteLength, hasDirtyRect, - dirtyX, dirtyY, dirtyWidth, dirtyHeight); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::PutImageData_explicit(int32_t x, int32_t y, uint32_t w, uint32_t h, - unsigned char *aData, uint32_t aDataLen, - bool hasDirtyRect, int32_t dirtyX, int32_t dirtyY, - int32_t dirtyWidth, int32_t dirtyHeight) -{ - if (!EnsureSurface()) - return NS_ERROR_FAILURE; - - if (w == 0 || h == 0) - return NS_ERROR_DOM_SYNTAX_ERR; - - gfxRect dirtyRect; - gfxRect imageDataRect(0, 0, w, h); - - if (hasDirtyRect) { - // fix up negative dimensions - if (dirtyWidth < 0) { - NS_ENSURE_TRUE(dirtyWidth != INT_MIN, NS_ERROR_DOM_INDEX_SIZE_ERR); - - CheckedInt32 checkedDirtyX = CheckedInt32(dirtyX) + dirtyWidth; - - if (!checkedDirtyX.isValid()) - return NS_ERROR_DOM_INDEX_SIZE_ERR; - - dirtyX = checkedDirtyX.value(); - dirtyWidth = -dirtyWidth; - } - - if (dirtyHeight < 0) { - NS_ENSURE_TRUE(dirtyHeight != INT_MIN, NS_ERROR_DOM_INDEX_SIZE_ERR); - - CheckedInt32 checkedDirtyY = CheckedInt32(dirtyY) + dirtyHeight; - - if (!checkedDirtyY.isValid()) - return NS_ERROR_DOM_INDEX_SIZE_ERR; - - dirtyY = checkedDirtyY.value(); - dirtyHeight = -dirtyHeight; - } - - // bound the dirty rect within the imageData rectangle - dirtyRect = imageDataRect.Intersect(gfxRect(dirtyX, dirtyY, dirtyWidth, dirtyHeight)); - - if (dirtyRect.Width() <= 0 || dirtyRect.Height() <= 0) - return NS_OK; - } else { - dirtyRect = imageDataRect; - } - - dirtyRect.MoveBy(gfxPoint(x, y)); - dirtyRect = gfxRect(0, 0, mWidth, mHeight).Intersect(dirtyRect); - - if (dirtyRect.Width() <= 0 || dirtyRect.Height() <= 0) - return NS_OK; - - uint32_t len = w * h * 4; - if (aDataLen != len) - return NS_ERROR_DOM_SYNTAX_ERR; - - nsRefPtr imgsurf = new gfxImageSurface(gfxIntSize(w, h), - gfxASurface::ImageFormatARGB32, - false); - if (!imgsurf || imgsurf->CairoStatus()) - return NS_ERROR_FAILURE; - - // ensure premultiply table has been created - EnsurePremultiplyTable(); - - uint8_t *src = aData; - uint8_t *dst = imgsurf->Data(); - - for (uint32_t j = 0; j < h; j++) { - for (uint32_t i = 0; i < w; i++) { - uint8_t r = *src++; - uint8_t g = *src++; - uint8_t b = *src++; - uint8_t a = *src++; - - // Convert to premultiplied color (losslessly if the input came from getImageData) -#ifdef IS_LITTLE_ENDIAN - *dst++ = sPremultiplyTable[a][b]; - *dst++ = sPremultiplyTable[a][g]; - *dst++ = sPremultiplyTable[a][r]; - *dst++ = a; -#else - *dst++ = a; - *dst++ = sPremultiplyTable[a][r]; - *dst++ = sPremultiplyTable[a][g]; - *dst++ = sPremultiplyTable[a][b]; -#endif - } - } - - PathAutoSaveRestore pathSR(this); - gfxContextAutoSaveRestore autoSR(mThebes); - - // ignore clipping region, as per spec - mThebes->ResetClip(); - - mThebes->IdentityMatrix(); - mThebes->NewPath(); - mThebes->Rectangle(dirtyRect); - mThebes->SetSource(imgsurf, gfxPoint(x, y)); - mThebes->SetOperator(gfxContext::OPERATOR_SOURCE); - mThebes->Fill(); - - return Redraw(dirtyRect); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetThebesSurface(gfxASurface **surface) -{ - if (!EnsureSurface()) { - *surface = nullptr; - return NS_ERROR_NOT_AVAILABLE; - } - - *surface = mSurface.get(); - NS_ADDREF(*surface); - - return NS_OK; -} - -static nsresult -CreateImageData(JSContext* cx, uint32_t w, uint32_t h, - nsIDOMImageData** retval) -{ - using mozilla::CheckedInt; - - if (w == 0) - w = 1; - if (h == 0) - h = 1; - - CheckedInt len = CheckedInt(w) * h * 4; - if (!len.isValid()) { - return NS_ERROR_DOM_INDEX_SIZE_ERR; - } - - // Create the fast typed array; it's initialized to 0 by default. - JSObject* darray = JS_NewUint8ClampedArray(cx, len.value()); - JS::AutoObjectRooter rd(cx, darray); - if (!darray) { - return NS_ERROR_OUT_OF_MEMORY; - } - - nsRefPtr imageData = - new mozilla::dom::ImageData(w, h, *darray); - imageData.forget(retval); - return NS_OK; -} - - -NS_IMETHODIMP -nsCanvasRenderingContext2D::CreateImageData(const JS::Value &a1, - const JS::Value &a2, - JSContext* cx, - uint8_t optional_argc, - nsIDOMImageData** retval) -{ - // GetImageData wants mutable jsvals, so make copies - JS::Value arg1(a1); - JS::Value arg2(a2); - - // Forwarding to the quickstub leads to pain and suffering, so - // we'll do this the hard way. - if (optional_argc == 0) { - uint32_t data_width, data_height; - JS::Anchor darray; - if (!::GetImageData(cx, arg1, &data_width, &data_height, &darray)) { - return NS_ERROR_FAILURE; - } - return ::CreateImageData(cx, data_width, data_height, retval); - } - - // This is total copy/paste from the quickstub code - double width, height; - if (!JS_ValueToNumber(cx, arg1, &width) || - !JS_ValueToNumber(cx, arg2, &height)) - return NS_ERROR_FAILURE; - - if (!FloatValidate(width, height)) - return NS_ERROR_DOM_NOT_SUPPORTED_ERR; - - if (!width || !height) - return NS_ERROR_DOM_INDEX_SIZE_ERR; - - int32_t wi = JS_DoubleToInt32(width); - int32_t hi = JS_DoubleToInt32(height); - - uint32_t w = NS_ABS(wi); - uint32_t h = NS_ABS(hi); - return ::CreateImageData(cx, w, h, retval); -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::GetMozImageSmoothingEnabled(bool *retVal) -{ - *retVal = CurrentState().imageSmoothingEnabled; - return NS_OK; -} - -NS_IMETHODIMP -nsCanvasRenderingContext2D::SetMozImageSmoothingEnabled(bool val) -{ - if (val != CurrentState().imageSmoothingEnabled) { - CurrentState().imageSmoothingEnabled = val; - DirtyAllStyles(); - } - - return NS_OK; -} - -static uint8_t g2DContextLayerUserData; - -already_AddRefed -nsCanvasRenderingContext2D::GetCanvasLayer(nsDisplayListBuilder* aBuilder, - CanvasLayer *aOldLayer, - LayerManager *aManager) -{ - // If we don't have anything to draw, don't bother. - if (!mValid || !mSurface || mSurface->CairoStatus() || !mThebes || - !mSurfaceCreated) { - // No DidTransactionCallback will be received, so mark the context clean - // now so future invalidations will be dispatched. - MarkContextClean(); - return nullptr; - } - - if (!mResetLayer && aOldLayer) { - CanvasRenderingContext2DUserData* userData = - static_cast( - aOldLayer->GetUserData(&g2DContextLayerUserData)); - if (userData && userData->IsForContext(this)) { - NS_ADDREF(aOldLayer); - return aOldLayer; - } - } - - nsRefPtr canvasLayer = aManager->CreateCanvasLayer(); - if (!canvasLayer) { - NS_WARNING("CreateCanvasLayer returned null!"); - // No DidTransactionCallback will be received, so mark the context clean - // now so future invalidations will be dispatched. - MarkContextClean(); - return nullptr; - } - CanvasRenderingContext2DUserData *userData = nullptr; - if (aBuilder->IsPaintingToWindow()) { - // Make the layer tell us whenever a transaction finishes (including - // the current transaction), so we can clear our invalidation state and - // start invalidating again. We need to do this for the layer that is - // being painted to a window (there shouldn't be more than one at a time, - // and if there is, flushing the invalidation state more often than - // necessary is harmless). - - // The layer will be destroyed when we tear down the presentation - // (at the latest), at which time this userData will be destroyed, - // releasing the reference to the element. - // The userData will receive DidTransactionCallbacks, which flush the - // the invalidation state to indicate that the canvas is up to date. - userData = new CanvasRenderingContext2DUserData(this); - canvasLayer->SetDidTransactionCallback( - CanvasRenderingContext2DUserData::DidTransactionCallback, userData); - } - canvasLayer->SetUserData(&g2DContextLayerUserData, userData); - - CanvasLayer::Data data; - - data.mSurface = mSurface.get(); - data.mSize = nsIntSize(mWidth, mHeight); - - canvasLayer->Initialize(data); - uint32_t flags = mOpaque ? Layer::CONTENT_OPAQUE : 0; - canvasLayer->SetContentFlags(flags); - canvasLayer->Updated(); - - mResetLayer = false; - - return canvasLayer.forget(); -} - -bool -nsCanvasRenderingContext2D::ShouldForceInactiveLayer(LayerManager *aManager) -{ - return !aManager->CanUseCanvasLayerForSize(gfxIntSize(mWidth, mHeight)); -} - -void -nsCanvasRenderingContext2D::MarkContextClean() -{ - if (mInvalidateCount > 0) { - mPredictManyRedrawCalls = mInvalidateCount > kCanvasMaxInvalidateCount; - } - mIsEntireFrameInvalid = false; - mInvalidateCount = 0; -} - diff --git a/content/html/content/public/nsHTMLCanvasElement.h b/content/html/content/public/nsHTMLCanvasElement.h index 09eb787152ba..9212ff642ffa 100644 --- a/content/html/content/public/nsHTMLCanvasElement.h +++ b/content/html/content/public/nsHTMLCanvasElement.h @@ -168,7 +168,6 @@ protected: const nsAString& aType, nsIDOMFile** aResult); nsresult GetContextHelper(const nsAString& aContextId, - bool aForceThebes, nsICanvasRenderingContextInternal **aContext); void CallPrintCallback(); diff --git a/content/html/content/src/nsHTMLCanvasElement.cpp b/content/html/content/src/nsHTMLCanvasElement.cpp index 5b204d6f6132..f9c0613675d8 100644 --- a/content/html/content/src/nsHTMLCanvasElement.cpp +++ b/content/html/content/src/nsHTMLCanvasElement.cpp @@ -601,7 +601,6 @@ nsHTMLCanvasElement::MozGetAsFileImpl(const nsAString& aName, nsresult nsHTMLCanvasElement::GetContextHelper(const nsAString& aContextId, - bool aForceThebes, nsICanvasRenderingContextInternal **aContext) { NS_ENSURE_ARG(aContext); @@ -624,10 +623,6 @@ nsHTMLCanvasElement::GetContextHelper(const nsAString& aContextId, nsCString ctxString("@mozilla.org/content/canvas-rendering-context;1?id="); ctxString.Append(ctxId); - if (aForceThebes && ctxId.EqualsASCII("2d")) { - ctxString.AssignASCII("@mozilla.org/content/2dthebes-canvas-rendering-context;1"); - } - nsresult rv; nsCOMPtr ctx = do_CreateInstance(ctxString.get(), &rv); @@ -653,10 +648,8 @@ nsHTMLCanvasElement::GetContext(const nsAString& aContextId, { nsresult rv; - bool forceThebes = false; - - while (mCurrentContextId.IsEmpty()) { - rv = GetContextHelper(aContextId, forceThebes, getter_AddRefs(mCurrentContext)); + if (mCurrentContextId.IsEmpty()) { + rv = GetContextHelper(aContextId, getter_AddRefs(mCurrentContext)); NS_ENSURE_SUCCESS(rv, rv); if (!mCurrentContext) { return NS_OK; @@ -720,17 +713,12 @@ nsHTMLCanvasElement::GetContext(const nsAString& aContextId, rv = UpdateContext(contextProps); if (NS_FAILED(rv)) { - if (!forceThebes) { - // Try again with a Thebes context - forceThebes = true; - continue; - } return rv; } mCurrentContextId.Assign(aContextId); - break; } + if (!mCurrentContextId.Equals(aContextId)) { //XXX eventually allow for more than one active context on a given canvas return NS_OK; @@ -754,7 +742,7 @@ nsHTMLCanvasElement::MozGetIPCContext(const nsAString& aContextId, return NS_ERROR_INVALID_ARG; if (mCurrentContextId.IsEmpty()) { - nsresult rv = GetContextHelper(aContextId, false, getter_AddRefs(mCurrentContext)); + nsresult rv = GetContextHelper(aContextId, getter_AddRefs(mCurrentContext)); NS_ENSURE_SUCCESS(rv, rv); if (!mCurrentContext) { return NS_OK; @@ -948,16 +936,3 @@ nsHTMLCanvasElement::RenderContextsExternal(gfxContext *aContext, gfxPattern::Gr return mCurrentContext->Render(aContext, aFilter, aFlags); } -nsresult NS_NewCanvasRenderingContext2DThebes(nsIDOMCanvasRenderingContext2D** aResult); -nsresult NS_NewCanvasRenderingContext2DAzure(nsIDOMCanvasRenderingContext2D** aResult); - -nsresult -NS_NewCanvasRenderingContext2D(nsIDOMCanvasRenderingContext2D** aResult) -{ - Telemetry::Accumulate(Telemetry::CANVAS_2D_USED, 1); - if (AzureCanvasEnabled()) { - return NS_NewCanvasRenderingContext2DAzure(aResult); - } - - return NS_NewCanvasRenderingContext2DThebes(aResult); -} diff --git a/content/html/content/src/nsHTMLImageElement.cpp b/content/html/content/src/nsHTMLImageElement.cpp index 6938d099a83c..feb5f5fd0752 100644 --- a/content/html/content/src/nsHTMLImageElement.cpp +++ b/content/html/content/src/nsHTMLImageElement.cpp @@ -29,7 +29,7 @@ #include "imgIContainer.h" #include "imgILoader.h" #include "imgIRequest.h" -#include "imgIDecoderObserver.h" +#include "imgINotificationObserver.h" #include "nsILoadGroup.h" @@ -89,13 +89,12 @@ DOMCI_NODE_DATA(HTMLImageElement, nsHTMLImageElement) // QueryInterface implementation for nsHTMLImageElement NS_INTERFACE_TABLE_HEAD(nsHTMLImageElement) - NS_HTML_CONTENT_INTERFACE_TABLE6(nsHTMLImageElement, + NS_HTML_CONTENT_INTERFACE_TABLE5(nsHTMLImageElement, nsIDOMHTMLImageElement, nsIJSNativeInitializer, - imgIDecoderObserver, nsIImageLoadingContent, - imgIContainerObserver, - imgIOnloadBlocker) + imgIOnloadBlocker, + imgINotificationObserver) NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLImageElement, nsGenericHTMLElement) NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLImageElement) diff --git a/content/html/content/src/nsHTMLInputElement.cpp b/content/html/content/src/nsHTMLInputElement.cpp index 87c813f8c27f..1d2928577d39 100644 --- a/content/html/content/src/nsHTMLInputElement.cpp +++ b/content/html/content/src/nsHTMLInputElement.cpp @@ -642,13 +642,12 @@ DOMCI_NODE_DATA(HTMLInputElement, nsHTMLInputElement) // QueryInterface implementation for nsHTMLInputElement NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLInputElement) - NS_HTML_CONTENT_INTERFACE_TABLE9(nsHTMLInputElement, + NS_HTML_CONTENT_INTERFACE_TABLE8(nsHTMLInputElement, nsIDOMHTMLInputElement, nsITextControlElement, nsIPhonetic, - imgIDecoderObserver, + imgINotificationObserver, nsIImageLoadingContent, - imgIContainerObserver, imgIOnloadBlocker, nsIDOMNSEditableElement, nsIConstraintValidation) diff --git a/content/html/content/src/nsHTMLObjectElement.cpp b/content/html/content/src/nsHTMLObjectElement.cpp index 8fa058b4b6c8..b79030dd753f 100644 --- a/content/html/content/src/nsHTMLObjectElement.cpp +++ b/content/html/content/src/nsHTMLObjectElement.cpp @@ -185,14 +185,13 @@ DOMCI_NODE_DATA(HTMLObjectElement, nsHTMLObjectElement) NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLObjectElement) NS_HTML_CONTENT_INTERFACE_TABLE_BEGIN(nsHTMLObjectElement) NS_INTERFACE_TABLE_ENTRY(nsHTMLObjectElement, nsIDOMHTMLObjectElement) - NS_INTERFACE_TABLE_ENTRY(nsHTMLObjectElement, imgIDecoderObserver) + NS_INTERFACE_TABLE_ENTRY(nsHTMLObjectElement, imgINotificationObserver) NS_INTERFACE_TABLE_ENTRY(nsHTMLObjectElement, nsIRequestObserver) NS_INTERFACE_TABLE_ENTRY(nsHTMLObjectElement, nsIStreamListener) NS_INTERFACE_TABLE_ENTRY(nsHTMLObjectElement, nsIFrameLoaderOwner) NS_INTERFACE_TABLE_ENTRY(nsHTMLObjectElement, nsIObjectLoadingContent) NS_INTERFACE_TABLE_ENTRY(nsHTMLObjectElement, nsIImageLoadingContent) NS_INTERFACE_TABLE_ENTRY(nsHTMLObjectElement, imgIOnloadBlocker) - NS_INTERFACE_TABLE_ENTRY(nsHTMLObjectElement, imgIContainerObserver) NS_INTERFACE_TABLE_ENTRY(nsHTMLObjectElement, nsIInterfaceRequestor) NS_INTERFACE_TABLE_ENTRY(nsHTMLObjectElement, nsIChannelEventSink) NS_INTERFACE_TABLE_ENTRY(nsHTMLObjectElement, nsIConstraintValidation) diff --git a/content/html/content/src/nsHTMLSharedObjectElement.cpp b/content/html/content/src/nsHTMLSharedObjectElement.cpp index 079b846006a3..56a8b4a27e4d 100644 --- a/content/html/content/src/nsHTMLSharedObjectElement.cpp +++ b/content/html/content/src/nsHTMLSharedObjectElement.cpp @@ -234,9 +234,8 @@ NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLSharedObjectElement) NS_INTERFACE_TABLE_ENTRY(nsHTMLSharedObjectElement, nsIRequestObserver) NS_INTERFACE_TABLE_ENTRY(nsHTMLSharedObjectElement, nsIStreamListener) NS_INTERFACE_TABLE_ENTRY(nsHTMLSharedObjectElement, nsIFrameLoaderOwner) - NS_INTERFACE_TABLE_ENTRY(nsHTMLSharedObjectElement, imgIContainerObserver) NS_INTERFACE_TABLE_ENTRY(nsHTMLSharedObjectElement, nsIObjectLoadingContent) - NS_INTERFACE_TABLE_ENTRY(nsHTMLSharedObjectElement, imgIDecoderObserver) + NS_INTERFACE_TABLE_ENTRY(nsHTMLSharedObjectElement, imgINotificationObserver) NS_INTERFACE_TABLE_ENTRY(nsHTMLSharedObjectElement, nsIImageLoadingContent) NS_INTERFACE_TABLE_ENTRY(nsHTMLSharedObjectElement, imgIOnloadBlocker) NS_INTERFACE_TABLE_ENTRY(nsHTMLSharedObjectElement, nsIInterfaceRequestor) diff --git a/content/html/content/test/test_bug389797.html b/content/html/content/test/test_bug389797.html index 0e7c7b8bc5ce..862499aee62f 100644 --- a/content/html/content/test/test_bug389797.html +++ b/content/html/content/test/test_bug389797.html @@ -72,7 +72,7 @@ function HTML_TAG(aTagName, aImplClass) { } const objectIfaces = [ - "imgIDecoderObserver", "nsIRequestObserver", "nsIStreamListener", + "imgINotificationObserver", "nsIRequestObserver", "nsIStreamListener", "nsIFrameLoaderOwner", "nsIObjectLoadingContent", "nsIInterfaceRequestor", "nsIChannelEventSink" ]; @@ -160,9 +160,9 @@ HTML_TAG("i", ""); HTML_TAG("iframe", "IFrame", [ "nsIDOMGetSVGDocument", "nsIDOMMozBrowserFrame" ], [ "nsIFrameLoaderOwner" ]); HTML_TAG("image", "Span"); -HTML_TAG("img", "Image", [], [ "imgIDecoderObserver", +HTML_TAG("img", "Image", [], [ "imgINotificationObserver", "nsIImageLoadingContent" ]); -HTML_TAG("input", "Input", [], [ "imgIDecoderObserver", +HTML_TAG("input", "Input", [], [ "imgINotificationObserver", "nsIImageLoadingContent", "nsIDOMNSEditableElement" ]); HTML_TAG("ins", "Mod"); diff --git a/content/html/document/src/ImageDocument.cpp b/content/html/document/src/ImageDocument.cpp index 3bb0d5a62e71..7993afe96432 100644 --- a/content/html/document/src/ImageDocument.cpp +++ b/content/html/document/src/ImageDocument.cpp @@ -18,7 +18,7 @@ #include "imgIRequest.h" #include "imgILoader.h" #include "imgIContainer.h" -#include "nsStubImageDecoderObserver.h" +#include "imgINotificationObserver.h" #include "nsIPresShell.h" #include "nsPresContext.h" #include "nsStyleContext.h" @@ -64,7 +64,7 @@ public: class ImageDocument : public MediaDocument , public nsIImageDocument - , public nsStubImageDecoderObserver + , public imgINotificationObserver , public nsIDOMEventListener { public: @@ -89,12 +89,7 @@ public: nsIDOMEventTarget* aDispatchStartTarget); NS_DECL_NSIIMAGEDOCUMENT - - // imgIDecoderObserver (override nsStubImageDecoderObserver) - NS_IMETHOD OnStartContainer(imgIRequest* aRequest, imgIContainer* aImage); - NS_IMETHOD OnStopContainer(imgIRequest* aRequest, imgIContainer* aImage); - NS_IMETHOD OnStopDecode(imgIRequest *aRequest, nsresult aStatus, const PRUnichar *aStatusArg); - NS_IMETHOD OnDiscard(imgIRequest *aRequest); + NS_DECL_IMGINOTIFICATIONOBSERVER // nsIDOMEventListener NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent); @@ -123,6 +118,9 @@ protected: void ResetZoomLevel(); float GetZoomLevel(); + nsresult OnStartContainer(imgIRequest* aRequest, imgIContainer* aImage); + nsresult OnStopRequest(imgIRequest *aRequest, nsresult aStatus); + nsCOMPtr mImageContent; int32_t mVisibleWidth; @@ -238,8 +236,7 @@ DOMCI_NODE_DATA(ImageDocument, ImageDocument) NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(ImageDocument) NS_HTML_DOCUMENT_INTERFACE_TABLE_BEGIN(ImageDocument) NS_INTERFACE_TABLE_ENTRY(ImageDocument, nsIImageDocument) - NS_INTERFACE_TABLE_ENTRY(ImageDocument, imgIDecoderObserver) - NS_INTERFACE_TABLE_ENTRY(ImageDocument, imgIContainerObserver) + NS_INTERFACE_TABLE_ENTRY(ImageDocument, imgINotificationObserver) NS_INTERFACE_TABLE_ENTRY(ImageDocument, nsIDOMEventListener) NS_OFFSET_AND_INTERFACE_TABLE_END NS_OFFSET_AND_INTERFACE_TABLE_TO_MAP_SEGUE @@ -509,6 +506,45 @@ ImageDocument::ToggleImageSize() } NS_IMETHODIMP +ImageDocument::Notify(imgIRequest* aRequest, int32_t aType, const nsIntRect* aData) +{ + if (aType == imgINotificationObserver::SIZE_AVAILABLE) { + nsCOMPtr image; + aRequest->GetImage(getter_AddRefs(image)); + return OnStartContainer(aRequest, image); + } + + if (aType == imgINotificationObserver::DECODE_COMPLETE) { + if (mImageContent) { + // Update the background-color of the image only after the + // image has been decoded to prevent flashes of just the + // background-color. + mImageContent->SetAttr(kNameSpaceID_None, nsGkAtoms::_class, + NS_LITERAL_STRING("decoded"), true); + } + } + + if (aType == imgINotificationObserver::DISCARD) { + // mImageContent can be null if the document is already destroyed + if (mImageContent) { + // Remove any decoded-related styling when the image is unloaded. + mImageContent->UnsetAttr(kNameSpaceID_None, nsGkAtoms::_class, + true); + } + } + + if (aType == imgINotificationObserver::LOAD_COMPLETE) { + uint32_t reqStatus; + aRequest->GetImageStatus(&reqStatus); + nsresult status = + reqStatus & imgIRequest::STATUS_ERROR ? NS_ERROR_FAILURE : NS_OK; + return OnStopRequest(aRequest, status); + } + + return NS_OK; +} + +nsresult ImageDocument::OnStartContainer(imgIRequest* aRequest, imgIContainer* aImage) { aImage->GetWidth(&mImageWidth); @@ -521,24 +557,9 @@ ImageDocument::OnStartContainer(imgIRequest* aRequest, imgIContainer* aImage) return NS_OK; } -NS_IMETHODIMP -ImageDocument::OnStopContainer(imgIRequest* aRequest, imgIContainer* aImage) -{ - if (mImageContent) { - // Update the background-color of the image only after the - // image has been decoded to prevent flashes of just the - // background-color. - mImageContent->SetAttr(kNameSpaceID_None, nsGkAtoms::_class, - NS_LITERAL_STRING("decoded"), true); - } - - return NS_OK; -} - -NS_IMETHODIMP -ImageDocument::OnStopDecode(imgIRequest *aRequest, - nsresult aStatus, - const PRUnichar *aStatusArg) +nsresult +ImageDocument::OnStopRequest(imgIRequest *aRequest, + nsresult aStatus) { UpdateTitleAndCharset(); @@ -559,18 +580,6 @@ ImageDocument::OnStopDecode(imgIRequest *aRequest, return NS_OK; } -NS_IMETHODIMP -ImageDocument::OnDiscard(imgIRequest *aRequest) -{ - // mImageContent can be null if the document is already destroyed - if (mImageContent) { - // Remove any decoded-related styling when the image is unloaded. - mImageContent->UnsetAttr(kNameSpaceID_None, nsGkAtoms::_class, - true); - } - return NS_OK; -} - NS_IMETHODIMP ImageDocument::HandleEvent(nsIDOMEvent* aEvent) { diff --git a/content/svg/content/src/nsSVGFilters.cpp b/content/svg/content/src/nsSVGFilters.cpp index fd205b4f997b..7a076aa3cc83 100644 --- a/content/svg/content/src/nsSVGFilters.cpp +++ b/content/svg/content/src/nsSVGFilters.cpp @@ -5505,7 +5505,7 @@ NS_INTERFACE_TABLE_HEAD(nsSVGFEImageElement) nsIDOMSVGElement, nsIDOMSVGFilterPrimitiveStandardAttributes, nsIDOMSVGFEImageElement, nsIDOMSVGURIReference, - imgIDecoderObserver, nsIImageLoadingContent, + imgINotificationObserver, nsIImageLoadingContent, imgIOnloadBlocker) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGFEImageElement) NS_INTERFACE_MAP_END_INHERITING(nsSVGFEImageElementBase) @@ -5756,43 +5756,27 @@ nsSVGFEImageElement::GetStringInfo() } //---------------------------------------------------------------------- -// imgIDecoderObserver methods +// imgINotificationObserver methods NS_IMETHODIMP -nsSVGFEImageElement::OnStopDecode(imgIRequest *aRequest, - nsresult status, - const PRUnichar *statusArg) +nsSVGFEImageElement::Notify(imgIRequest* aRequest, int32_t aType, const nsIntRect* aData) { - nsresult rv = - nsImageLoadingContent::OnStopDecode(aRequest, status, statusArg); - Invalidate(); - return rv; -} + nsresult rv = nsImageLoadingContent::Notify(aRequest, aType, aData); -NS_IMETHODIMP -nsSVGFEImageElement::FrameChanged(imgIRequest* aRequest, - imgIContainer *aContainer, - const nsIntRect *aDirtyRect) -{ - nsresult rv = - nsImageLoadingContent::FrameChanged(aRequest, aContainer, aDirtyRect); - Invalidate(); - return rv; -} + if (aType == imgINotificationObserver::SIZE_AVAILABLE) { + // Request a decode + nsCOMPtr container; + aRequest->GetImage(getter_AddRefs(container)); + NS_ABORT_IF_FALSE(container, "who sent the notification then?"); + container->StartDecoding(); + } -NS_IMETHODIMP -nsSVGFEImageElement::OnStartContainer(imgIRequest *aRequest, - imgIContainer *aContainer) -{ - nsresult rv = - nsImageLoadingContent::OnStartContainer(aRequest, aContainer); + if (aType == imgINotificationObserver::LOAD_COMPLETE || + aType == imgINotificationObserver::FRAME_UPDATE || + aType == imgINotificationObserver::SIZE_AVAILABLE) { + Invalidate(); + } - // Request a decode - NS_ABORT_IF_FALSE(aContainer, "who sent the notification then?"); - aContainer->StartDecoding(); - - // We have a size - invalidate - Invalidate(); return rv; } diff --git a/content/svg/content/src/nsSVGFilters.h b/content/svg/content/src/nsSVGFilters.h index d14253a463c3..15b3df1f137f 100644 --- a/content/svg/content/src/nsSVGFilters.h +++ b/content/svg/content/src/nsSVGFilters.h @@ -267,16 +267,7 @@ public: virtual void UnbindFromTree(bool aDeep, bool aNullParent); virtual nsEventStates IntrinsicState() const; - // imgIDecoderObserver - NS_IMETHOD OnStopDecode(imgIRequest *aRequest, nsresult status, - const PRUnichar *statusArg); - // imgIContainerObserver - NS_IMETHOD FrameChanged(imgIRequest* aRequest, - imgIContainer *aContainer, - const nsIntRect *aDirtyRect); - // imgIContainerObserver - NS_IMETHOD OnStartContainer(imgIRequest *aRequest, - imgIContainer *aContainer); + NS_IMETHODIMP Notify(imgIRequest *aRequest, int32_t aType, const nsIntRect* aData); void MaybeLoadSVGImage(); diff --git a/content/svg/content/src/nsSVGImageElement.cpp b/content/svg/content/src/nsSVGImageElement.cpp index 6031cf90068e..86e7bdc23f99 100644 --- a/content/svg/content/src/nsSVGImageElement.cpp +++ b/content/svg/content/src/nsSVGImageElement.cpp @@ -10,7 +10,7 @@ #include "nsIURI.h" #include "nsNetUtil.h" #include "imgIContainer.h" -#include "imgIDecoderObserver.h" +#include "imgINotificationObserver.h" #include "gfxContext.h" using namespace mozilla; @@ -42,7 +42,7 @@ NS_INTERFACE_TABLE_HEAD(nsSVGImageElement) NS_NODE_INTERFACE_TABLE9(nsSVGImageElement, nsIDOMNode, nsIDOMElement, nsIDOMSVGElement, nsIDOMSVGTests, nsIDOMSVGImageElement, - nsIDOMSVGURIReference, imgIDecoderObserver, + nsIDOMSVGURIReference, imgINotificationObserver, nsIImageLoadingContent, imgIOnloadBlocker) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGImageElement) NS_INTERFACE_MAP_END_INHERITING(nsSVGImageElementBase) diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h index fd9cb0939eb4..4916c98d0a8e 100644 --- a/docshell/base/nsDocShell.h +++ b/docshell/base/nsDocShell.h @@ -532,12 +532,8 @@ protected: static inline uint32_t PRTimeToSeconds(PRTime t_usec) { - PRTime usec_per_sec; - uint32_t t_sec; - LL_I2L(usec_per_sec, PR_USEC_PER_SEC); - t_usec /= usec_per_sec; - LL_L2I(t_sec, t_usec); - return t_sec; + PRTime usec_per_sec = PR_USEC_PER_SEC; + return uint32_t(t_usec /= usec_per_sec); } bool IsFrame(); diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index b114f7f373c5..7e597d5eb8f9 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -4546,11 +4546,6 @@ nsDOMClassInfo::Init() // overwrite some values. mozilla::dom::oldproxybindings::Register(nameSpaceManager); - if (!AzureCanvasEnabled()) { - nameSpaceManager->RegisterDefineDOMInterface(NS_LITERAL_STRING("CanvasRenderingContext2D"), - nullptr, nullptr); - } - sIsInitialized = true; return NS_OK; diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index a5d38cc75f4f..4cd6714069b7 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -109,10 +109,6 @@ DOMInterfaces = { 'CanvasRenderingContext2D': [ { - 'nativeType': 'nsCanvasRenderingContext2DAzure', - # Making this non-prefable requires that we ensure that nothing takes this - # type as an argument or that the non-Azure variant is removed. - 'prefable': True, 'implicitJSContext': [ 'createImageData', 'getImageData', 'putImageData', 'strokeStyle', 'fillStyle', 'mozDash' diff --git a/dom/bluetooth/BluetoothOppManager.cpp b/dom/bluetooth/BluetoothOppManager.cpp index f35f8795ec4b..aa72cabb6af3 100644 --- a/dom/bluetooth/BluetoothOppManager.cpp +++ b/dom/bluetooth/BluetoothOppManager.cpp @@ -20,13 +20,15 @@ USING_BLUETOOTH_NAMESPACE using namespace mozilla::ipc; -static const uint32_t kUpdateProgressBase = 500000; +// Sending system message "bluetooth-opp-update-progress" every 50kb +static const uint32_t kUpdateProgressBase = 50 * 1024; static mozilla::RefPtr sInstance; static nsCOMPtr stream = nullptr; static uint32_t sSentFileLength = 0; static nsString sFileName; static uint64_t sFileLength = 0; +static nsString sContentType; static int sUpdateProgressCounter = 0; class ReadFileTask : public nsRunnable @@ -97,6 +99,11 @@ BluetoothOppManager::BluetoothOppManager() : mConnected(false) , mReadFileThread(nullptr) , mPacketLeftLength(0) { + // FIXME / Bug 800249: + // mConnectedDeviceAddress is Bluetooth address of connected device, + // we will be able to get this value after bug 800249 lands. For now, + // just assign a fake value to it. + mConnectedDeviceAddress.AssignASCII("00:00:00:00:00:00"); } BluetoothOppManager::~BluetoothOppManager() @@ -232,6 +239,12 @@ BluetoothOppManager::ReceiveSocketData(UnixSocketRawData* aMessage) return; } + rv = mBlob->GetType(sContentType); + if (NS_FAILED(rv)) { + NS_WARNING("Can't get content type"); + return; + } + if (NS_FAILED(NS_NewThread(getter_AddRefs(mReadFileThread)))) { NS_WARNING("Can't create thread"); SendDisconnectRequest(); @@ -242,6 +255,8 @@ BluetoothOppManager::ReceiveSocketData(UnixSocketRawData* aMessage) sSentFileLength = 0; mAbortFlag = false; sInstance->SendPutHeaderRequest(sFileName, sFileLength); + StartFileTransfer(mConnectedDeviceAddress, false, + sFileName, sFileLength, sContentType); } } } else if (mLastCommand == ObexRequestCode::Disconnect) { @@ -262,9 +277,9 @@ BluetoothOppManager::ReceiveSocketData(UnixSocketRawData* aMessage) if (mAbortFlag || mReadFileThread == nullptr) { SendAbortRequest(); } else { - // Sending system message "bluetooth-opp-update-progress" every 50kb, if (kUpdateProgressBase * sUpdateProgressCounter < sSentFileLength) { - UpdateProgress(sSentFileLength, sFileLength); + UpdateProgress(mConnectedDeviceAddress, false, + sSentFileLength, sFileLength); ++sUpdateProgressCounter; } @@ -280,7 +295,8 @@ BluetoothOppManager::ReceiveSocketData(UnixSocketRawData* aMessage) // FIXME: Needs error handling here NS_WARNING("[OPP] PutFinal failed"); } else { - FileTransferComplete(true, false, sFileName, sSentFileLength); + FileTransferComplete(mConnectedDeviceAddress, true, false, sFileName, + sSentFileLength, sContentType); SendDisconnectRequest(); } } else if (mLastCommand == ObexRequestCode::Abort) { @@ -288,7 +304,8 @@ BluetoothOppManager::ReceiveSocketData(UnixSocketRawData* aMessage) NS_WARNING("[OPP] Abort failed"); } - FileTransferComplete(false, false, sFileName, sSentFileLength); + FileTransferComplete(mConnectedDeviceAddress, false, false, sFileName, + sSentFileLength, sContentType); SendDisconnectRequest(); } else { // Remote request or unknown mLastCommand @@ -517,16 +534,22 @@ BluetoothOppManager::ReplyToPut(bool aFinal) } void -BluetoothOppManager::FileTransferComplete(bool aSuccess, +BluetoothOppManager::FileTransferComplete(const nsString& aDeviceAddress, + bool aSuccess, bool aReceived, const nsString& aFileName, - uint32_t aFileLength) + uint32_t aFileLength, + const nsString& aContentType) { nsString type, name; BluetoothValue v; InfallibleTArray parameters; type.AssignLiteral("bluetooth-opp-transfer-complete"); + name.AssignLiteral("address"); + v = aDeviceAddress; + parameters.AppendElement(BluetoothNamedValue(name, v)); + name.AssignLiteral("success"); v = aSuccess; parameters.AppendElement(BluetoothNamedValue(name, v)); @@ -535,14 +558,18 @@ BluetoothOppManager::FileTransferComplete(bool aSuccess, v = aReceived; parameters.AppendElement(BluetoothNamedValue(name, v)); - name.AssignLiteral("filename"); + name.AssignLiteral("fileName"); v = aFileName; parameters.AppendElement(BluetoothNamedValue(name, v)); - name.AssignLiteral("filelength"); + name.AssignLiteral("fileLength"); v = aFileLength; parameters.AppendElement(BluetoothNamedValue(name, v)); + name.AssignLiteral("contentType"); + v = aContentType; + parameters.AppendElement(BluetoothNamedValue(name, v)); + if (!BroadcastSystemMessage(type, parameters)) { NS_WARNING("Failed to broadcast [bluetooth-opp-transfer-complete]"); return; @@ -550,18 +577,67 @@ BluetoothOppManager::FileTransferComplete(bool aSuccess, } void -BluetoothOppManager::UpdateProgress(uint32_t aProcessed, uint32_t aFileLength) +BluetoothOppManager::StartFileTransfer(const nsString& aDeviceAddress, + bool aReceived, + const nsString& aFileName, + uint32_t aFileLength, + const nsString& aContentType) +{ + nsString type, name; + BluetoothValue v; + InfallibleTArray parameters; + type.AssignLiteral("bluetooth-opp-transfer-start"); + + name.AssignLiteral("address"); + v = aDeviceAddress; + parameters.AppendElement(BluetoothNamedValue(name, v)); + + name.AssignLiteral("received"); + v = aReceived; + parameters.AppendElement(BluetoothNamedValue(name, v)); + + name.AssignLiteral("fileName"); + v = aFileName; + parameters.AppendElement(BluetoothNamedValue(name, v)); + + name.AssignLiteral("fileLength"); + v = aFileLength; + parameters.AppendElement(BluetoothNamedValue(name, v)); + + name.AssignLiteral("contentType"); + v = aContentType; + parameters.AppendElement(BluetoothNamedValue(name, v)); + + if (!BroadcastSystemMessage(type, parameters)) { + NS_WARNING("Failed to broadcast [bluetooth-opp-transfer-start]"); + return; + } +} + +void +BluetoothOppManager::UpdateProgress(const nsString& aDeviceAddress, + bool aReceived, + uint32_t aProcessedLength, + uint32_t aFileLength) { nsString type, name; BluetoothValue v; InfallibleTArray parameters; type.AssignLiteral("bluetooth-opp-update-progress"); - name.AssignLiteral("processed"); - v = aProcessed; + name.AssignLiteral("address"); + v = aDeviceAddress; parameters.AppendElement(BluetoothNamedValue(name, v)); - name.AssignLiteral("filelength"); + name.AssignLiteral("received"); + v = aReceived; + parameters.AppendElement(BluetoothNamedValue(name, v)); + + name.AssignLiteral("processedLength"); + v = aProcessedLength; + parameters.AppendElement(BluetoothNamedValue(name, v)); + + name.AssignLiteral("fileLength"); v = aFileLength; parameters.AppendElement(BluetoothNamedValue(name, v)); diff --git a/dom/bluetooth/BluetoothOppManager.h b/dom/bluetooth/BluetoothOppManager.h index acb5dd785285..7211b7711c70 100644 --- a/dom/bluetooth/BluetoothOppManager.h +++ b/dom/bluetooth/BluetoothOppManager.h @@ -60,9 +60,21 @@ public: private: BluetoothOppManager(); - void FileTransferComplete(bool aSuccess, bool aReceived, - const nsString& aFileName, uint32_t aFileLength); - void UpdateProgress(uint32_t aProcessed, uint32_t aFileLength); + void StartFileTransfer(const nsString& aDeviceAddress, + bool aReceived, + const nsString& aFileName, + uint32_t aFileLength, + const nsString& aContentType); + void FileTransferComplete(const nsString& aDeviceAddress, + bool aSuccess, + bool aReceived, + const nsString& aFileName, + uint32_t aFileLength, + const nsString& aContentType); + void UpdateProgress(const nsString& aDeviceAddress, + bool aReceived, + uint32_t aProcessedLength, + uint32_t aFileLength); void ReplyToConnect(); void ReplyToDisconnect(); void ReplyToPut(bool aFinal); @@ -77,6 +89,7 @@ private: int mRemoteMaxPacketLength; bool mAbortFlag; int mPacketLeftLength; + nsString mConnectedDeviceAddress; nsCOMPtr mBlob; nsCOMPtr mReadFileThread; diff --git a/dom/plugins/base/nsPluginStreamListenerPeer.cpp b/dom/plugins/base/nsPluginStreamListenerPeer.cpp index 6983caa9d7b1..fda4074a6c06 100644 --- a/dom/plugins/base/nsPluginStreamListenerPeer.cpp +++ b/dom/plugins/base/nsPluginStreamListenerPeer.cpp @@ -1183,8 +1183,7 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIRequest *request, PR_ParseTimeString(lastModified.get(), true, &time64); //convert string time to integer time // Convert PRTime to unix-style time_t, i.e. seconds since the epoch - double fpTime; - LL_L2D(fpTime, time64); + double fpTime = double(time64); mModified = (uint32_t)(fpTime * 1e-6 + 0.5); } } diff --git a/extensions/pref/autoconfig/src/nsAutoConfig.cpp b/extensions/pref/autoconfig/src/nsAutoConfig.cpp index be094e09853b..6ac4fc8def47 100644 --- a/extensions/pref/autoconfig/src/nsAutoConfig.cpp +++ b/extensions/pref/autoconfig/src/nsAutoConfig.cpp @@ -418,13 +418,13 @@ nsresult nsAutoConfig::evaluateLocalFile(nsIFile *file) return rv; int64_t fileSize; - uint32_t fs, amt=0; file->GetFileSize(&fileSize); - LL_L2UI(fs, fileSize); // Converting 64 bit structure to unsigned int + uint32_t fs = fileSize; // Converting 64 bit structure to unsigned int char *buf = (char *)PR_Malloc(fs * sizeof(char)); if (!buf) return NS_ERROR_OUT_OF_MEMORY; - + + uint32_t amt = 0; rv = inStr->Read(buf, fs, &amt); if (NS_SUCCEEDED(rv)) { EvaluateAdminConfigScript(buf, fs, nullptr, false, diff --git a/gfx/layers/d3d10/LayerManagerD3D10.cpp b/gfx/layers/d3d10/LayerManagerD3D10.cpp index d43b4e023906..89dab4fb5ed1 100644 --- a/gfx/layers/d3d10/LayerManagerD3D10.cpp +++ b/gfx/layers/d3d10/LayerManagerD3D10.cpp @@ -499,7 +499,6 @@ LayerManagerD3D10::CreateDrawTarget(const IntSize &aSize, { if ((aFormat != FORMAT_B8G8R8A8 && aFormat != FORMAT_B8G8R8X8) || - !gfxPlatform::GetPlatform()->SupportsAzureCanvas() || gfxPlatform::GetPlatform()->GetPreferredCanvasBackend() != BACKEND_DIRECT2D) { return LayerManager::CreateDrawTarget(aSize, aFormat); } diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index f08339336e7f..6ced9c9471fc 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -706,10 +706,6 @@ gfxPlatform::GetThebesSurfaceForDrawTarget(DrawTarget *aTarget) RefPtr gfxPlatform::CreateDrawTargetForBackend(BackendType aBackend, const IntSize& aSize, SurfaceFormat aFormat) { - if (!SupportsAzureCanvas()) { - return NULL; - } - // There is a bunch of knowledge in the gfxPlatform heirarchy about how to // create the best offscreen surface for the current system and situation. We // can easily take advantage of this for the Cairo backend, so that's what we @@ -734,10 +730,7 @@ gfxPlatform::CreateDrawTargetForBackend(BackendType aBackend, const IntSize& aSi RefPtr gfxPlatform::CreateOffscreenDrawTarget(const IntSize& aSize, SurfaceFormat aFormat) { - if (!SupportsAzureCanvas()) { - return NULL; - } - + NS_ASSERTION(mPreferredCanvasBackend, "No backend."); RefPtr target = CreateDrawTargetForBackend(mPreferredCanvasBackend, aSize, aFormat); if (target || mFallbackCanvasBackend == BACKEND_NONE) { @@ -751,20 +744,10 @@ gfxPlatform::CreateOffscreenDrawTarget(const IntSize& aSize, SurfaceFormat aForm RefPtr gfxPlatform::CreateDrawTargetForData(unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat) { - if (!SupportsAzureCanvas()) { - return NULL; - } + NS_ASSERTION(mPreferredCanvasBackend, "No backend."); return Factory::CreateDrawTargetForData(mPreferredCanvasBackend, aData, aSize, aStride, aFormat); } -bool -gfxPlatform::SupportsAzureCanvas() -{ - NS_ASSERTION(mFallbackCanvasBackend == BACKEND_NONE || mPreferredCanvasBackend != BACKEND_NONE, - "fallback backend with no preferred backend"); - return mPreferredCanvasBackend != BACKEND_NONE; -} - /* static */ BackendType gfxPlatform::BackendTypeForName(const nsCString& aName) { @@ -1203,6 +1186,9 @@ void gfxPlatform::InitBackendPrefs(uint32_t aCanvasBitmask, uint32_t aContentBitmask) { mPreferredCanvasBackend = GetCanvasBackendPref(aCanvasBitmask); + if (!mPreferredCanvasBackend) { + mPreferredCanvasBackend = BACKEND_CAIRO; + } mFallbackCanvasBackend = GetCanvasBackendPref(aCanvasBitmask & ~(1 << mPreferredCanvasBackend)); mContentBackend = GetContentBackendPref(aContentBitmask); } @@ -1210,7 +1196,7 @@ gfxPlatform::InitBackendPrefs(uint32_t aCanvasBitmask, uint32_t aContentBitmask) /* static */ BackendType gfxPlatform::GetCanvasBackendPref(uint32_t aBackendBitmask) { - return GetBackendPref("gfx.canvas.azure.enabled", "gfx.canvas.azure.backends", aBackendBitmask); + return GetBackendPref(nullptr, "gfx.canvas.azure.backends", aBackendBitmask); } /* static */ BackendType @@ -1222,7 +1208,8 @@ gfxPlatform::GetContentBackendPref(uint32_t aBackendBitmask) /* static */ BackendType gfxPlatform::GetBackendPref(const char* aEnabledPrefName, const char* aBackendPrefName, uint32_t aBackendBitmask) { - if (!Preferences::GetBool(aEnabledPrefName, false)) { + if (aEnabledPrefName && + !Preferences::GetBool(aEnabledPrefName, false)) { return BACKEND_NONE; } diff --git a/gfx/thebes/gfxPlatform.h b/gfx/thebes/gfxPlatform.h index 5e5f5a700393..184bbcae86fe 100644 --- a/gfx/thebes/gfxPlatform.h +++ b/gfx/thebes/gfxPlatform.h @@ -198,7 +198,6 @@ public: CreateDrawTargetForData(unsigned char* aData, const mozilla::gfx::IntSize& aSize, int32_t aStride, mozilla::gfx::SurfaceFormat aFormat); - bool SupportsAzureCanvas(); bool SupportsAzureContent() { return GetContentBackend() != mozilla::gfx::BACKEND_NONE; } @@ -494,9 +493,10 @@ protected: static mozilla::gfx::BackendType GetContentBackendPref(uint32_t aBackendBitmask); /** - * Checks the aEnabledPrefName pref and returns BACKEND_NONE if the pref is - * not enabled. Otherwise it will return the first backend named in - * aBackendPrefName allowed by aBackendBitmask, a bitmask of backend types. + * If aEnabledPrefName is non-null, checks the aEnabledPrefName pref and + * returns BACKEND_NONE if the pref is not enabled. + * Otherwise it will return the first backend named in aBackendPrefName + * allowed by aBackendBitmask, a bitmask of backend types. */ static mozilla::gfx::BackendType GetBackendPref(const char* aEnabledPrefName, const char* aBackendPrefName, diff --git a/image/decoders/nsICODecoder.cpp b/image/decoders/nsICODecoder.cpp index 82f87bd23b7a..71cd56f068fc 100644 --- a/image/decoders/nsICODecoder.cpp +++ b/image/decoders/nsICODecoder.cpp @@ -458,10 +458,10 @@ nsICODecoder::WriteInternal(const char* aBuffer, uint32_t aCount) return; } // Feed the actual image data (not including headers) into the BMP decoder - int32_t bmpDataOffset = mDirEntry.mImageOffset + BITMAPINFOSIZE; - int32_t bmpDataEnd = mDirEntry.mImageOffset + BITMAPINFOSIZE + - static_cast(mContainedDecoder.get())->GetCompressedImageSize() + - 4 * numColors; + uint32_t bmpDataOffset = mDirEntry.mImageOffset + BITMAPINFOSIZE; + uint32_t bmpDataEnd = mDirEntry.mImageOffset + BITMAPINFOSIZE + + static_cast(mContainedDecoder.get())->GetCompressedImageSize() + + 4 * numColors; // If we are feeding in the core image data, but we have not yet // reached the ICO's 'AND buffer mask' diff --git a/image/encoders/ico/nsICOEncoder.cpp b/image/encoders/ico/nsICOEncoder.cpp index cc1615f5f3d2..7dcf8c4670b7 100644 --- a/image/encoders/ico/nsICOEncoder.cpp +++ b/image/encoders/ico/nsICOEncoder.cpp @@ -278,7 +278,7 @@ nsICOEncoder::ParseOptions(const nsAString& aOptions, uint32_t* bpp, } // For each name/value pair in the set - for (int i = 0; i < nameValuePairs.Length(); ++i) { + for (unsigned i = 0; i < nameValuePairs.Length(); ++i) { // Split the name value pair [0] = name, [1] = value nsTArray nameValuePair; diff --git a/image/public/Makefile.in b/image/public/Makefile.in index 603ee85568f6..b98f0cf22954 100644 --- a/image/public/Makefile.in +++ b/image/public/Makefile.in @@ -23,8 +23,10 @@ XPIDLSRCS = \ imgIDecoderObserver.idl \ imgIEncoder.idl \ imgILoader.idl \ + imgINotificationObserver.idl \ imgIOnloadBlocker.idl \ imgIRequest.idl \ + imgIScriptedNotificationObserver.idl \ imgITools.idl \ $(NULL) diff --git a/image/public/imgIContainerObserver.idl b/image/public/imgIContainerObserver.idl index f4375658f6c9..a0ff1b3d22f7 100644 --- a/image/public/imgIContainerObserver.idl +++ b/image/public/imgIContainerObserver.idl @@ -10,7 +10,6 @@ #include "nsRect.h" %} -interface imgIContainer; interface imgIRequest; [ptr] native nsIntRect(nsIntRect); @@ -20,10 +19,8 @@ interface imgIRequest; * @author Stuart Parmenter * @version 0.1 */ -[scriptable, uuid(f01efdb3-4b20-4313-a636-a2aa01a4ef5d)] +[scriptable, uuid(f4aaf410-e88f-4036-b91c-610c9c11d825)] interface imgIContainerObserver : nsISupports { - [noscript] void frameChanged(in imgIRequest aRequest, - in imgIContainer aContainer, - [const] in nsIntRect aDirtyRect); + [noscript] void frameChanged([const] in nsIntRect aDirtyRect); }; diff --git a/image/public/imgIDecoderObserver.idl b/image/public/imgIDecoderObserver.idl index 9bffe44e4709..27b0259a6cc4 100644 --- a/image/public/imgIDecoderObserver.idl +++ b/image/public/imgIDecoderObserver.idl @@ -43,7 +43,7 @@ interface imgIContainer; * @version 0.1 * @see imagelib2 */ -[scriptable, uuid(5ca71b89-1a2f-475f-881d-d76c1531c4c8)] +[scriptable, uuid(0089cf0c-210c-4b44-9ab0-8099b32bcf64)] interface imgIDecoderObserver : imgIContainerObserver { /** @@ -53,7 +53,7 @@ interface imgIDecoderObserver : imgIContainerObserver * (used only for observers of imgIRequest objects, which are nsIRequests, * not imgIDecoder objects) */ - void onStartRequest(in imgIRequest aRequest); + void onStartRequest(); /** * Decode notification. @@ -62,7 +62,7 @@ interface imgIDecoderObserver : imgIContainerObserver * "header-only" decodes used by decode-on-draw to parse the width/height * out of the image. Thus, it is a decode notification only. */ - void onStartDecode(in imgIRequest aRequest); + void onStartDecode(); /** * Load notification. @@ -72,54 +72,34 @@ interface imgIDecoderObserver : imgIContainerObserver * called, the size has been set on the container and STATUS_SIZE_AVAILABLE * has been set on the associated imgRequest. */ - void onStartContainer(in imgIRequest aRequest, in imgIContainer aContainer); - - /** - * Decode notification. - * - * called when each frame is created. - */ - void onStartFrame(in imgIRequest aRequest, in unsigned long aFrame); + void onStartContainer(); /** * Decode notification. * * called when there is more to paint. */ - [noscript] void onDataAvailable(in imgIRequest aRequest, in boolean aCurrentFrame, [const] in nsIntRect aRect); + [noscript] void onDataAvailable([const] in nsIntRect aRect); /** * Decode notification. * * called when a frame is finished decoding. */ - void onStopFrame(in imgIRequest aRequest, in unsigned long aFrame); - - /** - * Do not implement this. It is useless and going away. - */ - void onStopContainer(in imgIRequest aRequest, in imgIContainer aContainer); + void onStopFrame(); /** * Notification for when an image is known to be animated. This should be * fired at the earliest possible time. */ - void onImageIsAnimated(in imgIRequest aRequest); + void onImageIsAnimated(); /** - * In theory a decode notification, but currently a load notification. + * Decode notification. * - * Ideally this would be called when the decode is complete. Unfortunately, - * this is currently the only way to signal decoding errors to consumers, - * and the only decoding errors that consumers care about (indeed, the only - * ones that they're prepared to hear about) are failures to instantiate the - * decoder ( for example). Thus, currently this is just - * a companion to onStopDecode to signal success or failure. This will be - * revisited in bug 505385. If you're thinking of doing something new with - * this, please talk to bholley first. + * Called when all decoding has terminated. */ - void onStopDecode(in imgIRequest aRequest, in nsresult status, - in wstring statusArg); + void onStopDecode(in nsresult status); /** * Load notification. @@ -128,13 +108,13 @@ interface imgIDecoderObserver : imgIContainerObserver * (used only for observers of imgIRequest objects, which are nsIRequests, * not imgIDecoder objects) */ - void onStopRequest(in imgIRequest aRequest, in boolean aIsLastPart); + void onStopRequest(in boolean aIsLastPart); /** * Called when the decoded image data is discarded. This means that the frames * no longer exist in decoded form, and any attempt to access or draw the * image will initiate a new series of progressive decode notifications. */ - void onDiscard(in imgIRequest aRequest); + void onDiscard(); }; diff --git a/image/public/imgILoader.idl b/image/public/imgILoader.idl index e578b8587ee2..9018fe5d89c0 100644 --- a/image/public/imgILoader.idl +++ b/image/public/imgILoader.idl @@ -6,7 +6,7 @@ #include "nsISupports.idl" -interface imgIDecoderObserver; +interface imgINotificationObserver; interface imgIRequest; interface nsIChannel; @@ -61,7 +61,7 @@ interface imgILoader : nsISupports in nsIURI aReferrerURI, in nsIPrincipal aLoadingPrincipal, in nsILoadGroup aLoadGroup, - in imgIDecoderObserver aObserver, + in imgINotificationObserver aObserver, in nsISupports aCX, in nsLoadFlags aLoadFlags, in nsISupports cacheKey, @@ -86,7 +86,7 @@ interface imgILoader : nsISupports * make sure to Cancel() the resulting request before the observer goes away. */ imgIRequest loadImageWithChannel(in nsIChannel aChannel, - in imgIDecoderObserver aObserver, + in imgINotificationObserver aObserver, in nsISupports cx, out nsIStreamListener aListener); }; diff --git a/image/public/imgINotificationObserver.idl b/image/public/imgINotificationObserver.idl new file mode 100644 index 000000000000..8b9c56bb1889 --- /dev/null +++ b/image/public/imgINotificationObserver.idl @@ -0,0 +1,29 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +interface imgIRequest; + +%{C++ +#include "nsRect.h" +%} + +[ptr] native nsIntRect(nsIntRect); + +[scriptable, builtinclass, uuid(90b3d21c-317d-4d96-93c0-12add64a26bf)] +interface imgINotificationObserver : nsISupports +{ + const long SIZE_AVAILABLE = 1; + const long FRAME_UPDATE = 2; + const long FRAME_COMPLETE = 3; + const long LOAD_COMPLETE = 4; + const long DECODE_COMPLETE = 5; + const long DISCARD = 6; + const long IS_ANIMATED = 7; + + [noscript] void notify(in imgIRequest aProxy, in long aType, [const] in nsIntRect aRect); +}; diff --git a/image/public/imgIRequest.idl b/image/public/imgIRequest.idl index 8ac1bb1ddc12..6318f41fa080 100644 --- a/image/public/imgIRequest.idl +++ b/image/public/imgIRequest.idl @@ -8,7 +8,7 @@ #include "nsIRequest.idl" interface imgIContainer; -interface imgIDecoderObserver; +interface imgINotificationObserver; interface nsIURI; interface nsIPrincipal; @@ -19,7 +19,7 @@ interface nsIPrincipal; * @version 0.1 * @see imagelib2 */ -[scriptable, uuid(a5a785a8-9881-11e1-aaff-001fbc092072)] +[scriptable, uuid(3ea9fc87-2e97-45bf-b373-d1dd253a0b5e)] interface imgIRequest : nsIRequest { /** @@ -82,7 +82,7 @@ interface imgIRequest : nsIRequest */ readonly attribute nsIURI URI; - readonly attribute imgIDecoderObserver decoderObserver; + readonly attribute imgINotificationObserver notificationObserver; readonly attribute string mimeType; @@ -92,7 +92,7 @@ interface imgIRequest : nsIRequest * call returns) with all the notifications that have already been dispatched * for this image load. */ - imgIRequest clone(in imgIDecoderObserver aObserver); + imgIRequest clone(in imgINotificationObserver aObserver); /** * The principal gotten from the channel the image was loaded from. diff --git a/image/public/imgIScriptedNotificationObserver.idl b/image/public/imgIScriptedNotificationObserver.idl new file mode 100644 index 000000000000..6eea5773814a --- /dev/null +++ b/image/public/imgIScriptedNotificationObserver.idl @@ -0,0 +1,21 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +interface imgIRequest; + +[scriptable, uuid(10be55b3-2029-41a7-a975-538efed250ed)] +interface imgIScriptedNotificationObserver : nsISupports +{ + void sizeAvailable(in imgIRequest aRequest); + void frameUpdate(in imgIRequest aRequest); + void frameComplete(in imgIRequest aRequest); + void loadComplete(in imgIRequest aRequest); + void decodeComplete(in imgIRequest aRequest); + void discard(in imgIRequest aRequest); + void isAnimated(in imgIRequest aRequest); +}; diff --git a/image/public/imgITools.idl b/image/public/imgITools.idl index c0754d66555b..b1e442074c29 100644 --- a/image/public/imgITools.idl +++ b/image/public/imgITools.idl @@ -11,8 +11,10 @@ interface imgIContainer; interface imgILoader; interface imgICache; interface nsIDOMDocument; +interface imgIScriptedNotificationObserver; +interface imgINotificationObserver; -[scriptable, uuid(53dd1cbe-cb9f-4d9e-8104-1ab72851c88e)] +[scriptable, uuid(98bd5bf9-87eb-4d92-81b1-4cd10c64f7b2)] interface imgITools : nsISupports { /** @@ -123,4 +125,12 @@ interface imgITools : nsISupports in long aWidth, in long aHeight, [optional] in AString outputOptions); + + /** + * Create a wrapper around a scripted notification observer (ordinarily + * imgINotificationObserver cannot be implemented from scripts). + * + * @param aObserver The scripted observer to wrap + */ + imgINotificationObserver createScriptedObserver(in imgIScriptedNotificationObserver aObserver); }; diff --git a/image/src/Decoder.cpp b/image/src/Decoder.cpp index f408daf0fe51..d0c9dc9c5bf8 100644 --- a/image/src/Decoder.cpp +++ b/image/src/Decoder.cpp @@ -45,7 +45,7 @@ Decoder::Init() // Fire OnStartDecode at init time to support bug 512435 if (!IsSizeDecode() && mObserver) - mObserver->OnStartDecode(nullptr); + mObserver->OnStartDecode(); // Implementation-specific initialization InitInternal(); @@ -124,8 +124,7 @@ Decoder::Finish() // Fire teardown notifications if (mObserver) { - mObserver->OnStopContainer(nullptr, &mImage); - mObserver->OnStopDecode(nullptr, salvage ? NS_OK : NS_ERROR_FAILURE, nullptr); + mObserver->OnStopDecode(salvage ? NS_OK : NS_ERROR_FAILURE); } } } @@ -167,8 +166,7 @@ Decoder::FlushInvalidations() mInvalidRect.Inflate(1); mInvalidRect = mInvalidRect.Intersect(mImageBound); #endif - bool isCurrentFrame = mImage.GetCurrentFrameIndex() == (mFrameCount - 1); - mObserver->OnDataAvailable(nullptr, isCurrentFrame, &mInvalidRect); + mObserver->OnDataAvailable(&mInvalidRect); } // Clear the invalidation rectangle @@ -199,7 +197,7 @@ Decoder::PostSize(int32_t aWidth, int32_t aHeight) // Notify the observer if (mObserver) - mObserver->OnStartContainer(nullptr, &mImage); + mObserver->OnStartContainer(); } void @@ -222,10 +220,6 @@ Decoder::PostFrameStart() // reported by the Image. NS_ABORT_IF_FALSE(mFrameCount == mImage.GetNumFrames(), "Decoder frame count doesn't match image's!"); - - // Fire notification - if (mObserver) - mObserver->OnStartFrame(nullptr, mFrameCount - 1); // frame # is zero-indexed } void @@ -242,10 +236,10 @@ Decoder::PostFrameStop() // Fire notifications if (mObserver) { - mObserver->OnStopFrame(nullptr, mFrameCount - 1); // frame # is zero-indexed + mObserver->OnStopFrame(); if (mFrameCount > 1 && !mIsAnimated) { mIsAnimated = true; - mObserver->OnImageIsAnimated(nullptr); + mObserver->OnImageIsAnimated(); } } } @@ -278,8 +272,7 @@ Decoder::PostDecodeDone() // Notify mImage.DecodingComplete(); if (mObserver) { - mObserver->OnStopContainer(nullptr, &mImage); - mObserver->OnStopDecode(nullptr, NS_OK, nullptr); + mObserver->OnStopDecode(NS_OK); } } diff --git a/image/src/Image.cpp b/image/src/Image.cpp index 58874eddc8e1..a70def578493 100644 --- a/image/src/Image.cpp +++ b/image/src/Image.cpp @@ -21,7 +21,7 @@ Image::Image(imgStatusTracker* aStatusTracker) : mStatusTracker = aStatusTracker; mStatusTracker->SetImage(this); } else { - mStatusTracker = new imgStatusTracker(this); + mStatusTracker = new imgStatusTracker(this, nullptr); } } diff --git a/image/src/Makefile.in b/image/src/Makefile.in index 93ff99c64858..92ed93a6c9f0 100644 --- a/image/src/Makefile.in +++ b/image/src/Makefile.in @@ -27,6 +27,7 @@ CPPSRCS = \ Decoder.cpp \ DiscardTracker.cpp \ RasterImage.cpp \ + ScriptedNotificationObserver.cpp \ SVGDocumentWrapper.cpp \ VectorImage.cpp \ imgFrame.cpp \ diff --git a/image/src/RasterImage.cpp b/image/src/RasterImage.cpp index 1ad65af1ad28..c7b83afacce0 100644 --- a/image/src/RasterImage.cpp +++ b/image/src/RasterImage.cpp @@ -514,7 +514,7 @@ RasterImage::RequestRefresh(const mozilla::TimeStamp& aTime) #endif UpdateImageContainer(); - observer->FrameChanged(nullptr, this, &dirtyRect); + observer->FrameChanged(&dirtyRect); } } @@ -1500,7 +1500,7 @@ RasterImage::ResetAnimation() // Update display if we were animating before nsCOMPtr observer(do_QueryReferent(mObserver)); if (mAnimating && observer) - observer->FrameChanged(nullptr, this, &(mAnim->firstFrameRefreshArea)); + observer->FrameChanged(&(mAnim->firstFrameRefreshArea)); if (ShouldAnimate()) { StartAnimation(); @@ -2284,7 +2284,7 @@ RasterImage::Discard(bool force) // Notify that we discarded nsCOMPtr observer(do_QueryReferent(mObserver)); if (observer) - observer->OnDiscard(nullptr); + observer->OnDiscard(); if (force) DiscardTracker::Remove(&mDiscardTrackerNode); @@ -2774,7 +2774,7 @@ RasterImage::DrawWorker::Run() imgFrame *scaledFrame = request->dstFrame.get(); scaledFrame->ImageUpdated(scaledFrame->GetRect()); nsIntRect frameRect = request->srcFrame->GetRect(); - observer->FrameChanged(nullptr, request->image, &frameRect); + observer->FrameChanged(&frameRect); } } diff --git a/image/src/ScriptedNotificationObserver.cpp b/image/src/ScriptedNotificationObserver.cpp new file mode 100644 index 000000000000..e1023cbedf47 --- /dev/null +++ b/image/src/ScriptedNotificationObserver.cpp @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "ScriptedNotificationObserver.h" +#include "imgIScriptedNotificationObserver.h" +#include "nsCycleCollectionParticipant.h" + +using namespace mozilla::image; + +NS_IMPL_CYCLE_COLLECTION_1(ScriptedNotificationObserver, mInner) + +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ScriptedNotificationObserver) + NS_INTERFACE_MAP_ENTRY(imgINotificationObserver) + NS_INTERFACE_MAP_ENTRY(nsISupports) +NS_INTERFACE_MAP_END + +NS_IMPL_CYCLE_COLLECTING_ADDREF(ScriptedNotificationObserver) +NS_IMPL_CYCLE_COLLECTING_RELEASE(ScriptedNotificationObserver) + +ScriptedNotificationObserver::ScriptedNotificationObserver( + imgIScriptedNotificationObserver* aInner) +: mInner(aInner) +{ +} + +NS_IMETHODIMP +ScriptedNotificationObserver::Notify(imgIRequest* aRequest, + int32_t aType, + const nsIntRect* /*aUnused*/) +{ + if (aType == imgINotificationObserver::SIZE_AVAILABLE) + return mInner->SizeAvailable(aRequest); + if (aType == imgINotificationObserver::FRAME_UPDATE) + return mInner->FrameUpdate(aRequest); + if (aType == imgINotificationObserver::FRAME_COMPLETE) + return mInner->FrameComplete(aRequest); + if (aType == imgINotificationObserver::DECODE_COMPLETE) + return mInner->DecodeComplete(aRequest); + if (aType == imgINotificationObserver::LOAD_COMPLETE) + return mInner->LoadComplete(aRequest); + if (aType == imgINotificationObserver::DISCARD) + return mInner->Discard(aRequest); + if (aType == imgINotificationObserver::IS_ANIMATED) + return mInner->IsAnimated(aRequest); + return NS_OK; +} diff --git a/image/src/ScriptedNotificationObserver.h b/image/src/ScriptedNotificationObserver.h new file mode 100644 index 000000000000..3907ef89c7d5 --- /dev/null +++ b/image/src/ScriptedNotificationObserver.h @@ -0,0 +1,30 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "imgINotificationObserver.h" +#include "nsCOMPtr.h" +#include "nsCycleCollectionParticipant.h" + +class imgIScriptedNotificationObserver; + +namespace mozilla { +namespace image { + +class ScriptedNotificationObserver : public imgINotificationObserver +{ +public: + ScriptedNotificationObserver(imgIScriptedNotificationObserver* aInner); + virtual ~ScriptedNotificationObserver() {} + + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_IMGINOTIFICATIONOBSERVER + NS_DECL_CYCLE_COLLECTION_CLASS(ScriptedNotificationObserver) + +private: + nsCOMPtr mInner; +}; + +}} diff --git a/image/src/VectorImage.cpp b/image/src/VectorImage.cpp index 32686fc1bd5b..43ed30fd3a82 100644 --- a/image/src/VectorImage.cpp +++ b/image/src/VectorImage.cpp @@ -681,11 +681,11 @@ VectorImage::OnStopRequest(nsIRequest* aRequest, nsISupports* aCtxt, nsCOMPtr observer = do_QueryReferent(mObserver); if (observer) { // NOTE: This signals that width/height are available. - observer->OnStartContainer(nullptr, this); + observer->OnStartContainer(); - observer->FrameChanged(nullptr, this, &nsIntRect::GetMaxSizedIntRect()); - observer->OnStopFrame(nullptr, 0); - observer->OnStopDecode(nullptr, NS_OK, nullptr); + observer->FrameChanged(&nsIntRect::GetMaxSizedIntRect()); + observer->OnStopFrame(); + observer->OnStopDecode(NS_OK); } EvaluateAnimation(); @@ -722,12 +722,12 @@ VectorImage::InvalidateObserver() nsCOMPtr containerObs(do_QueryReferent(mObserver)); if (containerObs) { - containerObs->FrameChanged(nullptr, this, &nsIntRect::GetMaxSizedIntRect()); + containerObs->FrameChanged(&nsIntRect::GetMaxSizedIntRect()); } nsCOMPtr decoderObs(do_QueryReferent(mObserver)); if (decoderObs) { - decoderObs->OnStopFrame(nullptr, imgIContainer::FRAME_CURRENT); + decoderObs->OnStopFrame(); } } diff --git a/image/src/imgLoader.cpp b/image/src/imgLoader.cpp index 8286f65e45de..49211280cb9b 100644 --- a/image/src/imgLoader.cpp +++ b/image/src/imgLoader.cpp @@ -680,7 +680,7 @@ imgCacheQueue::const_iterator imgCacheQueue::end() const } nsresult imgLoader::CreateNewProxyForRequest(imgRequest *aRequest, nsILoadGroup *aLoadGroup, - imgIDecoderObserver *aObserver, + imgINotificationObserver *aObserver, nsLoadFlags aLoadFlags, imgIRequest *aProxyRequest, imgIRequest **_retval) { @@ -708,7 +708,7 @@ nsresult imgLoader::CreateNewProxyForRequest(imgRequest *aRequest, nsILoadGroup aRequest->GetURI(getter_AddRefs(uri)); // init adds itself to imgRequest's list of observers - nsresult rv = proxyRequest->Init(aRequest, aLoadGroup, aRequest->mImage, uri, aObserver); + nsresult rv = proxyRequest->Init(&aRequest->GetStatusTracker(), aLoadGroup, uri, aObserver); if (NS_FAILED(rv)) { NS_RELEASE(proxyRequest); return rv; @@ -1162,7 +1162,7 @@ bool imgLoader::ValidateRequestWithNewChannel(imgRequest *request, nsIURI *aInitialDocumentURI, nsIURI *aReferrerURI, nsILoadGroup *aLoadGroup, - imgIDecoderObserver *aObserver, + imgINotificationObserver *aObserver, nsISupports *aCX, nsLoadFlags aLoadFlags, imgIRequest *aExistingRequest, @@ -1284,7 +1284,7 @@ bool imgLoader::ValidateEntry(imgCacheEntry *aEntry, nsIURI *aInitialDocumentURI, nsIURI *aReferrerURI, nsILoadGroup *aLoadGroup, - imgIDecoderObserver *aObserver, + imgINotificationObserver *aObserver, nsISupports *aCX, nsLoadFlags aLoadFlags, bool aCanMakeNewChannel, @@ -1521,14 +1521,14 @@ nsresult imgLoader::EvictEntries(imgCacheQueue &aQueueToClear) nsIRequest::VALIDATE_ONCE_PER_SESSION) -/* imgIRequest loadImage (in nsIURI aURI, in nsIURI initialDocumentURI, in nsIPrincipal loadingPrincipal, in nsILoadGroup aLoadGroup, in imgIDecoderObserver aObserver, in nsISupports aCX, in nsLoadFlags aLoadFlags, in nsISupports cacheKey, in imgIRequest aRequest); */ +/* imgIRequest loadImage (in nsIURI aURI, in nsIURI initialDocumentURI, in nsIPrincipal loadingPrincipal, in nsILoadGroup aLoadGroup, in imgINotificationObserver aObserver, in nsISupports aCX, in nsLoadFlags aLoadFlags, in nsISupports cacheKey, in imgIRequest aRequest); */ NS_IMETHODIMP imgLoader::LoadImage(nsIURI *aURI, nsIURI *aInitialDocumentURI, nsIURI *aReferrerURI, nsIPrincipal* aLoadingPrincipal, nsILoadGroup *aLoadGroup, - imgIDecoderObserver *aObserver, + imgINotificationObserver *aObserver, nsISupports *aCX, nsLoadFlags aLoadFlags, nsISupports *aCacheKey, @@ -1784,8 +1784,8 @@ NS_IMETHODIMP imgLoader::LoadImage(nsIURI *aURI, return NS_OK; } -/* imgIRequest loadImageWithChannel(in nsIChannel channel, in imgIDecoderObserver aObserver, in nsISupports cx, out nsIStreamListener); */ -NS_IMETHODIMP imgLoader::LoadImageWithChannel(nsIChannel *channel, imgIDecoderObserver *aObserver, nsISupports *aCX, nsIStreamListener **listener, imgIRequest **_retval) +/* imgIRequest loadImageWithChannel(in nsIChannel channel, in imgINotificationObserver aObserver, in nsISupports cx, out nsIStreamListener); */ +NS_IMETHODIMP imgLoader::LoadImageWithChannel(nsIChannel *channel, imgINotificationObserver *aObserver, nsISupports *aCX, nsIStreamListener **listener, imgIRequest **_retval) { NS_ASSERTION(channel, "imgLoader::LoadImageWithChannel -- NULL channel pointer"); diff --git a/image/src/imgLoader.h b/image/src/imgLoader.h index f58cadc865a6..318b7c0d3d5d 100644 --- a/image/src/imgLoader.h +++ b/image/src/imgLoader.h @@ -30,7 +30,7 @@ class imgLoader; class imgRequest; class imgRequestProxy; class imgIRequest; -class imgIDecoderObserver; +class imgINotificationObserver; class nsILoadGroup; class imgCacheExpirationTracker; class imgMemoryReporter; @@ -289,7 +289,7 @@ private: // methods bool ValidateEntry(imgCacheEntry *aEntry, nsIURI *aKey, nsIURI *aInitialDocumentURI, nsIURI *aReferrerURI, nsILoadGroup *aLoadGroup, - imgIDecoderObserver *aObserver, nsISupports *aCX, + imgINotificationObserver *aObserver, nsISupports *aCX, nsLoadFlags aLoadFlags, bool aCanMakeNewChannel, imgIRequest *aExistingRequest, imgIRequest **aProxyRequest, @@ -300,7 +300,7 @@ private: // methods nsIURI *aInitialDocumentURI, nsIURI *aReferrerURI, nsILoadGroup *aLoadGroup, - imgIDecoderObserver *aObserver, + imgINotificationObserver *aObserver, nsISupports *aCX, nsLoadFlags aLoadFlags, imgIRequest *aExistingRequest, imgIRequest **aProxyRequest, @@ -309,7 +309,7 @@ private: // methods int32_t aCORSMode); nsresult CreateNewProxyForRequest(imgRequest *aRequest, nsILoadGroup *aLoadGroup, - imgIDecoderObserver *aObserver, + imgINotificationObserver *aObserver, nsLoadFlags aLoadFlags, imgIRequest *aRequestProxy, imgIRequest **_retval); diff --git a/image/src/imgRequest.cpp b/image/src/imgRequest.cpp index 49d31eeee37f..d8d991fbc7e1 100644 --- a/image/src/imgRequest.cpp +++ b/image/src/imgRequest.cpp @@ -71,16 +71,15 @@ InitPrefCaches() PRLogModuleInfo *gImgLog = PR_NewLogModule("imgRequest"); #endif -NS_IMPL_ISUPPORTS8(imgRequest, - imgIDecoderObserver, imgIContainerObserver, +NS_IMPL_ISUPPORTS5(imgRequest, nsIStreamListener, nsIRequestObserver, - nsISupportsWeakReference, nsIChannelEventSink, nsIInterfaceRequestor, nsIAsyncVerifyRedirectCallback) imgRequest::imgRequest(imgLoader* aLoader) : mLoader(aLoader) + , mStatusTracker(new imgStatusTracker(nullptr, this)) , mValidator(nullptr) , mImageSniffers("image-sniffing-services") , mInnerWindowId(0) @@ -89,7 +88,6 @@ imgRequest::imgRequest(imgLoader* aLoader) , mIsMultiPartChannel(false) , mGotData(false) , mIsInCache(false) - , mBlockingOnload(false) , mResniffMimeType(false) { // Register our pref observers if we haven't yet. @@ -127,8 +125,6 @@ nsresult imgRequest::Init(nsIURI *aURI, mProperties = do_CreateInstance("@mozilla.org/properties;1"); - mStatusTracker = new imgStatusTracker(nullptr); - mURI = aURI; mCurrentURI = aCurrentURI; mRequest = aRequest; @@ -176,6 +172,13 @@ bool imgRequest::HasCacheEntry() const return mCacheEntry != nullptr; } +void imgRequest::ResetCacheEntry() +{ + if (HasCacheEntry()) { + mCacheEntry->SetDataSize(0); + } +} + void imgRequest::AddProxy(imgRequestProxy *proxy) { NS_PRECONDITION(proxy, "null imgRequestProxy passed in"); @@ -183,21 +186,12 @@ void imgRequest::AddProxy(imgRequestProxy *proxy) // If we're empty before adding, we have to tell the loader we now have // proxies. - if (mObservers.IsEmpty()) { + if (GetStatusTracker().ConsumerCount() == 0) { NS_ABORT_IF_FALSE(mURI, "Trying to SetHasProxies without key uri."); mLoader->SetHasProxies(mURI); } - // If we don't have any current observers, we should restart any animation. - if (mImage && !HaveProxyWithObserver(proxy) && proxy->HasObserver()) { - LOG_MSG(gImgLog, "imgRequest::AddProxy", "resetting animation"); - - mImage->ResetAnimation(); - } - - proxy->SetPrincipal(mPrincipal); - - mObservers.AppendElementUnlessExists(proxy); + GetStatusTracker().AddConsumer(proxy); } nsresult imgRequest::RemoveProxy(imgRequestProxy *proxy, nsresult aStatus) @@ -209,20 +203,15 @@ nsresult imgRequest::RemoveProxy(imgRequestProxy *proxy, nsresult aStatus) // have animation consumers. proxy->ClearAnimationConsumers(); - if (!mObservers.RemoveElement(proxy)) { - // Not one of our proxies; we're done - return NS_OK; - } - // Let the status tracker do its thing before we potentially call Cancel() // below, because Cancel() may result in OnStopRequest being called back // before Cancel() returns, leaving the image in a different state then the // one it was in at this point. - imgStatusTracker& statusTracker = GetStatusTracker(); - statusTracker.EmulateRequestFinished(proxy, aStatus); + if (!statusTracker.RemoveConsumer(proxy, aStatus)) + return NS_OK; - if (mObservers.IsEmpty()) { + if (statusTracker.ConsumerCount() == 0) { // If we have no observers, there's nothing holding us alive. If we haven't // been cancelled and thus removed from the cache, tell the image loader so // we can be evicted from the cache. @@ -242,7 +231,7 @@ nsresult imgRequest::RemoveProxy(imgRequestProxy *proxy, nsresult aStatus) /* If |aStatus| is a failure code, then cancel the load if it is still in progress. Otherwise, let the load continue, keeping 'this' in the cache with no observers. This way, if a proxy is destroyed without calling cancel on it, it won't leak - and won't leave a bad pointer in mObservers. + and won't leave a bad pointer in the observer list. */ if (statusTracker.IsLoading() && NS_FAILED(aStatus)) { LOG_MSG(gImgLog, "imgRequest::RemoveProxy", "load in progress. canceling"); @@ -285,16 +274,7 @@ void imgRequest::Cancel(nsresult aStatus) imgStatusTracker& statusTracker = GetStatusTracker(); - if (mBlockingOnload) { - mBlockingOnload = false; - - statusTracker.RecordUnblockOnload(); - - nsTObserverArray::ForwardIterator iter(mObservers); - while (iter.HasMore()) { - statusTracker.SendUnblockOnload(iter.GetNext()); - } - } + statusTracker.MaybeUnblockOnload(); statusTracker.RecordCancel(); @@ -342,24 +322,6 @@ void imgRequest::RemoveFromCache() mCacheEntry = nullptr; } -bool imgRequest::HaveProxyWithObserver(imgRequestProxy* aProxyToIgnore) const -{ - nsTObserverArray::ForwardIterator iter(mObservers); - imgRequestProxy* proxy; - while (iter.HasMore()) { - proxy = iter.GetNext(); - if (proxy == aProxyToIgnore) { - continue; - } - - if (proxy->HasObserver()) { - return true; - } - } - - return false; -} - int32_t imgRequest::Priority() const { int32_t priority = nsISupportsPriority::PRIORITY_NORMAL; @@ -378,7 +340,7 @@ void imgRequest::AdjustPriority(imgRequestProxy *proxy, int32_t delta) // concern though is that image loads remain lower priority than other pieces // of content such as link clicks, CSS, and JS. // - if (mObservers.SafeElementAt(0, nullptr) != proxy) + if (!GetStatusTracker().FirstConsumerIs(proxy)) return; nsCOMPtr p = do_QueryInterface(mRequest); @@ -510,289 +472,6 @@ imgRequest::StartDecoding() return NS_OK; } - - -/** imgIContainerObserver methods **/ - -/* [noscript] void frameChanged (in imgIRequest request, - in imgIContainer container, - in nsIntRect dirtyRect); */ -NS_IMETHODIMP imgRequest::FrameChanged(imgIRequest *request, - imgIContainer *container, - const nsIntRect *dirtyRect) -{ - LOG_SCOPE(gImgLog, "imgRequest::FrameChanged"); - NS_ABORT_IF_FALSE(mImage, - "FrameChanged callback before we've created our image"); - - mImage->GetStatusTracker().RecordFrameChanged(container, dirtyRect); - - nsTObserverArray::ForwardIterator iter(mObservers); - while (iter.HasMore()) { - mImage->GetStatusTracker().SendFrameChanged(iter.GetNext(), container, dirtyRect); - } - - return NS_OK; -} - -/** imgIDecoderObserver methods **/ - -/* void onStartDecode (in imgIRequest request); */ -NS_IMETHODIMP imgRequest::OnStartDecode(imgIRequest *request) -{ - LOG_SCOPE(gImgLog, "imgRequest::OnStartDecode"); - NS_ABORT_IF_FALSE(mImage, - "OnStartDecode callback before we've created our image"); - - - imgStatusTracker& tracker = mImage->GetStatusTracker(); - tracker.RecordStartDecode(); - - nsTObserverArray::ForwardIterator iter(mObservers); - while (iter.HasMore()) { - tracker.SendStartDecode(iter.GetNext()); - } - - if (!mIsMultiPartChannel) { - MOZ_ASSERT(!mBlockingOnload); - mBlockingOnload = true; - - tracker.RecordBlockOnload(); - - nsTObserverArray::ForwardIterator iter(mObservers); - while (iter.HasMore()) { - tracker.SendBlockOnload(iter.GetNext()); - } - } - - /* In the case of streaming jpegs, it is possible to get multiple OnStartDecodes which - indicates the beginning of a new decode. - The cache entry's size therefore needs to be reset to 0 here. If we do not do this, - the code in imgRequest::OnStopFrame will continue to increase the data size cumulatively. - */ - if (mCacheEntry) - mCacheEntry->SetDataSize(0); - - return NS_OK; -} - -NS_IMETHODIMP imgRequest::OnStartRequest(imgIRequest *aRequest) -{ - NS_NOTREACHED("imgRequest(imgIDecoderObserver)::OnStartRequest"); - return NS_OK; -} - -/* void onStartContainer (in imgIRequest request, in imgIContainer image); */ -NS_IMETHODIMP imgRequest::OnStartContainer(imgIRequest *request, imgIContainer *image) -{ - LOG_SCOPE(gImgLog, "imgRequest::OnStartContainer"); - - NS_ASSERTION(image, "imgRequest::OnStartContainer called with a null image!"); - if (!image) return NS_ERROR_UNEXPECTED; - - NS_ABORT_IF_FALSE(mImage, - "OnStartContainer callback before we've created our image"); - NS_ABORT_IF_FALSE(image == mImage, - "OnStartContainer callback from an image we don't own"); - mImage->GetStatusTracker().RecordStartContainer(image); - - nsTObserverArray::ForwardIterator iter(mObservers); - while (iter.HasMore()) { - mImage->GetStatusTracker().SendStartContainer(iter.GetNext(), image); - } - - return NS_OK; -} - -/* void onStartFrame (in imgIRequest request, in unsigned long frame); */ -NS_IMETHODIMP imgRequest::OnStartFrame(imgIRequest *request, - uint32_t frame) -{ - LOG_SCOPE(gImgLog, "imgRequest::OnStartFrame"); - NS_ABORT_IF_FALSE(mImage, - "OnStartFrame callback before we've created our image"); - - mImage->GetStatusTracker().RecordStartFrame(frame); - - nsTObserverArray::ForwardIterator iter(mObservers); - while (iter.HasMore()) { - mImage->GetStatusTracker().SendStartFrame(iter.GetNext(), frame); - } - - return NS_OK; -} - -/* [noscript] void onDataAvailable (in imgIRequest request, in boolean aCurrentFrame, [const] in nsIntRect rect); */ -NS_IMETHODIMP imgRequest::OnDataAvailable(imgIRequest *request, - bool aCurrentFrame, - const nsIntRect * rect) -{ - LOG_SCOPE(gImgLog, "imgRequest::OnDataAvailable"); - NS_ABORT_IF_FALSE(mImage, - "OnDataAvailable callback before we've created our image"); - - mImage->GetStatusTracker().RecordDataAvailable(aCurrentFrame, rect); - - nsTObserverArray::ForwardIterator iter(mObservers); - while (iter.HasMore()) { - mImage->GetStatusTracker().SendDataAvailable(iter.GetNext(), aCurrentFrame, rect); - } - - return NS_OK; -} - -/* void onStopFrame (in imgIRequest request, in unsigned long frame); */ -NS_IMETHODIMP imgRequest::OnStopFrame(imgIRequest *request, - uint32_t frame) -{ - LOG_SCOPE(gImgLog, "imgRequest::OnStopFrame"); - NS_ABORT_IF_FALSE(mImage, - "OnStopFrame callback before we've created our image"); - - imgStatusTracker& tracker = mImage->GetStatusTracker(); - tracker.RecordStopFrame(frame); - - nsTObserverArray::ForwardIterator iter(mObservers); - while (iter.HasMore()) { - tracker.SendStopFrame(iter.GetNext(), frame); - } - - if (mBlockingOnload) { - mBlockingOnload = false; - - tracker.RecordUnblockOnload(); - - nsTObserverArray::ForwardIterator iter(mObservers); - while (iter.HasMore()) { - tracker.SendUnblockOnload(iter.GetNext()); - } - } - - return NS_OK; -} - -/* void onStopContainer (in imgIRequest request, in imgIContainer image); */ -NS_IMETHODIMP imgRequest::OnStopContainer(imgIRequest *request, - imgIContainer *image) -{ - LOG_SCOPE(gImgLog, "imgRequest::OnStopContainer"); - NS_ABORT_IF_FALSE(mImage, - "OnDataContainer callback before we've created our image"); - - imgStatusTracker& tracker = mImage->GetStatusTracker(); - tracker.RecordStopContainer(image); - - nsTObserverArray::ForwardIterator iter(mObservers); - while (iter.HasMore()) { - tracker.SendStopContainer(iter.GetNext(), image); - } - - // This is really hacky. We need to handle the case where we start decoding, - // block onload, but then hit an error before we get to our first frame. In - // theory we would just hook in at OnStopDecode, but OnStopDecode is broken - // until we fix bug 505385. OnStopContainer is actually going away at that - // point. So for now we take advantage of the fact that OnStopContainer is - // always fired in the decoders at the same time as OnStopDecode. - if (mBlockingOnload) { - mBlockingOnload = false; - - tracker.RecordUnblockOnload(); - - nsTObserverArray::ForwardIterator iter(mObservers); - while (iter.HasMore()) { - tracker.SendUnblockOnload(iter.GetNext()); - } - } - - return NS_OK; -} - -/* void onStopDecode (in imgIRequest request, in nsresult status, in wstring statusArg); */ -NS_IMETHODIMP imgRequest::OnStopDecode(imgIRequest *aRequest, - nsresult aStatus, - const PRUnichar *aStatusArg) -{ - LOG_SCOPE(gImgLog, "imgRequest::OnStopDecode"); - NS_ABORT_IF_FALSE(mImage, - "OnDataDecode callback before we've created our image"); - - // We finished the decode, and thus have the decoded frames. Update the cache - // entry size to take this into account. - UpdateCacheEntrySize(); - - mImage->GetStatusTracker().RecordStopDecode(aStatus, aStatusArg); - - nsTObserverArray::ForwardIterator iter(mObservers); - while (iter.HasMore()) { - mImage->GetStatusTracker().SendStopDecode(iter.GetNext(), aStatus, - aStatusArg); - } - - if (NS_FAILED(aStatus)) { - // Some kind of problem has happened with image decoding. - // Report the URI to net:failed-to-process-uri-conent observers. - - nsCOMPtr os = mozilla::services::GetObserverService(); - if (os) - os->NotifyObservers(mURI, "net:failed-to-process-uri-content", nullptr); - } - - // RasterImage and everything below it is completely correct and - // bulletproof about its handling of decoder notifications. - // Unfortunately, here and above we have to make some gross and - // inappropriate use of things to get things to work without - // completely overhauling the decoder observer interface (this will, - // thankfully, happen in bug 505385). From imgRequest and above (for - // the time being), OnStopDecode is just a companion to OnStopRequest - // that signals success or failure of the _load_ (not the _decode_). - // Within imgStatusTracker, we ignore OnStopDecode notifications from the - // decoder and RasterImage and generate our own every time we send - // OnStopRequest. From within SendStopDecode, we actually send - // OnStopContainer. For more information, see bug 435296. - - return NS_OK; -} - -NS_IMETHODIMP imgRequest::OnStopRequest(imgIRequest *aRequest, - bool aLastPart) -{ - NS_NOTREACHED("imgRequest(imgIDecoderObserver)::OnStopRequest"); - return NS_OK; -} - -/* void onDiscard (in imgIRequest request); */ -NS_IMETHODIMP imgRequest::OnDiscard(imgIRequest *aRequest) -{ - NS_ABORT_IF_FALSE(mImage, - "OnDiscard callback before we've created our image"); - - mImage->GetStatusTracker().RecordDiscard(); - - // Update the cache entry size, since we just got rid of frame data - UpdateCacheEntrySize(); - - nsTObserverArray::ForwardIterator iter(mObservers); - while (iter.HasMore()) { - mImage->GetStatusTracker().SendDiscard(iter.GetNext()); - } - - return NS_OK; -} - -NS_IMETHODIMP imgRequest::OnImageIsAnimated(imgIRequest *aRequest) -{ - NS_ABORT_IF_FALSE(mImage, - "OnImageIsAnimated callback before we've created our image"); - mImage->GetStatusTracker().RecordImageIsAnimated(); - - nsTObserverArray::ForwardIterator iter(mObservers); - while (iter.HasMore()) { - mImage->GetStatusTracker().SendImageIsAnimated(iter.GetNext()); - } - - return NS_OK; -} - /** nsIRequestObserver methods **/ /* void onStartRequest (in nsIRequest request, in nsISupports ctxt); */ @@ -838,18 +517,12 @@ NS_IMETHODIMP imgRequest::OnStartRequest(nsIRequest *aRequest, nsISupports *ctxt mRequest = chan; } - imgStatusTracker& statusTracker = GetStatusTracker(); - statusTracker.RecordStartRequest(); + GetStatusTracker().OnStartRequest(); nsCOMPtr channel(do_QueryInterface(aRequest)); if (channel) channel->GetSecurityInfo(getter_AddRefs(mSecurityInfo)); - nsTObserverArray::ForwardIterator iter(mObservers); - while (iter.HasMore()) { - statusTracker.SendStartRequest(iter.GetNext()); - } - /* Get our principal */ nsCOMPtr chan(do_QueryInterface(aRequest)); if (chan) { @@ -861,19 +534,13 @@ NS_IMETHODIMP imgRequest::OnStartRequest(nsIRequest *aRequest, nsISupports *ctxt if (NS_FAILED(rv)) { return rv; } - - // Tell all of our proxies that we have a principal. - nsTObserverArray::ForwardIterator iter(mObservers); - while (iter.HasMore()) { - iter.GetNext()->SetPrincipal(mPrincipal); - } } } SetCacheValidation(mCacheEntry, aRequest); // Shouldn't we be dead already if this gets hit? Probably multipart/x-mixed-replace... - if (mObservers.IsEmpty()) { + if (GetStatusTracker().ConsumerCount() == 0) { this->Cancel(NS_IMAGELIB_ERROR_FAILURE); } @@ -943,11 +610,7 @@ NS_IMETHODIMP imgRequest::OnStopRequest(nsIRequest *aRequest, nsISupports *ctxt, this->Cancel(status); } - /* notify the kids */ - nsTObserverArray::ForwardIterator srIter(mObservers); - while (srIter.HasMore()) { - statusTracker.SendStopRequest(srIter.GetNext(), lastPart, status); - } + GetStatusTracker().OnStopRequest(lastPart, status); mTimedChannel = nullptr; return NS_OK; @@ -1033,7 +696,9 @@ imgRequest::OnDataAvailable(nsIRequest *aRequest, nsISupports *ctxt, // our own any more. if (mResniffMimeType) { NS_ABORT_IF_FALSE(mIsMultiPartChannel, "Resniffing a non-multipart image"); - mStatusTracker = new imgStatusTracker(nullptr); + imgStatusTracker* freshTracker = new imgStatusTracker(nullptr, this); + freshTracker->AdoptConsumers(&GetStatusTracker()); + mStatusTracker = freshTracker; } mResniffMimeType = false; @@ -1046,11 +711,7 @@ imgRequest::OnDataAvailable(nsIRequest *aRequest, nsISupports *ctxt, } mImage->SetInnerWindowID(mInnerWindowId); - // Notify any imgRequestProxys that are observing us that we have an Image. - nsTObserverArray::ForwardIterator iter(mObservers); - while (iter.HasMore()) { - iter.GetNext()->SetImage(mImage); - } + GetStatusTracker().OnDataAvailable(); /* set our mimetype as a property */ nsCOMPtr contentType(do_CreateInstance("@mozilla.org/supports-cstring;1")); @@ -1119,7 +780,8 @@ imgRequest::OnDataAvailable(nsIRequest *aRequest, nsISupports *ctxt, // Initialize the image that we created above. For RasterImages, this // instantiates a decoder behind the scenes, so if we don't have a decoder // for this mimetype we'll find out about it here. - rv = mImage->Init(this, mContentType.get(), uriString.get(), imageFlags); + rv = mImage->Init(GetStatusTracker().GetDecoderObserver(), + mContentType.get(), uriString.get(), imageFlags); // We allow multipart images to fail to initialize without cancelling the // load because subsequent images might be fine. diff --git a/image/src/imgRequest.h b/image/src/imgRequest.h index 17398148f8ea..f4fc28509aaf 100644 --- a/image/src/imgRequest.h +++ b/image/src/imgRequest.h @@ -7,8 +7,6 @@ #ifndef imgRequest_h__ #define imgRequest_h__ -#include "imgIDecoderObserver.h" - #include "nsIChannelEventSink.h" #include "nsIContentSniffer.h" #include "nsIInterfaceRequestor.h" @@ -22,8 +20,6 @@ #include "nsCategoryCache.h" #include "nsCOMPtr.h" #include "nsStringGlue.h" -#include "nsTObserverArray.h" -#include "nsWeakReference.h" #include "nsError.h" #include "imgIRequest.h" #include "nsIAsyncVerifyRedirectCallback.h" @@ -42,9 +38,7 @@ class Image; } // namespace image } // namespace mozilla -class imgRequest : public imgIDecoderObserver, - public nsIStreamListener, - public nsSupportsWeakReference, +class imgRequest : public nsIStreamListener, public nsIChannelEventSink, public nsIInterfaceRequestor, public nsIAsyncVerifyRedirectCallback @@ -110,6 +104,22 @@ public: return principal.forget(); } + // Return the imgStatusTracker associated with this imgRequest. It may live + // in |mStatusTracker| or in |mImage.mStatusTracker|, depending on whether + // mImage has been instantiated yet. + imgStatusTracker& GetStatusTracker(); + + // Get the current principal of the image. No AddRefing. + inline nsIPrincipal* GetPrincipal() const { return mPrincipal.get(); }; + + // Resize the cache entry to 0 if it exists + void ResetCacheEntry(); + + // Update the cache entry size based on the image container + void UpdateCacheEntrySize(); + + nsresult GetURI(nsIURI **aURI); + private: friend class imgCacheEntry; friend class imgRequestProxy; @@ -125,7 +135,6 @@ private: void Cancel(nsresult aStatus); void RemoveFromCache(); - nsresult GetURI(nsIURI **aURI); nsresult GetSecurityInfo(nsISupports **aSecurityInfo); inline const char *GetMimeType() const { @@ -134,11 +143,6 @@ private: inline nsIProperties *Properties() { return mProperties; } - - // Return the imgStatusTracker associated with this imgRequest. It may live - // in |mStatusTracker| or in |mImage.mStatusTracker|, depending on whether - // mImage has been instantiated yet.. - imgStatusTracker& GetStatusTracker(); // Reset the cache entry after we've dropped our reference to it. Used by the // imgLoader when our cache entry is re-requested after we've dropped our @@ -148,10 +152,6 @@ private: // Returns whether we've got a reference to the cache entry. bool HasCacheEntry() const; - // Return true if at least one of our proxies, excluding - // aProxyToIgnore, has an observer. aProxyToIgnore may be null. - bool HaveProxyWithObserver(imgRequestProxy* aProxyToIgnore) const; - // Return the priority of the underlying network request, or return // PRIORITY_NORMAL if it doesn't support nsISupportsPriority. int32_t Priority() const; @@ -168,12 +168,10 @@ private: // try to update or modify the image cache. void SetIsInCache(bool cacheable); - // Update the cache entry size based on the image container - void UpdateCacheEntrySize(); + bool IsBlockingOnload() const; + void SetBlockingOnload(bool block) const; public: - NS_DECL_IMGIDECODEROBSERVER - NS_DECL_IMGICONTAINEROBSERVER NS_DECL_NSISTREAMLISTENER NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSICHANNELEVENTSINK @@ -203,8 +201,6 @@ private: nsCOMPtr mChannel; nsCOMPtr mPrevChannelSink; - nsTObserverArray mObservers; - nsCOMPtr mTimedChannel; nsCString mContentType; diff --git a/image/src/imgRequestProxy.cpp b/image/src/imgRequestProxy.cpp index 9190101e216e..a4048c5bd4cd 100644 --- a/image/src/imgRequestProxy.cpp +++ b/image/src/imgRequestProxy.cpp @@ -40,8 +40,6 @@ NS_INTERFACE_MAP_END imgRequestProxy::imgRequestProxy() : mOwner(nullptr), mURI(nullptr), - mImage(nullptr), - mPrincipal(nullptr), mListener(nullptr), mLoadFlags(nsIRequest::LOAD_NORMAL), mLockCount(0), @@ -51,7 +49,8 @@ imgRequestProxy::imgRequestProxy() : mListenerIsStrongRef(false), mDecodeRequested(false), mDeferNotifications(false), - mSentStartContainer(false) + mSentStartContainer(false), + mOwnerHasImage(false) { /* member initializers and constructor code */ @@ -89,16 +88,18 @@ imgRequestProxy::~imgRequestProxy() } } -nsresult imgRequestProxy::Init(imgRequest* request, nsILoadGroup* aLoadGroup, Image* aImage, - nsIURI* aURI, imgIDecoderObserver* aObserver) +nsresult imgRequestProxy::Init(imgStatusTracker* aStatusTracker, + nsILoadGroup* aLoadGroup, + nsIURI* aURI, imgINotificationObserver* aObserver) { NS_PRECONDITION(!mOwner && !mListener, "imgRequestProxy is already initialized"); - LOG_SCOPE_WITH_PARAM(gImgLog, "imgRequestProxy::Init", "request", request); + LOG_SCOPE_WITH_PARAM(gImgLog, "imgRequestProxy::Init", "request", aStatusTracker->GetRequest()); NS_ABORT_IF_FALSE(mAnimationConsumers == 0, "Cannot have animation before Init"); - mOwner = request; + mOwner = aStatusTracker->GetRequest(); + mOwnerHasImage = !!aStatusTracker->GetImage(); mListener = aObserver; // Make sure to addref mListener before the AddProxy call below, since // that call might well want to release it if the imgRequest has @@ -108,7 +109,6 @@ nsresult imgRequestProxy::Init(imgRequest* request, nsILoadGroup* aLoadGroup, Im NS_ADDREF(mListener); } mLoadGroup = aLoadGroup; - mImage = aImage; mURI = aURI; // Note: AddProxy won't send all the On* notifications immediately @@ -132,9 +132,9 @@ nsresult imgRequestProxy::ChangeOwner(imgRequest *aNewOwner) uint32_t oldAnimationConsumers = mAnimationConsumers; ClearAnimationConsumers(); - // Even if we are cancelled, we MUST change our image, because the image - // holds our status, and the status must always be correct. - mImage = aNewOwner->mImage; + nsRefPtr oldOwner = mOwner; + mOwner = aNewOwner; + mOwnerHasImage = !!GetStatusTracker().GetImage(); // If we were locked, apply the locks here for (uint32_t i = 0; i < oldLockCount; i++) @@ -151,13 +151,12 @@ nsresult imgRequestProxy::ChangeOwner(imgRequest *aNewOwner) // Were we decoded before? bool wasDecoded = false; - if (mImage && - (mImage->GetStatusTracker().GetImageStatus() & - imgIRequest::STATUS_FRAME_COMPLETE)) { + if (GetImage() && + (GetStatusTracker().GetImageStatus() & imgIRequest::STATUS_FRAME_COMPLETE)) { wasDecoded = true; } - mOwner->RemoveProxy(this, NS_IMAGELIB_CHANGING_OWNER); + oldOwner->RemoveProxy(this, NS_IMAGELIB_CHANGING_OWNER); // If we had animation requests, restore them here. Note that we // do this *after* RemoveProxy, which clears out animation consumers @@ -165,8 +164,6 @@ nsresult imgRequestProxy::ChangeOwner(imgRequest *aNewOwner) for (uint32_t i = 0; i < oldAnimationConsumers; i++) IncrementAnimationConsumers(); - mOwner = aNewOwner; - mOwner->AddProxy(this); // If we were decoded, or if we'd previously requested a decode, request a @@ -329,8 +326,8 @@ NS_IMETHODIMP imgRequestProxy::LockImage() { mLockCount++; - if (mImage) - return mImage->LockImage(); + if (GetImage()) + return GetImage()->LockImage(); return NS_OK; } @@ -341,8 +338,8 @@ imgRequestProxy::UnlockImage() NS_ABORT_IF_FALSE(mLockCount > 0, "calling unlock but no locks!"); mLockCount--; - if (mImage) - return mImage->UnlockImage(); + if (GetImage()) + return GetImage()->UnlockImage(); return NS_OK; } @@ -350,9 +347,8 @@ imgRequestProxy::UnlockImage() NS_IMETHODIMP imgRequestProxy::RequestDiscard() { - if (mImage) { - return mImage->RequestDiscard(); - } + if (GetImage()) + return GetImage()->RequestDiscard(); return NS_OK; } @@ -360,8 +356,8 @@ NS_IMETHODIMP imgRequestProxy::IncrementAnimationConsumers() { mAnimationConsumers++; - if (mImage) - mImage->IncrementAnimationConsumers(); + if (GetImage()) + GetImage()->IncrementAnimationConsumers(); return NS_OK; } @@ -376,8 +372,8 @@ imgRequestProxy::DecrementAnimationConsumers() // early, but not the observer.) if (mAnimationConsumers > 0) { mAnimationConsumers--; - if (mImage) - mImage->DecrementAnimationConsumers(); + if (GetImage()) + GetImage()->DecrementAnimationConsumers(); } return NS_OK; } @@ -434,7 +430,7 @@ NS_IMETHODIMP imgRequestProxy::GetImage(imgIContainer * *aImage) // that'll happen if we get Canceled before the owner instantiates its image // (because Canceling unregisters us as a listener on mOwner). If we're // in that situation, just grab the image off of mOwner. - imgIContainer* imageToReturn = mImage ? mImage : mOwner->mImage; + imgIContainer* imageToReturn = GetImage() ? GetImage() : mOwner->mImage.get(); if (!imageToReturn) return NS_ERROR_FAILURE; @@ -463,11 +459,11 @@ NS_IMETHODIMP imgRequestProxy::GetURI(nsIURI **aURI) return NS_OK; } -/* readonly attribute imgIDecoderObserver decoderObserver; */ -NS_IMETHODIMP imgRequestProxy::GetDecoderObserver(imgIDecoderObserver **aDecoderObserver) +/* readonly attribute imgINotificationObserver notificationObserver; */ +NS_IMETHODIMP imgRequestProxy::GetNotificationObserver(imgINotificationObserver **aObserver) { - *aDecoderObserver = mListener; - NS_IF_ADDREF(*aDecoderObserver); + *aObserver = mListener; + NS_IF_ADDREF(*aObserver); return NS_OK; } @@ -486,15 +482,35 @@ NS_IMETHODIMP imgRequestProxy::GetMimeType(char **aMimeType) return NS_OK; } -NS_IMETHODIMP imgRequestProxy::Clone(imgIDecoderObserver* aObserver, +static imgRequestProxy* NewProxy(imgRequestProxy* /*aThis*/) +{ + return new imgRequestProxy(); +} + +imgRequestProxy* NewStaticProxy(imgRequestProxy* aThis) +{ + nsCOMPtr currentPrincipal; + aThis->GetImagePrincipal(getter_AddRefs(currentPrincipal)); + return new imgRequestProxyStatic( + static_cast(aThis)->mImage, currentPrincipal); +} + +NS_IMETHODIMP imgRequestProxy::Clone(imgINotificationObserver* aObserver, imgIRequest** aClone) +{ + return PerformClone(aObserver, NewProxy, aClone); +} + +nsresult imgRequestProxy::PerformClone(imgINotificationObserver* aObserver, + imgRequestProxy* (aAllocFn)(imgRequestProxy*), + imgIRequest** aClone) { NS_PRECONDITION(aClone, "Null out param"); LOG_SCOPE(gImgLog, "imgRequestProxy::Clone"); *aClone = nullptr; - nsRefPtr clone = new imgRequestProxy(); + nsRefPtr clone = aAllocFn(this); // It is important to call |SetLoadFlags()| before calling |Init()| because // |Init()| adds the request to the loadgroup. @@ -503,14 +519,10 @@ NS_IMETHODIMP imgRequestProxy::Clone(imgIDecoderObserver* aObserver, // XXXldb That's not true anymore. Stuff from imgLoader adds the // request to the loadgroup. clone->SetLoadFlags(mLoadFlags); - nsresult rv = clone->Init(mOwner, mLoadGroup, - mImage ? mImage : mOwner->mImage, - mURI, aObserver); + nsresult rv = clone->Init(&GetStatusTracker(), mLoadGroup, mURI, aObserver); if (NS_FAILED(rv)) return rv; - clone->SetPrincipal(mPrincipal); - // Assign to *aClone before calling Notify so that if the caller expects to // only be notified for requests it's already holding pointers to it won't be // surprised. @@ -526,11 +538,10 @@ NS_IMETHODIMP imgRequestProxy::Clone(imgIDecoderObserver* aObserver, /* readonly attribute nsIPrincipal imagePrincipal; */ NS_IMETHODIMP imgRequestProxy::GetImagePrincipal(nsIPrincipal **aPrincipal) { - if (!mPrincipal) + if (!mOwner) return NS_ERROR_FAILURE; - NS_ADDREF(*aPrincipal = mPrincipal); - + NS_ADDREF(*aPrincipal = mOwner->GetPrincipal()); return NS_OK; } @@ -601,102 +612,55 @@ NS_IMETHODIMP imgRequestProxy::GetHasTransferredData(bool* hasData) return NS_OK; } -/** imgIContainerObserver methods **/ - -void imgRequestProxy::FrameChanged(imgIContainer *container, - const nsIntRect *dirtyRect) -{ - LOG_FUNC(gImgLog, "imgRequestProxy::FrameChanged"); - - if (mListener && !mCanceled) { - // Hold a ref to the listener while we call it, just in case. - nsCOMPtr kungFuDeathGrip(mListener); - mListener->FrameChanged(this, container, dirtyRect); - } -} - /** imgIDecoderObserver methods **/ -void imgRequestProxy::OnStartDecode() -{ - LOG_FUNC(gImgLog, "imgRequestProxy::OnStartDecode"); - - if (mListener && !mCanceled) { - // Hold a ref to the listener while we call it, just in case. - nsCOMPtr kungFuDeathGrip(mListener); - mListener->OnStartDecode(this); - } -} - -void imgRequestProxy::OnStartContainer(imgIContainer *image) +void imgRequestProxy::OnStartContainer() { LOG_FUNC(gImgLog, "imgRequestProxy::OnStartContainer"); if (mListener && !mCanceled && !mSentStartContainer) { // Hold a ref to the listener while we call it, just in case. - nsCOMPtr kungFuDeathGrip(mListener); - mListener->OnStartContainer(this, image); + nsCOMPtr kungFuDeathGrip(mListener); + mListener->Notify(this, imgINotificationObserver::SIZE_AVAILABLE, nullptr); mSentStartContainer = true; } } -void imgRequestProxy::OnStartFrame(uint32_t frame) -{ - LOG_FUNC(gImgLog, "imgRequestProxy::OnStartFrame"); - - if (mListener && !mCanceled) { - // Hold a ref to the listener while we call it, just in case. - nsCOMPtr kungFuDeathGrip(mListener); - mListener->OnStartFrame(this, frame); - } -} - -void imgRequestProxy::OnDataAvailable(bool aCurrentFrame, const nsIntRect * rect) +void imgRequestProxy::OnFrameUpdate(const nsIntRect * rect) { LOG_FUNC(gImgLog, "imgRequestProxy::OnDataAvailable"); if (mListener && !mCanceled) { // Hold a ref to the listener while we call it, just in case. - nsCOMPtr kungFuDeathGrip(mListener); - mListener->OnDataAvailable(this, aCurrentFrame, rect); + nsCOMPtr kungFuDeathGrip(mListener); + mListener->Notify(this, imgINotificationObserver::FRAME_UPDATE, rect); } } -void imgRequestProxy::OnStopFrame(uint32_t frame) +void imgRequestProxy::OnStopFrame() { LOG_FUNC(gImgLog, "imgRequestProxy::OnStopFrame"); if (mListener && !mCanceled) { // Hold a ref to the listener while we call it, just in case. - nsCOMPtr kungFuDeathGrip(mListener); - mListener->OnStopFrame(this, frame); + nsCOMPtr kungFuDeathGrip(mListener); + mListener->Notify(this, imgINotificationObserver::FRAME_COMPLETE, nullptr); } } -void imgRequestProxy::OnStopContainer(imgIContainer *image) -{ - LOG_FUNC(gImgLog, "imgRequestProxy::OnStopContainer"); - - if (mListener && !mCanceled) { - // Hold a ref to the listener while we call it, just in case. - nsCOMPtr kungFuDeathGrip(mListener); - mListener->OnStopContainer(this, image); - } - - // Multipart needs reset for next OnStartContainer - if (mOwner && mOwner->GetMultipart()) - mSentStartContainer = false; -} - -void imgRequestProxy::OnStopDecode(nsresult status, const PRUnichar *statusArg) +void imgRequestProxy::OnStopDecode() { LOG_FUNC(gImgLog, "imgRequestProxy::OnStopDecode"); if (mListener && !mCanceled) { // Hold a ref to the listener while we call it, just in case. - nsCOMPtr kungFuDeathGrip(mListener); - mListener->OnStopDecode(this, status, statusArg); + nsCOMPtr kungFuDeathGrip(mListener); + mListener->Notify(this, imgINotificationObserver::DECODE_COMPLETE, nullptr); } + + // Multipart needs reset for next OnStartContainer + if (mOwner && mOwner->GetMultipart()) + mSentStartContainer = false; } void imgRequestProxy::OnDiscard() @@ -705,8 +669,8 @@ void imgRequestProxy::OnDiscard() if (mListener && !mCanceled) { // Hold a ref to the listener while we call it, just in case. - nsCOMPtr kungFuDeathGrip(mListener); - mListener->OnDiscard(this); + nsCOMPtr kungFuDeathGrip(mListener); + mListener->Notify(this, imgINotificationObserver::DISCARD, nullptr); } } @@ -715,8 +679,8 @@ void imgRequestProxy::OnImageIsAnimated() LOG_FUNC(gImgLog, "imgRequestProxy::OnImageIsAnimated"); if (mListener && !mCanceled) { // Hold a ref to the listener while we call it, just in case. - nsCOMPtr kungFuDeathGrip(mListener); - mListener->OnImageIsAnimated(this); + nsCOMPtr kungFuDeathGrip(mListener); + mListener->Notify(this, imgINotificationObserver::IS_ANIMATED, nullptr); } } @@ -727,14 +691,6 @@ void imgRequestProxy::OnStartRequest() GetName(name); LOG_FUNC_WITH_PARAM(gImgLog, "imgRequestProxy::OnStartRequest", "name", name.get()); #endif - - // Notify even if mCanceled, since OnStartRequest is guaranteed by the - // nsIStreamListener contract so it makes sense to do the same here. - if (mListener) { - // Hold a ref to the listener while we call it, just in case. - nsCOMPtr kungFuDeathGrip(mListener); - mListener->OnStartRequest(this); - } } void imgRequestProxy::OnStopRequest(bool lastPart) @@ -751,8 +707,8 @@ void imgRequestProxy::OnStopRequest(bool lastPart) if (mListener) { // Hold a ref to the listener while we call it, just in case. - nsCOMPtr kungFuDeathGrip(mListener); - mListener->OnStopRequest(this, lastPart); + nsCOMPtr kungFuDeathGrip(mListener); + mListener->Notify(this, imgINotificationObserver::LOAD_COMPLETE, nullptr); } // If we're expecting more data from a multipart channel, re-add ourself @@ -774,7 +730,7 @@ void imgRequestProxy::OnStopRequest(bool lastPart) // Drop our strong ref to the listener now that we're done with // everything. Note that this can cancel us and other fun things // like that. Don't add anything in this method after this point. - imgIDecoderObserver* obs = mListener; + imgINotificationObserver* obs = mListener; mListenerIsStrongRef = false; NS_RELEASE(obs); } @@ -816,7 +772,7 @@ void imgRequestProxy::NullOutListener() if (mListenerIsStrongRef) { // Releasing could do weird reentery stuff, so just play it super-safe - nsCOMPtr obs; + nsCOMPtr obs; obs.swap(mListener); mListenerIsStrongRef = false; } else { @@ -828,9 +784,10 @@ NS_IMETHODIMP imgRequestProxy::GetStaticRequest(imgIRequest** aReturn) { *aReturn = nullptr; + mozilla::image::Image* image = GetImage(); bool animated; - if (!mImage || (NS_SUCCEEDED(mImage->GetAnimated(&animated)) && !animated)) { + if (!image || (NS_SUCCEEDED(image->GetAnimated(&animated)) && !animated)) { // Early exit - we're not animated, so we don't have to do anything. NS_ADDREF(*aReturn = this); return NS_OK; @@ -839,33 +796,29 @@ imgRequestProxy::GetStaticRequest(imgIRequest** aReturn) // We are animated. We need to extract the current frame from this image. int32_t w = 0; int32_t h = 0; - mImage->GetWidth(&w); - mImage->GetHeight(&h); + image->GetWidth(&w); + image->GetHeight(&h); nsIntRect rect(0, 0, w, h); nsCOMPtr currentFrame; - nsresult rv = mImage->ExtractFrame(imgIContainer::FRAME_CURRENT, rect, - imgIContainer::FLAG_SYNC_DECODE, - getter_AddRefs(currentFrame)); + nsresult rv = image->ExtractFrame(imgIContainer::FRAME_CURRENT, rect, + imgIContainer::FLAG_SYNC_DECODE, + getter_AddRefs(currentFrame)); if (NS_FAILED(rv)) return rv; nsRefPtr frame = static_cast(currentFrame.get()); // Create a static imgRequestProxy with our new extracted frame. - nsRefPtr req = new imgRequestProxy(); - req->Init(nullptr, nullptr, frame, mURI, nullptr); - req->SetPrincipal(mPrincipal); + nsCOMPtr currentPrincipal; + GetImagePrincipal(getter_AddRefs(currentPrincipal)); + nsRefPtr req = new imgRequestProxyStatic(frame, currentPrincipal); + req->Init(&frame->GetStatusTracker(), nullptr, mURI, nullptr); NS_ADDREF(*aReturn = req); return NS_OK; } -void imgRequestProxy::SetPrincipal(nsIPrincipal *aPrincipal) -{ - mPrincipal = aPrincipal; -} - void imgRequestProxy::NotifyListener() { // It would be nice to notify the observer directly in the status tracker @@ -879,9 +832,9 @@ void imgRequestProxy::NotifyListener() } else { // We don't have an imgRequest, so we can only notify the clone of our // current state, but we still have to do that asynchronously. - NS_ABORT_IF_FALSE(mImage, + NS_ABORT_IF_FALSE(GetImage(), "if we have no imgRequest, we should have an Image"); - mImage->GetStatusTracker().NotifyCurrentState(this); + GetStatusTracker().NotifyCurrentState(this); } } @@ -896,25 +849,23 @@ void imgRequestProxy::SyncNotifyListener() } void -imgRequestProxy::SetImage(Image* aImage) +imgRequestProxy::SetHasImage() { - NS_ABORT_IF_FALSE(aImage, "Setting null image"); - NS_ABORT_IF_FALSE(!mImage || mOwner->GetMultipart(), - "Setting image when we already have one"); + Image* image = GetStatusTracker().GetImage(); - mImage = aImage; + mOwnerHasImage = true; // Apply any locks we have for (uint32_t i = 0; i < mLockCount; ++i) - mImage->LockImage(); + image->LockImage(); // Apply any animation consumers we have for (uint32_t i = 0; i < mAnimationConsumers; i++) - mImage->IncrementAnimationConsumers(); + image->IncrementAnimationConsumers(); } imgStatusTracker& -imgRequestProxy::GetStatusTracker() +imgRequestProxy::GetStatusTracker() const { // NOTE: It's possible that our mOwner has an Image that it didn't notify // us about, if we were Canceled before its Image was constructed. @@ -922,5 +873,44 @@ imgRequestProxy::GetStatusTracker() // That's why this method uses mOwner->GetStatusTracker() instead of just // mOwner->mStatusTracker -- we might have a null mImage and yet have an // mOwner with a non-null mImage (and a null mStatusTracker pointer). - return mImage ? mImage->GetStatusTracker() : mOwner->GetStatusTracker(); + return mOwner->GetStatusTracker(); +} + +mozilla::image::Image* +imgRequestProxy::GetImage() const +{ + if (!mOwnerHasImage) + return nullptr; + return GetStatusTracker().GetImage(); +} + +////////////////// imgRequestProxyStatic methods + +NS_IMETHODIMP imgRequestProxyStatic::GetImagePrincipal(nsIPrincipal **aPrincipal) +{ + if (!mPrincipal) + return NS_ERROR_FAILURE; + + NS_ADDREF(*aPrincipal = mPrincipal); + + return NS_OK; +} + +mozilla::image::Image* +imgRequestProxyStatic::GetImage() const +{ + return mImage; +} + +imgStatusTracker& +imgRequestProxyStatic::GetStatusTracker() const +{ + return mImage->GetStatusTracker(); +} + +NS_IMETHODIMP +imgRequestProxyStatic::Clone(imgINotificationObserver* aObserver, + imgIRequest** aClone) +{ + return PerformClone(aObserver, NewStaticProxy, aClone); } diff --git a/image/src/imgRequestProxy.h b/image/src/imgRequestProxy.h index 5989f7b88b8b..9b3f85d6f093 100644 --- a/image/src/imgRequestProxy.h +++ b/image/src/imgRequestProxy.h @@ -8,7 +8,7 @@ #define imgRequestProxy_h__ #include "imgIRequest.h" -#include "imgIDecoderObserver.h" +#include "imgINotificationObserver.h" #include "nsISecurityInfoProvider.h" #include "nsIRequestObserver.h" @@ -57,9 +57,9 @@ public: // Callers to Init or ChangeOwner are required to call NotifyListener after // (although not immediately after) doing so. - nsresult Init(imgRequest *request, nsILoadGroup *aLoadGroup, - mozilla::image::Image* aImage, - nsIURI* aURI, imgIDecoderObserver *aObserver); + nsresult Init(imgStatusTracker* aStatusTracker, + nsILoadGroup *aLoadGroup, + nsIURI* aURI, imgINotificationObserver *aObserver); nsresult ChangeOwner(imgRequest *aNewOwner); // this will change mOwner. Do not call this if the previous // owner has already sent notifications out! @@ -71,8 +71,6 @@ public: return mListener != nullptr; } - void SetPrincipal(nsIPrincipal *aPrincipal); - // Asynchronously notify this proxy's listener of the current state of the // image, and, if we have an imgRequest mOwner, any status changes that // happen between the time this function is called and the time the @@ -95,9 +93,8 @@ public: mDeferNotifications = aDeferNotifications; } - // Setter for our |mImage| pointer, for imgRequest to use, once it - // instantiates an Image. - void SetImage(mozilla::image::Image* aImage); + // XXXbholley - This eventually gets folded into the new notification API. + void SetHasImage(); // Removes all animation consumers that were created with // IncrementAnimationConsumers. This is necessary since we need @@ -135,20 +132,13 @@ protected: // notifications. /* non-virtual imgIDecoderObserver methods */ - void OnStartDecode (); - void OnStartContainer (imgIContainer *aContainer); - void OnStartFrame (uint32_t aFrame); - void OnDataAvailable (bool aCurrentFrame, const nsIntRect * aRect); - void OnStopFrame (uint32_t aFrame); - void OnStopContainer (imgIContainer *aContainer); - void OnStopDecode (nsresult status, const PRUnichar *statusArg); + void OnStartContainer (); + void OnFrameUpdate (const nsIntRect * aRect); + void OnStopFrame (); + void OnStopDecode (); void OnDiscard (); void OnImageIsAnimated (); - /* non-virtual imgIContainerObserver methods */ - void FrameChanged(imgIContainer *aContainer, - const nsIntRect *aDirtyRect); - /* non-virtual sort-of-nsIRequestObserver methods */ void OnStartRequest(); void OnStopRequest(bool aLastPart); @@ -171,7 +161,7 @@ protected: // live either on mOwner or mImage, depending on whether // (a) we have an mOwner at all // (b) whether mOwner has instantiated its image yet - imgStatusTracker& GetStatusTracker(); + virtual imgStatusTracker& GetStatusTracker() const; nsITimedChannel* TimedChannel() { @@ -180,6 +170,12 @@ protected: return mOwner->mTimedChannel; } + virtual mozilla::image::Image* GetImage() const; + + nsresult PerformClone(imgINotificationObserver* aObserver, + imgRequestProxy* (aAllocFn)(imgRequestProxy*), + imgIRequest** aClone); + public: NS_FORWARD_SAFE_NSITIMEDCHANNEL(TimedChannel()) @@ -197,18 +193,10 @@ private: // The URI of our request. nsCOMPtr mURI; - // The image we represent. Is null until data has been received, and is then - // set by imgRequest. - nsRefPtr mImage; - - // Our principal. Is null until data has been received from the channel, and - // is then set by imgRequest. - nsCOMPtr mPrincipal; - // mListener is only promised to be a weak ref (see imgILoader.idl), // but we actually keep a strong ref to it until we've seen our // first OnStopRequest. - imgIDecoderObserver* mListener; + imgINotificationObserver* mListener; nsCOMPtr mLoadGroup; nsLoadFlags mLoadFlags; @@ -226,6 +214,44 @@ private: // We only want to send OnStartContainer once for each proxy, but we might // get multiple OnStartContainer calls. bool mSentStartContainer; + + protected: + bool mOwnerHasImage; +}; + +// Used for static image proxies for which no requests are available, so +// certain behaviours must be overridden to compensate. +class imgRequestProxyStatic : public imgRequestProxy +{ + +public: + imgRequestProxyStatic(mozilla::image::Image* aImage, + nsIPrincipal* aPrincipal) + : mImage(aImage) + , mPrincipal(aPrincipal) + { + mOwnerHasImage = true; + }; + + NS_IMETHOD GetImagePrincipal(nsIPrincipal** aPrincipal) MOZ_OVERRIDE; + virtual imgStatusTracker& GetStatusTracker() const MOZ_OVERRIDE; + + NS_IMETHOD Clone(imgINotificationObserver* aObserver, + imgIRequest** aClone) MOZ_OVERRIDE; + +protected: + friend imgRequestProxy* NewStaticProxy(imgRequestProxy*); + + // Our image. We have to hold a strong reference here, because that's normally + // the job of the underlying request. + nsRefPtr mImage; + + // Our principal. We have to cache it, rather than accessing the underlying + // request on-demand, because static proxies don't have an underlying request. + nsCOMPtr mPrincipal; + + mozilla::image::Image* GetImage() const MOZ_OVERRIDE; + using imgRequestProxy::GetImage; }; #endif // imgRequestProxy_h__ diff --git a/image/src/imgStatusTracker.cpp b/image/src/imgStatusTracker.cpp index f1b37578e4ce..7822f40995c0 100644 --- a/image/src/imgStatusTracker.cpp +++ b/image/src/imgStatusTracker.cpp @@ -12,31 +12,230 @@ #include "Image.h" #include "ImageLogging.h" #include "RasterImage.h" +#include "nsIObserverService.h" + +#include "mozilla/Util.h" +#include "mozilla/Assertions.h" +#include "mozilla/Services.h" using namespace mozilla::image; -static nsresult -GetResultFromImageStatus(uint32_t aStatus) +NS_IMPL_ISUPPORTS3(imgStatusTrackerObserver, + imgIDecoderObserver, + imgIContainerObserver, + nsISupportsWeakReference) + +/** imgIContainerObserver methods **/ + +/* [noscript] void frameChanged (in nsIntRect dirtyRect); */ +NS_IMETHODIMP imgStatusTrackerObserver::FrameChanged(const nsIntRect *dirtyRect) { - if (aStatus & imgIRequest::STATUS_ERROR) - return NS_IMAGELIB_ERROR_FAILURE; - if (aStatus & imgIRequest::STATUS_LOAD_COMPLETE) - return NS_IMAGELIB_SUCCESS_LOAD_FINISHED; + LOG_SCOPE(gImgLog, "imgStatusTrackerObserver::FrameChanged"); + NS_ABORT_IF_FALSE(mTracker->GetImage(), + "FrameChanged callback before we've created our image"); + + mTracker->RecordFrameChanged(dirtyRect); + + nsTObserverArray::ForwardIterator iter(mTracker->mConsumers); + while (iter.HasMore()) { + mTracker->SendFrameChanged(iter.GetNext(), dirtyRect); + } + return NS_OK; } -imgStatusTracker::imgStatusTracker(Image* aImage) +/** imgIDecoderObserver methods **/ + +NS_IMETHODIMP imgStatusTrackerObserver::OnStartDecode() +{ + LOG_SCOPE(gImgLog, "imgStatusTrackerObserver::OnStartDecode"); + NS_ABORT_IF_FALSE(mTracker->GetImage(), + "OnStartDecode callback before we've created our image"); + + if (!mTracker->GetRequest()->GetMultipart()) { + MOZ_ASSERT(!mTracker->mBlockingOnload); + mTracker->mBlockingOnload = true; + + mTracker->RecordBlockOnload(); + + nsTObserverArray::ForwardIterator iter(mTracker->mConsumers); + while (iter.HasMore()) { + mTracker->SendBlockOnload(iter.GetNext()); + } + } + + /* In the case of streaming jpegs, it is possible to get multiple OnStartDecodes which + indicates the beginning of a new decode. + The cache entry's size therefore needs to be reset to 0 here. If we do not do this, + the code in imgStatusTrackerObserver::OnStopFrame will continue to increase the data size cumulatively. + */ + mTracker->GetRequest()->ResetCacheEntry(); + + return NS_OK; +} + +NS_IMETHODIMP imgStatusTrackerObserver::OnStartRequest() +{ + NS_NOTREACHED("imgRequest(imgIDecoderObserver)::OnStartRequest"); + return NS_OK; +} + +/* void onStartContainer (); */ +NS_IMETHODIMP imgStatusTrackerObserver::OnStartContainer() +{ + LOG_SCOPE(gImgLog, "imgStatusTrackerObserver::OnStartContainer"); + + NS_ABORT_IF_FALSE(mTracker->GetImage(), + "OnStartContainer callback before we've created our image"); + mTracker->RecordStartContainer(mTracker->GetImage()); + + nsTObserverArray::ForwardIterator iter(mTracker->mConsumers); + while (iter.HasMore()) { + mTracker->SendStartContainer(iter.GetNext()); + } + + return NS_OK; +} + +/* [noscript] void onDataAvailable ([const] in nsIntRect rect); */ +NS_IMETHODIMP imgStatusTrackerObserver::OnDataAvailable(const nsIntRect * rect) +{ + LOG_SCOPE(gImgLog, "imgStatusTrackerObserver::OnDataAvailable"); + NS_ABORT_IF_FALSE(mTracker->GetImage(), + "OnDataAvailable callback before we've created our image"); + + mTracker->RecordDataAvailable(); + + nsTObserverArray::ForwardIterator iter(mTracker->mConsumers); + while (iter.HasMore()) { + mTracker->SendDataAvailable(iter.GetNext(), rect); + } + + return NS_OK; +} + +/* void onStopFrame (); */ +NS_IMETHODIMP imgStatusTrackerObserver::OnStopFrame() +{ + LOG_SCOPE(gImgLog, "imgStatusTrackerObserver::OnStopFrame"); + NS_ABORT_IF_FALSE(mTracker->GetImage(), + "OnStopFrame callback before we've created our image"); + + mTracker->RecordStopFrame(); + + nsTObserverArray::ForwardIterator iter(mTracker->mConsumers); + while (iter.HasMore()) { + mTracker->SendStopFrame(iter.GetNext()); + } + + mTracker->MaybeUnblockOnload(); + + return NS_OK; +} + +static void +FireFailureNotification(imgRequest* aRequest) +{ + // Some kind of problem has happened with image decoding. + // Report the URI to net:failed-to-process-uri-conent observers. + + nsCOMPtr os = mozilla::services::GetObserverService(); + if (os) { + nsCOMPtr uri; + aRequest->GetURI(getter_AddRefs(uri)); + os->NotifyObservers(uri, "net:failed-to-process-uri-content", nullptr); + } +} + +/* void onStopDecode (in nsresult status); */ +NS_IMETHODIMP imgStatusTrackerObserver::OnStopDecode(nsresult aStatus) +{ + LOG_SCOPE(gImgLog, "imgStatusTrackerObserver::OnStopDecode"); + NS_ABORT_IF_FALSE(mTracker->GetImage(), + "OnStopDecode callback before we've created our image"); + + // We finished the decode, and thus have the decoded frames. Update the cache + // entry size to take this into account. + mTracker->GetRequest()->UpdateCacheEntrySize(); + + bool preexistingError = mTracker->GetImageStatus() == imgIRequest::STATUS_ERROR; + + mTracker->RecordStopDecode(aStatus); + + nsTObserverArray::ForwardIterator iter(mTracker->mConsumers); + while (iter.HasMore()) { + mTracker->SendStopDecode(iter.GetNext(), aStatus); + } + + // This is really hacky. We need to handle the case where we start decoding, + // block onload, but then hit an error before we get to our first frame. + mTracker->MaybeUnblockOnload(); + + if (NS_FAILED(aStatus) && !preexistingError) { + FireFailureNotification(mTracker->GetRequest()); + } + + return NS_OK; +} + +NS_IMETHODIMP imgStatusTrackerObserver::OnStopRequest(bool aLastPart) +{ + NS_NOTREACHED("imgRequest(imgIDecoderObserver)::OnStopRequest"); + return NS_OK; +} + +/* void onDiscard (); */ +NS_IMETHODIMP imgStatusTrackerObserver::OnDiscard() +{ + NS_ABORT_IF_FALSE(mTracker->GetImage(), + "OnDiscard callback before we've created our image"); + + mTracker->RecordDiscard(); + + // Update the cache entry size, since we just got rid of frame data + mTracker->GetRequest()->UpdateCacheEntrySize(); + + nsTObserverArray::ForwardIterator iter(mTracker->mConsumers); + while (iter.HasMore()) { + mTracker->SendDiscard(iter.GetNext()); + } + + return NS_OK; +} + +NS_IMETHODIMP imgStatusTrackerObserver::OnImageIsAnimated() +{ + NS_ABORT_IF_FALSE(mTracker->GetImage(), + "OnImageIsAnimated callback before we've created our image"); + mTracker->RecordImageIsAnimated(); + + nsTObserverArray::ForwardIterator iter(mTracker->mConsumers); + while (iter.HasMore()) { + mTracker->SendImageIsAnimated(iter.GetNext()); + } + + return NS_OK; +} + +// imgStatusTracker methods + +imgStatusTracker::imgStatusTracker(Image* aImage, imgRequest* aRequest) : mImage(aImage), + mRequest(aRequest), mState(0), mImageStatus(imgIRequest::STATUS_NONE), - mHadLastPart(false) + mHadLastPart(false), + mBlockingOnload(false), + mTrackerObserver(new imgStatusTrackerObserver(this)) {} imgStatusTracker::imgStatusTracker(const imgStatusTracker& aOther) : mImage(aOther.mImage), + mRequest(aOther.mRequest), mState(aOther.mState), mImageStatus(aOther.mImageStatus), - mHadLastPart(aOther.mHadLastPart) + mHadLastPart(aOther.mHadLastPart), + mBlockingOnload(aOther.mBlockingOnload) // Note: we explicitly don't copy mRequestRunnable, because it won't be // nulled out when the mRequestRunnable's Run function eventually gets // called. @@ -194,11 +393,7 @@ imgStatusTracker::SyncNotify(imgRequestProxy* proxy) // OnStartContainer if (mState & stateHasSize) - proxy->OnStartContainer(mImage); - - // OnStartDecode - if (mState & stateDecodeStarted) - proxy->OnStartDecode(); + proxy->OnStartContainer(); // BlockOnload if (mState & stateBlockingOnload) @@ -206,24 +401,19 @@ imgStatusTracker::SyncNotify(imgRequestProxy* proxy) if (mImage) { int16_t imageType = mImage->GetType(); - // Send frame messages (OnStartFrame, OnDataAvailable, OnStopFrame) + // Send frame messages (OnDataAvailable, OnStopFrame) if (imageType == imgIContainer::TYPE_VECTOR || static_cast(mImage)->GetNumFrames() > 0) { - uint32_t frame = (imageType == imgIContainer::TYPE_VECTOR) ? - 0 : static_cast(mImage)->GetCurrentFrameIndex(); - - proxy->OnStartFrame(frame); - // OnDataAvailable // XXX - Should only send partial rects here, but that needs to // wait until we fix up the observer interface nsIntRect r; mImage->GetCurrentFrameRect(r); - proxy->OnDataAvailable(frame, &r); + proxy->OnFrameUpdate(&r); if (mState & stateFrameStopped) - proxy->OnStopFrame(frame); + proxy->OnStopFrame(); } // OnImageIsAnimated @@ -235,16 +425,12 @@ imgStatusTracker::SyncNotify(imgRequestProxy* proxy) } } - // See bug 505385 and imgRequest::OnStopDecode for more information on why we - // call OnStopContainer based on stateDecodeStopped, and why OnStopDecode is - // called with OnStopRequest. if (mState & stateDecodeStopped) { NS_ABORT_IF_FALSE(mImage, "stopped decoding without ever having an image?"); - proxy->OnStopContainer(mImage); + proxy->OnStopDecode(); } if (mState & stateRequestStopped) { - proxy->OnStopDecode(GetResultFromImageStatus(mImageStatus), nullptr); proxy->OnStopRequest(mHadLastPart); } } @@ -255,6 +441,12 @@ imgStatusTracker::EmulateRequestFinished(imgRequestProxy* aProxy, { nsCOMPtr kungFuDeathGrip(aProxy); + // In certain cases the request might not have started yet. + // We still need to fulfill the contract. + if (!(mState & stateRequestStarted)) { + aProxy->OnStartRequest(); + } + if (mState & stateBlockingOnload) { aProxy->UnblockOnload(); } @@ -264,6 +456,26 @@ imgStatusTracker::EmulateRequestFinished(imgRequestProxy* aProxy, } } +void +imgStatusTracker::AddConsumer(imgRequestProxy* aConsumer) +{ + mConsumers.AppendElementUnlessExists(aConsumer); +} + +// XXX - The last argument should go away. +bool +imgStatusTracker::RemoveConsumer(imgRequestProxy* aConsumer, nsresult aStatus) +{ + // Remove the proxy from the list. + bool removed = mConsumers.RemoveElement(aConsumer); + + // Consumers can get confused if they don't get all the proper teardown + // notifications. Part ways on good terms. + if (removed) + EmulateRequestFinished(aConsumer, aStatus); + return removed; +} + void imgStatusTracker::RecordCancel() { @@ -284,25 +496,10 @@ void imgStatusTracker::RecordDecoded() { NS_ABORT_IF_FALSE(mImage, "RecordDecoded called before we have an Image"); - mState |= stateDecodeStarted | stateDecodeStopped | stateFrameStopped; + mState |= stateDecodeStopped | stateFrameStopped; mImageStatus |= imgIRequest::STATUS_FRAME_COMPLETE | imgIRequest::STATUS_DECODE_COMPLETE; } -/* non-virtual imgIDecoderObserver methods */ -void -imgStatusTracker::RecordStartDecode() -{ - NS_ABORT_IF_FALSE(mImage, "RecordStartDecode without an Image"); - mState |= stateDecodeStarted; -} - -void -imgStatusTracker::SendStartDecode(imgRequestProxy* aProxy) -{ - if (!aProxy->NotificationsDeferred()) - aProxy->OnStartDecode(); -} - void imgStatusTracker::RecordStartContainer(imgIContainer* aContainer) { @@ -315,29 +512,14 @@ imgStatusTracker::RecordStartContainer(imgIContainer* aContainer) } void -imgStatusTracker::SendStartContainer(imgRequestProxy* aProxy, imgIContainer* aContainer) +imgStatusTracker::SendStartContainer(imgRequestProxy* aProxy) { if (!aProxy->NotificationsDeferred()) - aProxy->OnStartContainer(aContainer); + aProxy->OnStartContainer(); } void -imgStatusTracker::RecordStartFrame(uint32_t aFrame) -{ - NS_ABORT_IF_FALSE(mImage, "RecordStartFrame called before we have an Image"); - // no bookkeeping necessary here - this is implied by imgIContainer's number - // of frames -} - -void -imgStatusTracker::SendStartFrame(imgRequestProxy* aProxy, uint32_t aFrame) -{ - if (!aProxy->NotificationsDeferred()) - aProxy->OnStartFrame(aFrame); -} - -void -imgStatusTracker::RecordDataAvailable(bool aCurrentFrame, const nsIntRect* aRect) +imgStatusTracker::RecordDataAvailable() { NS_ABORT_IF_FALSE(mImage, "RecordDataAvailable called before we have an Image"); @@ -346,16 +528,16 @@ imgStatusTracker::RecordDataAvailable(bool aCurrentFrame, const nsIntRect* aRect } void -imgStatusTracker::SendDataAvailable(imgRequestProxy* aProxy, bool aCurrentFrame, - const nsIntRect* aRect) +imgStatusTracker::SendDataAvailable(imgRequestProxy* aProxy, + const nsIntRect* aRect) { if (!aProxy->NotificationsDeferred()) - aProxy->OnDataAvailable(aCurrentFrame, aRect); + aProxy->OnFrameUpdate(aRect); } void -imgStatusTracker::RecordStopFrame(uint32_t aFrame) +imgStatusTracker::RecordStopFrame() { NS_ABORT_IF_FALSE(mImage, "RecordStopFrame called before we have an Image"); mState |= stateFrameStopped; @@ -363,34 +545,20 @@ imgStatusTracker::RecordStopFrame(uint32_t aFrame) } void -imgStatusTracker::SendStopFrame(imgRequestProxy* aProxy, uint32_t aFrame) +imgStatusTracker::SendStopFrame(imgRequestProxy* aProxy) { if (!aProxy->NotificationsDeferred()) - aProxy->OnStopFrame(aFrame); + aProxy->OnStopFrame(); } void -imgStatusTracker::RecordStopContainer(imgIContainer* aContainer) -{ - NS_ABORT_IF_FALSE(mImage, - "RecordStopContainer called before we have an Image"); - // No-op: see imgRequest::OnStopDecode for more information -} - -void -imgStatusTracker::SendStopContainer(imgRequestProxy* aProxy, imgIContainer* aContainer) -{ - // No-op: see imgRequest::OnStopDecode for more information -} - -void -imgStatusTracker::RecordStopDecode(nsresult aStatus, const PRUnichar* statusArg) +imgStatusTracker::RecordStopDecode(nsresult aStatus) { NS_ABORT_IF_FALSE(mImage, "RecordStopDecode called before we have an Image"); mState |= stateDecodeStopped; - if (NS_SUCCEEDED(aStatus)) + if (NS_SUCCEEDED(aStatus) && mImageStatus != imgIRequest::STATUS_ERROR) mImageStatus |= imgIRequest::STATUS_DECODE_COMPLETE; // If we weren't successful, clear all success status bits and set error. else @@ -398,14 +566,11 @@ imgStatusTracker::RecordStopDecode(nsresult aStatus, const PRUnichar* statusArg) } void -imgStatusTracker::SendStopDecode(imgRequestProxy* aProxy, nsresult aStatus, - const PRUnichar* statusArg) +imgStatusTracker::SendStopDecode(imgRequestProxy* aProxy, + nsresult aStatus) { - // See imgRequest::OnStopDecode for more information on why we call - // OnStopContainer from here this, and why imgRequestProxy::OnStopDecode() is - // called from OnStopRequest() and SyncNotify(). if (!aProxy->NotificationsDeferred()) - aProxy->OnStopContainer(mImage); + aProxy->OnStopDecode(); } void @@ -414,7 +579,7 @@ imgStatusTracker::RecordDiscard() NS_ABORT_IF_FALSE(mImage, "RecordDiscard called before we have an Image"); // Clear the state bits we no longer deserve. - uint32_t stateBitsToClear = stateDecodeStarted | stateDecodeStopped; + uint32_t stateBitsToClear = stateDecodeStopped; mState &= ~stateBitsToClear; // Clear the status bits we no longer deserve. @@ -450,8 +615,7 @@ imgStatusTracker::SendDiscard(imgRequestProxy* aProxy) /* non-virtual imgIContainerObserver methods */ void -imgStatusTracker::RecordFrameChanged(imgIContainer* aContainer, - const nsIntRect* aDirtyRect) +imgStatusTracker::RecordFrameChanged(const nsIntRect* aDirtyRect) { NS_ABORT_IF_FALSE(mImage, "RecordFrameChanged called before we have an Image"); @@ -460,11 +624,11 @@ imgStatusTracker::RecordFrameChanged(imgIContainer* aContainer, } void -imgStatusTracker::SendFrameChanged(imgRequestProxy* aProxy, imgIContainer* aContainer, +imgStatusTracker::SendFrameChanged(imgRequestProxy* aProxy, const nsIntRect* aDirtyRect) { if (!aProxy->NotificationsDeferred()) - aProxy->FrameChanged(aContainer, aDirtyRect); + aProxy->OnFrameUpdate(aDirtyRect); } /* non-virtual sort-of-nsIRequestObserver methods */ @@ -477,7 +641,6 @@ imgStatusTracker::RecordStartRequest() mImageStatus &= ~imgIRequest::STATUS_LOAD_COMPLETE; mImageStatus &= ~imgIRequest::STATUS_FRAME_COMPLETE; mState &= ~stateRequestStarted; - mState &= ~stateDecodeStarted; mState &= ~stateDecodeStopped; mState &= ~stateRequestStopped; mState &= ~stateBlockingOnload; @@ -493,27 +656,67 @@ imgStatusTracker::SendStartRequest(imgRequestProxy* aProxy) } void -imgStatusTracker::RecordStopRequest(bool aLastPart, nsresult aStatus) +imgStatusTracker::OnStartRequest() +{ + RecordStartRequest(); + nsTObserverArray::ForwardIterator iter(mConsumers); + while (iter.HasMore()) { + SendStartRequest(iter.GetNext()); + } +} + +void +imgStatusTracker::RecordStopRequest(bool aLastPart, + nsresult aStatus) { mHadLastPart = aLastPart; mState |= stateRequestStopped; // If we were successful in loading, note that the image is complete. - if (NS_SUCCEEDED(aStatus)) + if (NS_SUCCEEDED(aStatus) && mImageStatus != imgIRequest::STATUS_ERROR) mImageStatus |= imgIRequest::STATUS_LOAD_COMPLETE; + else + mImageStatus = imgIRequest::STATUS_ERROR; } void -imgStatusTracker::SendStopRequest(imgRequestProxy* aProxy, bool aLastPart, nsresult aStatus) +imgStatusTracker::SendStopRequest(imgRequestProxy* aProxy, + bool aLastPart, + nsresult aStatus) { - // See bug 505385 and imgRequest::OnStopDecode for more information on why - // OnStopDecode is called with OnStopRequest. if (!aProxy->NotificationsDeferred()) { - aProxy->OnStopDecode(GetResultFromImageStatus(mImageStatus), nullptr); aProxy->OnStopRequest(aLastPart); } } +void +imgStatusTracker::OnStopRequest(bool aLastPart, + nsresult aStatus) +{ + bool preexistingError = mImageStatus == imgIRequest::STATUS_ERROR; + + RecordStopRequest(aLastPart, aStatus); + /* notify the kids */ + nsTObserverArray::ForwardIterator srIter(mConsumers); + while (srIter.HasMore()) { + SendStopRequest(srIter.GetNext(), aLastPart, aStatus); + } + + if (NS_FAILED(aStatus) && !preexistingError) { + FireFailureNotification(GetRequest()); + } +} + +void +imgStatusTracker::OnDataAvailable() +{ + // Notify any imgRequestProxys that are observing us that we have an Image. + nsTObserverArray::ForwardIterator iter(mConsumers); + while (iter.HasMore()) { + iter.GetNext()->SetHasImage(); + } +} + void imgStatusTracker::RecordBlockOnload() { @@ -543,3 +746,20 @@ imgStatusTracker::SendUnblockOnload(imgRequestProxy* aProxy) aProxy->UnblockOnload(); } } + +void +imgStatusTracker::MaybeUnblockOnload() +{ + if (!mBlockingOnload) { + return; + } + + mBlockingOnload = false; + + RecordUnblockOnload(); + + nsTObserverArray::ForwardIterator iter(mConsumers); + while (iter.HasMore()) { + SendUnblockOnload(iter.GetNext()); + } +} diff --git a/image/src/imgStatusTracker.h b/image/src/imgStatusTracker.h index b152f21a2fc4..0544544fc496 100644 --- a/image/src/imgStatusTracker.h +++ b/image/src/imgStatusTracker.h @@ -12,6 +12,7 @@ class imgRequest; class imgRequestProxy; class imgStatusNotifyRunnable; class imgRequestNotifyRunnable; +class imgStatusTracker; struct nsIntRect; namespace mozilla { namespace image { @@ -21,19 +22,43 @@ class Image; #include "nsCOMPtr.h" +#include "nsAutoPtr.h" +#include "nsTObserverArray.h" #include "nsIRunnable.h" #include "nscore.h" +#include "nsWeakReference.h" +#include "imgIDecoderObserver.h" enum { stateRequestStarted = PR_BIT(0), stateHasSize = PR_BIT(1), - stateDecodeStarted = PR_BIT(2), stateDecodeStopped = PR_BIT(3), stateFrameStopped = PR_BIT(4), stateRequestStopped = PR_BIT(5), stateBlockingOnload = PR_BIT(6) }; +class imgStatusTrackerObserver : public imgIDecoderObserver, + public nsSupportsWeakReference +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_IMGIDECODEROBSERVER + NS_DECL_IMGICONTAINEROBSERVER + + imgStatusTrackerObserver(imgStatusTracker* aTracker) + : mTracker(aTracker) {} + + virtual ~imgStatusTrackerObserver() {} + + void SetTracker(imgStatusTracker* aTracker) { + mTracker = aTracker; + } + +private: + imgStatusTracker* mTracker; +}; + /* * The image status tracker is a class that encapsulates all the loading and * decoding status about an Image, and makes it possible to send notifications @@ -51,7 +76,7 @@ public: // aImage is the image that this status tracker will pass to the // imgRequestProxys in SyncNotify() and EmulateRequestFinished(), and must be // alive as long as this instance is, because we hold a weak reference to it. - imgStatusTracker(mozilla::image::Image* aImage); + imgStatusTracker(mozilla::image::Image* aImage, imgRequest* aRequest); imgStatusTracker(const imgStatusTracker& aOther); // Image-setter, for imgStatusTrackers created by imgRequest::Init, which @@ -85,6 +110,21 @@ public: // OnStopRequest and UnblockOnload, and only if necessary. void EmulateRequestFinished(imgRequestProxy* proxy, nsresult aStatus); + // We manage a set of consumers that are using an image and thus concerned + // with its status. Weak pointers. + void AddConsumer(imgRequestProxy* aConsumer); + bool RemoveConsumer(imgRequestProxy* aConsumer, nsresult aStatus); + size_t ConsumerCount() const { return mConsumers.Length(); }; + + // This is intentionally non-general because its sole purpose is to support an + // some obscure network priority logic in imgRequest. That stuff could probably + // be improved, but it's too scary to mess with at the moment. + bool FirstConsumerIs(imgRequestProxy* aConsumer) { + return mConsumers.SafeElementAt(0, nullptr) == aConsumer; + } + + void AdoptConsumers(imgStatusTracker* aTracker) { mConsumers = aTracker->mConsumers; } + // Returns whether we are in the process of loading; that is, whether we have // not received OnStopRequest. bool IsLoading() const; @@ -104,34 +144,26 @@ public: void RecordLoaded(); // Shorthand for recording all the decode notifications: StartDecode, - // StartFrame, DataAvailable, StopFrame, StopContainer, StopDecode. + // StartFrame, DataAvailable, StopFrame, StopDecode. void RecordDecoded(); /* non-virtual imgIDecoderObserver methods */ - void RecordStartDecode(); - void SendStartDecode(imgRequestProxy* aProxy); void RecordStartContainer(imgIContainer* aContainer); - void SendStartContainer(imgRequestProxy* aProxy, imgIContainer* aContainer); - void RecordStartFrame(uint32_t aFrame); - void SendStartFrame(imgRequestProxy* aProxy, uint32_t aFrame); - void RecordDataAvailable(bool aCurrentFrame, const nsIntRect* aRect); - void SendDataAvailable(imgRequestProxy* aProxy, bool aCurrentFrame, const nsIntRect* aRect); - void RecordStopFrame(uint32_t aFrame); - void SendStopFrame(imgRequestProxy* aProxy, uint32_t aFrame); - void RecordStopContainer(imgIContainer* aContainer); - void SendStopContainer(imgRequestProxy* aProxy, imgIContainer* aContainer); - void RecordStopDecode(nsresult status, const PRUnichar* statusArg); - void SendStopDecode(imgRequestProxy* aProxy, nsresult aStatus, const PRUnichar* statusArg); + void SendStartContainer(imgRequestProxy* aProxy); + void RecordDataAvailable(); + void SendDataAvailable(imgRequestProxy* aProxy, const nsIntRect* aRect); + void RecordStopFrame(); + void SendStopFrame(imgRequestProxy* aProxy); + void RecordStopDecode(nsresult statusg); + void SendStopDecode(imgRequestProxy* aProxy, nsresult aStatus); void RecordDiscard(); void SendDiscard(imgRequestProxy* aProxy); void RecordImageIsAnimated(); void SendImageIsAnimated(imgRequestProxy *aProxy); /* non-virtual imgIContainerObserver methods */ - void RecordFrameChanged(imgIContainer* aContainer, - const nsIntRect* aDirtyRect); - void SendFrameChanged(imgRequestProxy* aProxy, imgIContainer* aContainer, - const nsIntRect* aDirtyRect); + void RecordFrameChanged(const nsIntRect* aDirtyRect); + void SendFrameChanged(imgRequestProxy* aProxy, const nsIntRect* aDirtyRect); /* non-virtual sort-of-nsIRequestObserver methods */ void RecordStartRequest(); @@ -139,6 +171,10 @@ public: void RecordStopRequest(bool aLastPart, nsresult aStatus); void SendStopRequest(imgRequestProxy* aProxy, bool aLastPart, nsresult aStatus); + void OnStartRequest(); + void OnDataAvailable(); + void OnStopRequest(bool aLastPart, nsresult aStatus); + /* non-virtual imgIOnloadBlocker methods */ // NB: If UnblockOnload is sent, and then we are asked to replay the // notifications, we will not send a BlockOnload/UnblockOnload pair. This @@ -148,18 +184,35 @@ public: void RecordUnblockOnload(); void SendUnblockOnload(imgRequestProxy* aProxy); + void MaybeUnblockOnload(); + + // Weak pointer getters - no AddRefs. + inline mozilla::image::Image* GetImage() const { return mImage; }; + inline imgRequest* GetRequest() const { return mRequest; }; + + inline imgIDecoderObserver* GetDecoderObserver() { return mTrackerObserver.get(); } + private: friend class imgStatusNotifyRunnable; friend class imgRequestNotifyRunnable; + friend class imgStatusTrackerObserver; nsCOMPtr mRequestRunnable; - // A weak pointer to the Image, because it owns us, and we - // can't create a cycle. + // Weak pointers to the image and request. The request owns the image, and + // the image (or the request, if there's no image) owns the status tracker. mozilla::image::Image* mImage; + imgRequest* mRequest; uint32_t mState; uint32_t mImageStatus; bool mHadLastPart; + bool mBlockingOnload; + + // List of proxies attached to the image. Each proxy represents a consumer + // using the image. + nsTObserverArray mConsumers; + + nsRefPtr mTrackerObserver; }; #endif diff --git a/image/src/imgTools.cpp b/image/src/imgTools.cpp index 1cb12fb67c74..7a8bbba600fd 100644 --- a/image/src/imgTools.cpp +++ b/image/src/imgTools.cpp @@ -23,6 +23,8 @@ #include "nsNetUtil.h" #include "nsContentUtils.h" #include "RasterImage.h" +#include "ScriptedNotificationObserver.h" +#include "imgIScriptedNotificationObserver.h" using namespace mozilla::image; @@ -276,6 +278,13 @@ NS_IMETHODIMP imgTools::GetFirstImageFrame(imgIContainer *aContainer, return NS_OK; } +NS_IMETHODIMP imgTools::CreateScriptedObserver(imgIScriptedNotificationObserver* aInner, + imgINotificationObserver** aObserver) +{ + NS_ADDREF(*aObserver = new ScriptedNotificationObserver(aInner)); + return NS_OK; +} + NS_IMETHODIMP imgTools::GetImgLoaderForDocument(nsIDOMDocument* aDoc, imgILoader** aLoader) { diff --git a/image/test/mochitest/imgutils.js b/image/test/mochitest/imgutils.js index f81c527305e4..b45604caae3c 100644 --- a/image/test/mochitest/imgutils.js +++ b/image/test/mochitest/imgutils.js @@ -121,15 +121,14 @@ function getImagePref(pref) return null; } -// JS implementation of imgIDecoderObserver with stubs for all of its methods. +// JS implementation of imgIScriptedNotificationObserver with stubs for all of its methods. function ImageDecoderObserverStub() { - this.onStartRequest = function onStartRequest(aRequest) {} - this.onStartDecode = function onStartDecode(aRequest) {} - this.onStartContainer = function onStartContainer(aRequest, aContainer) {} - this.onStartFrame = function onStartFrame(aRequest, aFrame) {} - this.onStopFrame = function onStopFrame(aRequest, aFrame) {} - this.onStopContainer = function onStopContainer(aRequest, aContainer) {} - this.onStopDecode = function onStopDecode(aRequest, status, statusArg) {} - this.onStopRequest = function onStopRequest(aRequest, aIsLastPart) {} + this.sizeAvailable = function sizeAvailable(aRequest) {} + this.frameComplete = function frameComplete(aRequest) {} + this.decodeComplete = function decodeComplete(aRequest) {} + this.loadComplete = function loadComplete(aRequest) {} + this.frameUpdate = function frameUpdate(aRequest) {} + this.discard = function discard(aRequest) {} + this.isAnimated = function isAnimated(aRequest) {} } diff --git a/image/test/mochitest/test_animSVGImage.html b/image/test/mochitest/test_animSVGImage.html index e19416891743..2cb7fefa6048 100644 --- a/image/test/mochitest/test_animSVGImage.html +++ b/image/test/mochitest/test_animSVGImage.html @@ -26,6 +26,7 @@ SimpleTest.waitForExplicitFinish(); const FAILURE_TIMEOUT = 120000; // Fail early after 120 seconds (2 minutes) +const Cc = Components.classes; const Ci = Components.interfaces; const gImg = document.getElementsByTagName("img")[0]; @@ -53,7 +54,7 @@ function takeReferenceSnapshot() { "reference div should disappear when it becomes display:none"); } -function myOnStopFrame(aRequest, aFrame) { +function myOnStopFrame(aRequest) { gOnStopFrameCounter++; ok(true, "myOnStopFrame called"); let currentSnapshot = snapshotWindow(window, false); @@ -89,8 +90,11 @@ function main() { takeReferenceSnapshot(); // Create, customize & attach decoder observer - gMyDecoderObserver = new ImageDecoderObserverStub(); - gMyDecoderObserver.onStopFrame = myOnStopFrame; + observer = new ImageDecoderObserverStub(); + observer.frameComplete = myOnStopFrame; + gMyDecoderObserver = + Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools) + .createScriptedObserver(observer); let imgLoadingContent = gImg.QueryInterface(Ci.nsIImageLoadingContent); imgLoadingContent.addObserver(gMyDecoderObserver); diff --git a/image/test/unit/async_load_tests.js b/image/test/unit/async_load_tests.js index f2346f79fb0d..9f024141cac3 100644 --- a/image/test/unit/async_load_tests.js +++ b/image/test/unit/async_load_tests.js @@ -45,12 +45,18 @@ function checkClone(other_listener, aRequest) // For as long as clone notification is synchronous, we can't test the clone state reliably. var listener = new ImageListener(null, function(foo, bar) { do_test_finished(); } /*getCloneStopCallback(other_listener)*/); listener.synchronous = false; - var clone = aRequest.clone(listener); + var outer = Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools) + .createScriptedObserver(listener); + var clone = aRequest.clone(outer); } // Ensure that all the callbacks were called on aRequest. function checkAllCallbacks(listener, aRequest) { + do_check_neq(listener.state & SIZE_AVAILABLE, 0); + do_check_neq(listener.state & FRAME_COMPLETE, 0); + do_check_neq(listener.state & DECODE_COMPLETE, 0); + do_check_neq(listener.state & LOAD_COMPLETE, 0); do_check_eq(listener.state, ALL_BITS); do_test_finished(); @@ -67,7 +73,9 @@ function secondLoadDone(oldlistener, aRequest) // clone state reliably. var listener = new ImageListener(null, checkAllCallbacks); listener.synchronous = false; - var staticrequestclone = staticrequest.clone(listener); + var outer = Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools) + .createScriptedObserver(listener); + var staticrequestclone = staticrequest.clone(outer); } catch(e) { // We can't create a static request. Most likely the request we started // with didn't load successfully. @@ -86,7 +94,9 @@ function checkSecondLoad() do_test_pending(); var listener = new ImageListener(checkClone, secondLoadDone); - requests.push(gCurrentLoader.loadImage(uri, null, null, null, null, listener, null, 0, null, null, null)); + var outer = Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools) + .createScriptedObserver(listener); + requests.push(gCurrentLoader.loadImage(uri, null, null, null, null, outer, null, 0, null, null, null)); listener.synchronous = false; } @@ -102,10 +112,10 @@ function firstLoadDone(oldlistener, aRequest) function getChannelLoadImageStartCallback(streamlistener) { return function channelLoadStart(imglistener, aRequest) { - // We must not have received any status before we get this start callback. + // We must not have received all status before we get this start callback. // If we have, we've broken people's expectations by delaying events from a // channel we were given. - do_check_eq(streamlistener.requestStatus, 0); + do_check_eq(streamlistener.requestStatus & STOP_REQUEST, 0); checkClone(imglistener, aRequest); } @@ -141,8 +151,10 @@ function checkSecondChannelLoad() var listener = new ImageListener(getChannelLoadImageStartCallback(channellistener), getChannelLoadImageStopCallback(channellistener, all_done_callback)); + var outer = Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools) + .createScriptedObserver(listener); var outlistener = {}; - requests.push(gCurrentLoader.loadImageWithChannel(channel, listener, null, outlistener)); + requests.push(gCurrentLoader.loadImageWithChannel(channel, outer, null, outlistener)); channellistener.outputListener = outlistener.value; listener.synchronous = false; @@ -163,8 +175,10 @@ function run_loadImageWithChannel_tests() var listener = new ImageListener(getChannelLoadImageStartCallback(channellistener), getChannelLoadImageStopCallback(channellistener, checkSecondChannelLoad)); + var outer = Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools) + .createScriptedObserver(listener); var outlistener = {}; - requests.push(gCurrentLoader.loadImageWithChannel(channel, listener, null, outlistener)); + requests.push(gCurrentLoader.loadImageWithChannel(channel, outer, null, outlistener)); channellistener.outputListener = outlistener.value; listener.synchronous = false; @@ -182,7 +196,9 @@ function startImageCallback(otherCb) // Make sure we can load the same image immediately out of the cache. do_test_pending(); var listener2 = new ImageListener(null, function(foo, bar) { do_test_finished(); }); - requests.push(gCurrentLoader.loadImage(uri, null, null, null, null, listener2, null, 0, null, null, null)); + var outer = Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools) + .createScriptedObserver(listener2); + requests.push(gCurrentLoader.loadImage(uri, null, null, null, null, outer, null, 0, null, null, null)); listener2.synchronous = false; // Now that we've started another load, chain to the callback. @@ -198,7 +214,9 @@ function run_test() do_test_pending(); var listener = new ImageListener(startImageCallback(checkClone), firstLoadDone); - var req = gCurrentLoader.loadImage(uri, null, null, null, null, listener, null, 0, null, null, null); + var outer = Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools) + .createScriptedObserver(listener); + var req = gCurrentLoader.loadImage(uri, null, null, null, null, outer, null, 0, null, null, null); requests.push(req); // Ensure that we don't cause any mayhem when we lock an image. diff --git a/image/test/unit/image_load_helpers.js b/image/test/unit/image_load_helpers.js index 44a02b1a12cb..96f7d7189585 100644 --- a/image/test/unit/image_load_helpers.js +++ b/image/test/unit/image_load_helpers.js @@ -2,86 +2,65 @@ * Helper structures to track callbacks from image and channel loads. */ -// One bit per callback that imageListener below implements. Stored in -// ImageListener.state. -// START_REQUEST and STOP_REQUEST are also reused by ChannelListener, and +// START_REQUEST and STOP_REQUEST are used by ChannelListener, and // stored in ChannelListener.requestStatus. const START_REQUEST = 0x01; -const START_DECODE = 0x02; -const START_CONTAINER = 0x04; -const START_FRAME = 0x08; -const STOP_FRAME = 0x10; -const STOP_CONTAINER = 0x20; -const STOP_DECODE = 0x40; -const STOP_REQUEST = 0x80; -const ALL_BITS = 0xFF; +const STOP_REQUEST = 0x02; +const DATA_AVAILABLE = 0x04; + +// One bit per callback that imageListener below implements. Stored in +// ImageListener.state. +const SIZE_AVAILABLE = 0x01; +const FRAME_UPDATE = 0x02; +const FRAME_COMPLETE = 0x04; +const LOAD_COMPLETE = 0x08; +const DECODE_COMPLETE = 0x10; +const ALL_BITS = SIZE_AVAILABLE | FRAME_COMPLETE | DECODE_COMPLETE | LOAD_COMPLETE; // An implementation of imgIDecoderObserver with the ability to call specified // functions on onStartRequest and onStopRequest. function ImageListener(start_callback, stop_callback) { - this.onStartRequest = function onStartRequest(aRequest) + this.sizeAvailable = function onSizeAvailable(aRequest) { do_check_false(this.synchronous); - this.state |= START_REQUEST; + this.state |= SIZE_AVAILABLE; if (this.start_callback) this.start_callback(this, aRequest); } - this.onStartDecode = function onStartDecode(aRequest) + this.frameComplete = function onFrameComplete(aRequest) { do_check_false(this.synchronous); - this.state |= START_DECODE; + this.state |= FRAME_COMPLETE; } - this.onStartContainer = function onStartContainer(aRequest, aContainer) + this.decodeComplete = function onDecodeComplete(aRequest) { do_check_false(this.synchronous); - this.state |= START_CONTAINER; + this.state |= DECODE_COMPLETE; } - this.onStartFrame = function onStartFrame(aRequest, aFrame) + this.loadComplete = function onLoadcomplete(aRequest) { do_check_false(this.synchronous); - this.state |= START_FRAME; - } - this.onStopFrame = function onStopFrame(aRequest, aFrame) - { - do_check_false(this.synchronous); - - this.state |= STOP_FRAME; - } - this.onStopContainer = function onStopContainer(aRequest, aContainer) - { - do_check_false(this.synchronous); - - this.state |= STOP_CONTAINER; - } - this.onStopDecode = function onStopDecode(aRequest, status, statusArg) - { - do_check_false(this.synchronous); - - this.state |= STOP_DECODE; - } - this.onStopRequest = function onStopRequest(aRequest, aIsLastPart) - { - do_check_false(this.synchronous); - - // onStopDecode must always be called before, and with, onStopRequest. See - // imgRequest::OnStopDecode for more information. - do_check_true(!!(this.state & STOP_DECODE)); - // We have to cancel the request when we're done with it to break any // reference loops! aRequest.cancelAndForgetObserver(0); - this.state |= STOP_REQUEST; + this.state |= LOAD_COMPLETE; if (this.stop_callback) this.stop_callback(this, aRequest); } + this.frameUpdate = function onFrameUpdate(aRequest) + { + } + this.isAnimated = function onIsAnimated() + { + } // Initialize the synchronous flag to true to start. This must be set to // false before exiting to the event loop! @@ -118,6 +97,8 @@ function ChannelListener() { if (this.outputListener) this.outputListener.onDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount); + + this.requestStatus |= DATA_AVAILABLE; } this.onStopRequest = function onStopRequest(aRequest, aContext, aStatusCode) diff --git a/image/test/unit/test_private_channel.js b/image/test/unit/test_private_channel.js index d15eb4613c86..6682f3ce3a59 100644 --- a/image/test/unit/test_private_channel.js +++ b/image/test/unit/test_private_channel.js @@ -55,21 +55,25 @@ function setup_chan(path, isPrivate, callback) { chan.asyncOpen(channelListener, null); var listener = new ImageListener(null, callback); - listeners.push(listener); var outlistener = {}; var loader = isPrivate ? gPrivateLoader : gPublicLoader; - requests.push(loader.loadImageWithChannel(chan, listener, null, outlistener)); + var outer = Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools) + .createScriptedObserver(listener); + listeners.push(outer); + requests.push(loader.loadImageWithChannel(chan, outer, null, outlistener)); channelListener.outputListener = outlistener.value; listener.synchronous = false; } function loadImage(isPrivate, callback) { var listener = new ImageListener(null, callback); + var outer = Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools) + .createScriptedObserver(listener); var uri = gIoService.newURI(gImgPath, null, null); var loadGroup = Cc["@mozilla.org/network/load-group;1"].createInstance(Ci.nsILoadGroup); loadGroup.notificationCallbacks = new NotificationCallbacks(isPrivate); var loader = isPrivate ? gPrivateLoader : gPublicLoader; - requests.push(loader.loadImage(uri, null, null, null, loadGroup, listener, null, 0, null, null, null)); + requests.push(loader.loadImage(uri, null, null, null, loadGroup, outer, null, 0, null, null, null)); listener.synchronous = false; } diff --git a/js/public/MemoryMetrics.h b/js/public/MemoryMetrics.h index 5cec834fca6d..689b8b8ab4d6 100644 --- a/js/public/MemoryMetrics.h +++ b/js/public/MemoryMetrics.h @@ -53,7 +53,7 @@ struct RuntimeSizes , ionCode(0) , regexpCode(0) , unusedCode(0) - , stackCommitted(0) + , stack(0) , gcMarker(0) , mathCache(0) , scriptFilenames(0) @@ -69,7 +69,7 @@ struct RuntimeSizes size_t ionCode; size_t regexpCode; size_t unusedCode; - size_t stackCommitted; + size_t stack; size_t gcMarker; size_t mathCache; size_t scriptFilenames; diff --git a/js/src/jscntxt.cpp b/js/src/jscntxt.cpp index 7444782120d1..30451c9ba558 100644 --- a/js/src/jscntxt.cpp +++ b/js/src/jscntxt.cpp @@ -125,7 +125,7 @@ JSRuntime::sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf, RuntimeSizes *rtS rtSizes->unusedCode = 0; } - rtSizes->stackCommitted = stackSpace.sizeOfCommitted(); + rtSizes->stack = stackSpace.sizeOf(); rtSizes->gcMarker = gcMarker.sizeOfExcludingThis(mallocSizeOf); @@ -139,12 +139,15 @@ JSRuntime::sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf, RuntimeSizes *rtS size_t JSRuntime::sizeOfExplicitNonHeap() { - if (!execAlloc_) - return 0; + size_t size = stackSpace.sizeOf(); - size_t jaegerCode, ionCode, regexpCode, unusedCode; - execAlloc_->sizeOfCode(&jaegerCode, &ionCode, ®expCode, &unusedCode); - return jaegerCode + ionCode + regexpCode + unusedCode + stackSpace.sizeOfCommitted(); + if (execAlloc_) { + size_t jaegerCode, ionCode, regexpCode, unusedCode; + execAlloc_->sizeOfCode(&jaegerCode, &ionCode, ®expCode, &unusedCode); + size += jaegerCode + ionCode + regexpCode + unusedCode; + } + + return size; } void diff --git a/js/src/vm/Stack.cpp b/js/src/vm/Stack.cpp index 0e6a51d4227d..437f8c16eea9 100644 --- a/js/src/vm/Stack.cpp +++ b/js/src/vm/Stack.cpp @@ -810,11 +810,58 @@ StackSpace::tryBumpLimit(JSContext *cx, Value *from, unsigned nvals, Value **lim } size_t -StackSpace::sizeOfCommitted() +StackSpace::sizeOf() { -#ifdef XP_WIN +#if defined(XP_UNIX) + /* + * Measure how many of our pages are resident in RAM using mincore, and + * return that as our size. This is slow, but hopefully nobody expects + * this method to be fast. + * + * Note that using mincore means that we don't count pages of the stack + * which are swapped out to disk. We really should, but what we have here + * is better than counting the whole stack! + */ + + const int pageSize = getpagesize(); + size_t numBytes = (trustedEnd_ - base_) * sizeof(Value); + size_t numPages = (numBytes + pageSize - 1) / pageSize; + + // On Linux, mincore's third argument has type unsigned char*. On Mac, it + // has type char*. +#if defined(XP_MACOSX) + typedef char MincoreArgType; +#else + typedef unsigned char MincoreArgType; +#endif + + MincoreArgType *vec = (MincoreArgType *) js_malloc(numPages); + int result = mincore(base_, numBytes, vec); + if (result) { + js_free(vec); + /* + * If mincore fails us, return the vsize (like we do below if we're not + * on Windows or Unix). + */ + return (trustedEnd_ - base_) * sizeof(Value); + } + + size_t residentBytes = 0; + for (size_t i = 0; i < numPages; i++) { + /* vec[i] has its least-significant bit set iff page i is in RAM. */ + if (vec[i] & 0x1) + residentBytes += pageSize; + } + js_free(vec); + return residentBytes; + +#elif defined(XP_WIN) return (commitEnd_ - base_) * sizeof(Value); #else + /* + * Return the stack's virtual size, which is at least an upper bound on its + * resident size. + */ return (trustedEnd_ - base_) * sizeof(Value); #endif } diff --git a/js/src/vm/Stack.h b/js/src/vm/Stack.h index 01ad14790934..d6406009e2b3 100644 --- a/js/src/vm/Stack.h +++ b/js/src/vm/Stack.h @@ -1439,8 +1439,12 @@ class StackSpace /* Called during GC: sets active flag on compartments with active frames. */ void markActiveCompartments(); - /* We only report the committed size; uncommitted size is uninteresting. */ - JS_FRIEND_API(size_t) sizeOfCommitted(); + /* + * On Windows, report the committed size; on *nix, we report the resident + * size (which means that if part of the stack is swapped to disk, we say + * it's shrunk). + */ + JS_FRIEND_API(size_t) sizeOf(); #ifdef DEBUG /* Only used in assertion of debuggers API. */ diff --git a/js/xpconnect/loader/mozJSComponentLoader.cpp b/js/xpconnect/loader/mozJSComponentLoader.cpp index 75fd77704a04..c1e935d10c3f 100644 --- a/js/xpconnect/loader/mozJSComponentLoader.cpp +++ b/js/xpconnect/loader/mozJSComponentLoader.cpp @@ -770,8 +770,7 @@ mozJSComponentLoader::GlobalForLocation(nsIFile *aComponentFile, // Make sure the file map is closed, no matter how we return. FileMapAutoCloser mapCloser(map); - uint32_t fileSize32; - LL_L2UI(fileSize32, fileSize); + uint32_t fileSize32 = fileSize; char *buf = static_cast(PR_MemMap(map, 0, fileSize32)); if (!buf) { diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index f16480e337ae..71af1fc58421 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -1743,11 +1743,15 @@ ReportJSRuntimeExplicitTreeStats(const JS::RuntimeStats &rtStats, "Memory allocated by one of the JITs to hold the " "runtime's code, but which is currently unused."); - RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/stack-committed"), - nsIMemoryReporter::KIND_NONHEAP, rtStats.runtime.stackCommitted, + RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/stack"), + nsIMemoryReporter::KIND_NONHEAP, rtStats.runtime.stack, "Memory used for the JS call stack. This is the committed " - "portion of the stack; the uncommitted portion is not " - "measured because it hardly costs anything."); + "portion of the stack on Windows; on *nix, it is the resident " + "portion of the stack. Therefore, on *nix, if part of the " + "stack is swapped out to disk, we do not count it here.\n\n" + "Note that debug builds usually have stack poisoning enabled, " + "which causes the whole stack to be committed (and likely " + "resident)."); RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/gc-marker"), nsIMemoryReporter::KIND_HEAP, rtStats.runtime.gcMarker, diff --git a/js/xpconnect/src/dom_quickstubs.qsconf b/js/xpconnect/src/dom_quickstubs.qsconf index f8550f68ce67..321c2f026050 100644 --- a/js/xpconnect/src/dom_quickstubs.qsconf +++ b/js/xpconnect/src/dom_quickstubs.qsconf @@ -57,8 +57,7 @@ members = [ # dom/interfaces/canvas # - # nsIDOMCanvasRenderingContext2D and friends - 'nsIDOMCanvasRenderingContext2D.*', + # canvas friends 'nsIDOMTextMetrics.*', 'nsIDOMCanvasGradient.*', 'nsIDOMCanvasPattern.*', @@ -489,10 +488,6 @@ customIncludes = [ 'mozilla/dom/ImageData.h' ] -customQuickStubs = [ - 'CustomQS_Canvas2D.h' - ] - customReturnInterfaces = [ 'nsIDOMCanvasPattern', 'nsIDOMCanvasGradient', @@ -649,10 +644,6 @@ customMethodCalls = { 'nsIDOMStorage_Clear': { 'code': nsIDOMStorage_Clear_customMethodCallCode }, - 'nsIDOMCanvasRenderingContext2D_StrokeStyle': { 'skipgen': True }, - 'nsIDOMCanvasRenderingContext2D_StrokeStyle': { 'skipgen': True }, - 'nsIDOMCanvasRenderingContext2D_FillStyle': { 'skipgen': True }, - 'nsIDOMCanvasRenderingContext2D_FillStyle': { 'skipgen': True }, 'nsIDOMCSS2Properties_': { 'thisType': 'nsICSSDeclaration', 'additionalArguments': 'const nsCSSProperty prop', @@ -971,13 +962,6 @@ customMethodCalls = { 'thisType' : 'nsIDOMWindow', 'unwrapThisFailureFatal' : False }, - # Canvas 2D - 'nsIDOMCanvasRenderingContext2D_CreateImageData': CUSTOM_QS, - 'nsIDOMCanvasRenderingContext2D_PutImageData': CUSTOM_QS, - # Nasty hack to make the ordering of |arc| and |arcTo| correct. - # |arc| is not traceable because it has an optional argument. - 'nsIDOMCanvasRenderingContext2D_ArcTo' : { 'traceable' : False }, - 'nsIDOMImageData_GetWidth': { 'thisType': 'nsIDOMImageData', 'code': 'uint32_t result = static_cast(self)->GetWidth();', @@ -992,4 +976,3 @@ customMethodCalls = { 'canFail': False } } - diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp index 1c680ca45c20..5607645880b6 100644 --- a/layout/build/nsLayoutModule.cpp +++ b/layout/build/nsLayoutModule.cpp @@ -433,7 +433,6 @@ nsresult NS_NewTreeBoxObject(nsIBoxObject** aResult); #endif nsresult NS_NewCanvasRenderingContext2D(nsIDOMCanvasRenderingContext2D** aResult); -nsresult NS_NewCanvasRenderingContext2DThebes(nsIDOMCanvasRenderingContext2D** aResult); nsresult NS_NewCanvasRenderingContextWebGL(nsIDOMWebGLRenderingContext** aResult); nsresult NS_NewDomSelection(nsISelection** aResult); @@ -555,7 +554,6 @@ MAKE_CTOR(CreateVideoDocument, nsIDocument, NS_NewVid MAKE_CTOR(CreateFocusManager, nsIFocusManager, NS_NewFocusManager) MAKE_CTOR(CreateCanvasRenderingContext2D, nsIDOMCanvasRenderingContext2D, NS_NewCanvasRenderingContext2D) -MAKE_CTOR(CreateCanvasRenderingContext2DThebes, nsIDOMCanvasRenderingContext2D, NS_NewCanvasRenderingContext2DThebes) MAKE_CTOR(CreateCanvasRenderingContextWebGL, nsIDOMWebGLRenderingContext, NS_NewCanvasRenderingContextWebGL) NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsStyleSheetService, Init) @@ -718,7 +716,6 @@ NS_DEFINE_NAMED_CID(NS_HTMLOPTIONELEMENT_CID); NS_DEFINE_NAMED_CID(NS_HTMLAUDIOELEMENT_CID); #endif NS_DEFINE_NAMED_CID(NS_CANVASRENDERINGCONTEXT2D_CID); -NS_DEFINE_NAMED_CID(NS_CANVASRENDERINGCONTEXT2DTHEBES_CID); NS_DEFINE_NAMED_CID(NS_CANVASRENDERINGCONTEXTWEBGL_CID); NS_DEFINE_NAMED_CID(NS_TEXT_ENCODER_CID); NS_DEFINE_NAMED_CID(NS_HTMLCOPY_TEXT_ENCODER_CID); @@ -1000,7 +997,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = { #ifdef MOZ_MEDIA { &kNS_HTMLAUDIOELEMENT_CID, false, NULL, CreateHTMLAudioElement }, #endif - { &kNS_CANVASRENDERINGCONTEXT2DTHEBES_CID, false, NULL, CreateCanvasRenderingContext2DThebes }, { &kNS_CANVASRENDERINGCONTEXT2D_CID, false, NULL, CreateCanvasRenderingContext2D }, { &kNS_CANVASRENDERINGCONTEXTWEBGL_CID, false, NULL, CreateCanvasRenderingContextWebGL }, { &kNS_TEXT_ENCODER_CID, false, NULL, CreateTextEncoder }, @@ -1146,7 +1142,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = { { NS_HTMLAUDIOELEMENT_CONTRACTID, &kNS_HTMLAUDIOELEMENT_CID }, #endif { "@mozilla.org/content/canvas-rendering-context;1?id=2d", &kNS_CANVASRENDERINGCONTEXT2D_CID }, - { "@mozilla.org/content/2dthebes-canvas-rendering-context;1", &kNS_CANVASRENDERINGCONTEXT2DTHEBES_CID }, { "@mozilla.org/content/canvas-rendering-context;1?id=moz-webgl", &kNS_CANVASRENDERINGCONTEXTWEBGL_CID }, { "@mozilla.org/content/canvas-rendering-context;1?id=experimental-webgl", &kNS_CANVASRENDERINGCONTEXTWEBGL_CID }, { NS_DOC_ENCODER_CONTRACTID_BASE "text/xml", &kNS_TEXT_ENCODER_CID }, diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 71f37f237a0a..5c4761da58d6 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -1236,7 +1236,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext, int32_t numLines = mLines.size(); if (!numLines) numLines = 1; PRTime delta, perLineDelta, lines; - LL_I2L(lines, numLines); + lines = int64_t(numLines); delta = end - start; perLineDelta = delta / lines; @@ -6207,7 +6207,7 @@ nsBlockFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, int32_t numLines = mLines.size(); if (!numLines) numLines = 1; PRTime lines, deltaPerLine, delta; - LL_I2L(lines, numLines); + lines = int64_t(numLines); delta = end - start; deltaPerLine = delta / lines; diff --git a/layout/generic/nsBulletFrame.cpp b/layout/generic/nsBulletFrame.cpp index 68b2dafbfc0f..0f0d822ca2c5 100644 --- a/layout/generic/nsBulletFrame.cpp +++ b/layout/generic/nsBulletFrame.cpp @@ -1431,9 +1431,36 @@ nsBulletFrame::GetPrefWidth(nsRenderingContext *aRenderingContext) return metrics.width; } +NS_IMETHODIMP +nsBulletFrame::Notify(imgIRequest *aRequest, int32_t aType, const nsIntRect* aData) +{ + if (aType == imgINotificationObserver::SIZE_AVAILABLE) { + nsCOMPtr image; + aRequest->GetImage(getter_AddRefs(image)); + return OnStartContainer(aRequest, image); + } -NS_IMETHODIMP nsBulletFrame::OnStartContainer(imgIRequest *aRequest, - imgIContainer *aImage) + if (aType == imgINotificationObserver::FRAME_UPDATE) { + // The image has changed. + // Invalidate the entire content area. Maybe it's not optimal but it's simple and + // always correct, and I'll be a stunned mullet if it ever matters for performance + InvalidateFrame(); + } + + if (aType == imgINotificationObserver::IS_ANIMATED) { + // Register the image request with the refresh driver now that we know it's + // animated. + if (aRequest == mImageRequest) { + nsLayoutUtils::RegisterImageRequest(PresContext(), mImageRequest, + &mRequestRegistered); + } + } + + return NS_OK; +} + +nsresult nsBulletFrame::OnStartContainer(imgIRequest *aRequest, + imgIContainer *aImage) { if (!aImage) return NS_ERROR_INVALID_ARG; if (!aRequest) return NS_ERROR_INVALID_ARG; @@ -1475,60 +1502,6 @@ NS_IMETHODIMP nsBulletFrame::OnStartContainer(imgIRequest *aRequest, return NS_OK; } -NS_IMETHODIMP nsBulletFrame::OnDataAvailable(imgIRequest *aRequest, - bool aCurrentFrame, - const nsIntRect *aRect) -{ - // The image has changed. - // Invalidate the entire content area. Maybe it's not optimal but it's simple and - // always correct, and I'll be a stunned mullet if it ever matters for performance - InvalidateFrame(); - - return NS_OK; -} - -NS_IMETHODIMP nsBulletFrame::OnStopDecode(imgIRequest *aRequest, - nsresult aStatus, - const PRUnichar *aStatusArg) -{ - // XXX should the bulletframe do anything if the image failed to load? - // it didn't in the old code... - -#if 0 - if (NS_FAILED(aStatus)) { - // We failed to load the image. Notify the pres shell - if (NS_FAILED(aStatus) && (mImageRequest == aRequest || !mImageRequest)) { - imageFailed = true; - } - } -#endif - - return NS_OK; -} - -NS_IMETHODIMP nsBulletFrame::OnImageIsAnimated(imgIRequest* aRequest) -{ - // Register the image request with the refresh driver now that we know it's - // animated. - if (aRequest == mImageRequest) { - nsLayoutUtils::RegisterImageRequest(PresContext(), mImageRequest, - &mRequestRegistered); - } - - return NS_OK; -} - -NS_IMETHODIMP nsBulletFrame::FrameChanged(imgIRequest *aRequest, - imgIContainer *aContainer, - const nsIntRect *aDirtyRect) -{ - // Invalidate the entire content area. Maybe it's not optimal but it's simple and - // always correct. - InvalidateFrame(); - - return NS_OK; -} - void nsBulletFrame::GetLoadGroup(nsPresContext *aPresContext, nsILoadGroup **aLoadGroup) { @@ -1624,7 +1597,7 @@ nsBulletFrame::GetBaseline() const -NS_IMPL_ISUPPORTS2(nsBulletListener, imgIDecoderObserver, imgIContainerObserver) +NS_IMPL_ISUPPORTS1(nsBulletListener, imgINotificationObserver) nsBulletListener::nsBulletListener() : mFrame(nullptr) @@ -1635,49 +1608,10 @@ nsBulletListener::~nsBulletListener() { } -NS_IMETHODIMP nsBulletListener::OnStartContainer(imgIRequest *aRequest, - imgIContainer *aImage) +NS_IMETHODIMP +nsBulletListener::Notify(imgIRequest *aRequest, int32_t aType, const nsIntRect* aData) { if (!mFrame) return NS_ERROR_FAILURE; - - return mFrame->OnStartContainer(aRequest, aImage); -} - -NS_IMETHODIMP nsBulletListener::OnDataAvailable(imgIRequest *aRequest, - bool aCurrentFrame, - const nsIntRect *aRect) -{ - if (!mFrame) - return NS_OK; - - return mFrame->OnDataAvailable(aRequest, aCurrentFrame, aRect); -} - -NS_IMETHODIMP nsBulletListener::OnStopDecode(imgIRequest *aRequest, - nsresult status, - const PRUnichar *statusArg) -{ - if (!mFrame) - return NS_OK; - - return mFrame->OnStopDecode(aRequest, status, statusArg); -} - -NS_IMETHODIMP nsBulletListener::OnImageIsAnimated(imgIRequest *aRequest) -{ - if (!mFrame) - return NS_OK; - - return mFrame->OnImageIsAnimated(aRequest); -} - -NS_IMETHODIMP nsBulletListener::FrameChanged(imgIRequest *aRequest, - imgIContainer *aContainer, - const nsIntRect *aDirtyRect) -{ - if (!mFrame) - return NS_OK; - - return mFrame->FrameChanged(aRequest, aContainer, aDirtyRect); + return mFrame->Notify(aRequest, aType, aData); } diff --git a/layout/generic/nsBulletFrame.h b/layout/generic/nsBulletFrame.h index 96df3cceffdc..c51a8e94c90a 100644 --- a/layout/generic/nsBulletFrame.h +++ b/layout/generic/nsBulletFrame.h @@ -14,32 +14,21 @@ #include "imgIRequest.h" #include "imgIDecoderObserver.h" -#include "nsStubImageDecoderObserver.h" +#include "imgINotificationObserver.h" #define BULLET_FRAME_IMAGE_LOADING NS_FRAME_STATE_BIT(63) #define BULLET_FRAME_HAS_FONT_INFLATION NS_FRAME_STATE_BIT(62) class nsBulletFrame; -class nsBulletListener : public nsStubImageDecoderObserver +class nsBulletListener : public imgINotificationObserver { public: nsBulletListener(); virtual ~nsBulletListener(); NS_DECL_ISUPPORTS - // imgIDecoderObserver (override nsStubImageDecoderObserver) - NS_IMETHOD OnStartContainer(imgIRequest *aRequest, imgIContainer *aImage); - NS_IMETHOD OnDataAvailable(imgIRequest *aRequest, bool aCurrentFrame, - const nsIntRect *aRect); - NS_IMETHOD OnStopDecode(imgIRequest *aRequest, nsresult status, - const PRUnichar *statusArg); - NS_IMETHOD OnImageIsAnimated(imgIRequest *aRequest); - - // imgIContainerObserver (override nsStubImageDecoderObserver) - NS_IMETHOD FrameChanged(imgIRequest *aRequest, - imgIContainer *aContainer, - const nsIntRect *dirtyRect); + NS_DECL_IMGINOTIFICATIONOBSERVER void SetFrame(nsBulletFrame *frame) { mFrame = frame; } @@ -61,6 +50,8 @@ public: } virtual ~nsBulletFrame(); + NS_IMETHOD Notify(imgIRequest *aRequest, int32_t aType, const nsIntRect* aData); + // nsIFrame virtual void DestroyFrom(nsIFrame* aDestructRoot); NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder, @@ -85,18 +76,6 @@ public: int32_t aIncrement); - NS_IMETHOD OnStartContainer(imgIRequest *aRequest, imgIContainer *aImage); - NS_IMETHOD OnDataAvailable(imgIRequest *aRequest, - bool aCurrentFrame, - const nsIntRect *aRect); - NS_IMETHOD OnStopDecode(imgIRequest *aRequest, - nsresult aStatus, - const PRUnichar *aStatusArg); - NS_IMETHOD OnImageIsAnimated(imgIRequest *aRequest); - NS_IMETHOD FrameChanged(imgIRequest *aRequest, - imgIContainer *aContainer, - const nsIntRect *aDirtyRect); - /* get list item text, without '.' */ static bool AppendCounterText(int32_t aListStyleType, int32_t aOrdinal, @@ -120,6 +99,8 @@ public: void SetFontSizeInflation(float aInflation); protected: + nsresult OnStartContainer(imgIRequest *aRequest, imgIContainer *aImage); + void GetDesiredSize(nsPresContext* aPresContext, nsRenderingContext *aRenderingContext, nsHTMLReflowMetrics& aMetrics, diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index 890783c2e2d1..75be7b649fa1 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -140,7 +140,8 @@ nsImageFrame::nsImageFrame(nsStyleContext* aContext) : ImageFrameSuper(aContext), mComputedSize(0, 0), mIntrinsicRatio(0, 0), - mDisplayingIcon(false) + mDisplayingIcon(false), + mFirstFrameComplete(false) { // We assume our size is not constrained and we haven't gotten an // initial reflow yet, so don't touch those flags. @@ -525,6 +526,34 @@ nsImageFrame::ShouldCreateImageFrameFor(Element* aElement, return useSizedBox; } +nsresult +nsImageFrame::Notify(imgIRequest* aRequest, int32_t aType, const nsIntRect* aData) +{ + if (aType == imgINotificationObserver::SIZE_AVAILABLE) { + nsCOMPtr image; + aRequest->GetImage(getter_AddRefs(image)); + return OnStartContainer(aRequest, image); + } + + if (aType == imgINotificationObserver::FRAME_UPDATE) { + return OnDataAvailable(aRequest, aData); + } + + if (aType == imgINotificationObserver::FRAME_COMPLETE) { + mFirstFrameComplete = true; + } + + if (aType == imgINotificationObserver::LOAD_COMPLETE) { + uint32_t imgStatus; + aRequest->GetImageStatus(&imgStatus); + nsresult status = + imgStatus & imgIRequest::STATUS_ERROR ? NS_ERROR_FAILURE : NS_OK; + return OnStopRequest(aRequest, status); + } + + return NS_OK; +} + nsresult nsImageFrame::OnStartContainer(imgIRequest *aRequest, imgIContainer *aImage) { @@ -564,9 +593,14 @@ nsImageFrame::OnStartContainer(imgIRequest *aRequest, imgIContainer *aImage) nsresult nsImageFrame::OnDataAvailable(imgIRequest *aRequest, - bool aCurrentFrame, const nsIntRect *aRect) { + if (mFirstFrameComplete) { + nsCOMPtr container; + aRequest->GetImage(getter_AddRefs(container)); + return FrameChanged(aRequest, container); + } + // XXX do we need to make sure that the reflow from the // OnStartContainer has been processed before we start calling // invalidate? @@ -583,11 +617,6 @@ nsImageFrame::OnDataAvailable(imgIRequest *aRequest, return NS_OK; } - // Don't invalidate if the current visible frame isn't the one the data is - // from - if (!aCurrentFrame) - return NS_OK; - #ifdef DEBUG_decode printf("Source rect (%d,%d,%d,%d)\n", aRect->x, aRect->y, aRect->width, aRect->height); @@ -601,14 +630,13 @@ nsImageFrame::OnDataAvailable(imgIRequest *aRequest, InvalidateFrameWithRect(invalid, nsDisplayItem::TYPE_IMAGE); InvalidateFrameWithRect(invalid, nsDisplayItem::TYPE_ALT_FEEDBACK); } - + return NS_OK; } nsresult -nsImageFrame::OnStopDecode(imgIRequest *aRequest, - nsresult aStatus, - const PRUnichar *aStatusArg) +nsImageFrame::OnStopRequest(imgIRequest *aRequest, + nsresult aStatus) { // Check what request type we're dealing with nsCOMPtr imageLoader = do_QueryInterface(mContent); @@ -667,8 +695,7 @@ nsImageFrame::NotifyNewCurrentRequest(imgIRequest *aRequest, nsresult nsImageFrame::FrameChanged(imgIRequest *aRequest, - imgIContainer *aContainer, - const nsIntRect *aDirtyRect) + imgIContainer *aContainer) { if (!GetStyleVisibility()->IsVisible()) { return NS_OK; @@ -1894,7 +1921,7 @@ nsresult nsImageFrame::LoadIcons(nsPresContext *aPresContext) } NS_IMPL_ISUPPORTS2(nsImageFrame::IconLoad, nsIObserver, - imgIDecoderObserver) + imgINotificationObserver) static const char* kIconLoadPrefs[] = { "browser.display.force_inline_alttext", @@ -1951,74 +1978,14 @@ void nsImageFrame::IconLoad::GetPrefs() Preferences::GetBool("browser.display.show_image_placeholders", true); } - - NS_IMETHODIMP -nsImageFrame::IconLoad::OnStartRequest(imgIRequest *aRequest) +nsImageFrame::IconLoad::Notify(imgIRequest *aRequest, int32_t aType, const nsIntRect* aData) { - return NS_OK; -} + if (aType != imgINotificationObserver::LOAD_COMPLETE && + aType != imgINotificationObserver::FRAME_UPDATE) { + return NS_OK; + } -NS_IMETHODIMP -nsImageFrame::IconLoad::OnStartDecode(imgIRequest *aRequest) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsImageFrame::IconLoad::OnStartContainer(imgIRequest *aRequest, - imgIContainer *aContainer) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsImageFrame::IconLoad::OnStartFrame(imgIRequest *aRequest, - uint32_t aFrame) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsImageFrame::IconLoad::OnDataAvailable(imgIRequest *aRequest, - bool aCurrentFrame, - const nsIntRect * aRect) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsImageFrame::IconLoad::OnStopFrame(imgIRequest *aRequest, - uint32_t aFrame) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsImageFrame::IconLoad::OnStopContainer(imgIRequest *aRequest, - imgIContainer *aContainer) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsImageFrame::IconLoad::OnStopDecode(imgIRequest *aRequest, - nsresult status, - const PRUnichar *statusArg) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsImageFrame::IconLoad::OnImageIsAnimated(imgIRequest *aRequest) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsImageFrame::IconLoad::OnStopRequest(imgIRequest *aRequest, - bool aIsLastPart) -{ nsTObserverArray::ForwardIterator iter(mIconObservers); nsImageFrame *frame; while (iter.HasMore()) { @@ -2029,30 +1996,7 @@ nsImageFrame::IconLoad::OnStopRequest(imgIRequest *aRequest, return NS_OK; } -NS_IMETHODIMP -nsImageFrame::IconLoad::OnDiscard(imgIRequest *aRequest) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsImageFrame::IconLoad::FrameChanged(imgIRequest *aRequest, - imgIContainer *aContainer, - const nsIntRect *aDirtyRect) -{ - nsTObserverArray::ForwardIterator iter(mIconObservers); - nsImageFrame *frame; - while (iter.HasMore()) { - frame = iter.GetNext(); - frame->InvalidateFrame(); - } - - return NS_OK; -} - - - -NS_IMPL_ISUPPORTS2(nsImageListener, imgIDecoderObserver, imgIContainerObserver) +NS_IMPL_ISUPPORTS1(nsImageListener, imgINotificationObserver) nsImageListener::nsImageListener(nsImageFrame *aFrame) : mFrame(aFrame) @@ -2063,43 +2007,13 @@ nsImageListener::~nsImageListener() { } -NS_IMETHODIMP nsImageListener::OnStartContainer(imgIRequest *aRequest, - imgIContainer *aImage) +NS_IMETHODIMP +nsImageListener::Notify(imgIRequest *aRequest, int32_t aType, const nsIntRect* aData) { if (!mFrame) return NS_ERROR_FAILURE; - return mFrame->OnStartContainer(aRequest, aImage); -} - -NS_IMETHODIMP nsImageListener::OnDataAvailable(imgIRequest *aRequest, - bool aCurrentFrame, - const nsIntRect *aRect) -{ - if (!mFrame) - return NS_ERROR_FAILURE; - - return mFrame->OnDataAvailable(aRequest, aCurrentFrame, aRect); -} - -NS_IMETHODIMP nsImageListener::OnStopDecode(imgIRequest *aRequest, - nsresult status, - const PRUnichar *statusArg) -{ - if (!mFrame) - return NS_ERROR_FAILURE; - - return mFrame->OnStopDecode(aRequest, status, statusArg); -} - -NS_IMETHODIMP nsImageListener::FrameChanged(imgIRequest *aRequest, - imgIContainer *aContainer, - const nsIntRect *aDirtyRect) -{ - if (!mFrame) - return NS_ERROR_FAILURE; - - return mFrame->FrameChanged(aRequest, aContainer, aDirtyRect); + return mFrame->Notify(aRequest, aType, aData); } static bool diff --git a/layout/generic/nsImageFrame.h b/layout/generic/nsImageFrame.h index dbb68ae5b3e6..702e46c24128 100644 --- a/layout/generic/nsImageFrame.h +++ b/layout/generic/nsImageFrame.h @@ -12,8 +12,7 @@ #include "nsIIOService.h" #include "nsIObserver.h" -#include "nsStubImageDecoderObserver.h" -#include "imgIDecoderObserver.h" +#include "imgINotificationObserver.h" #include "nsDisplayList.h" #include "imgIContainer.h" @@ -40,23 +39,14 @@ namespace layers { } } -class nsImageListener : public nsStubImageDecoderObserver +class nsImageListener : public imgINotificationObserver { public: nsImageListener(nsImageFrame *aFrame); virtual ~nsImageListener(); NS_DECL_ISUPPORTS - // imgIDecoderObserver (override nsStubImageDecoderObserver) - NS_IMETHOD OnStartContainer(imgIRequest *aRequest, imgIContainer *aImage); - NS_IMETHOD OnDataAvailable(imgIRequest *aRequest, bool aCurrentFrame, - const nsIntRect *aRect); - NS_IMETHOD OnStopDecode(imgIRequest *aRequest, nsresult status, - const PRUnichar *statusArg); - // imgIContainerObserver (override nsStubImageDecoderObserver) - NS_IMETHOD FrameChanged(imgIRequest *aRequest, - imgIContainer *aContainer, - const nsIntRect *dirtyRect); + NS_DECL_IMGINOTIFICATIONOBSERVER void SetFrame(nsImageFrame *frame) { mFrame = frame; } @@ -137,6 +127,8 @@ public: NS_IF_RELEASE(sIOService); } + nsresult Notify(imgIRequest *aRequest, int32_t aType, const nsIntRect* aData); + /** * Function to test whether aContent, which has aStyleContext as its style, * should get an image frame. Note that this method is only used by the @@ -221,14 +213,11 @@ protected: friend class nsImageListener; friend class nsImageLoadingContent; nsresult OnStartContainer(imgIRequest *aRequest, imgIContainer *aImage); - nsresult OnDataAvailable(imgIRequest *aRequest, bool aCurrentFrame, - const nsIntRect *rect); - nsresult OnStopDecode(imgIRequest *aRequest, - nsresult aStatus, - const PRUnichar *aStatusArg); + nsresult OnDataAvailable(imgIRequest *aRequest, const nsIntRect *rect); + nsresult OnStopRequest(imgIRequest *aRequest, + nsresult aStatus); nsresult FrameChanged(imgIRequest *aRequest, - imgIContainer *aContainer, - const nsIntRect *aDirtyRect); + imgIContainer *aContainer); /** * Notification that aRequest will now be the current request. */ @@ -288,13 +277,14 @@ private: nsImageMap* mImageMap; - nsCOMPtr mListener; + nsCOMPtr mListener; nsSize mComputedSize; nsIFrame::IntrinsicSize mIntrinsicSize; nsSize mIntrinsicRatio; bool mDisplayingIcon; + bool mFirstFrameComplete; static nsIIOService* sIOService; @@ -311,7 +301,7 @@ private: imgIRequest **aRequest); class IconLoad MOZ_FINAL : public nsIObserver, - public imgIDecoderObserver { + public imgINotificationObserver { // private class that wraps the data and logic needed for // broken image and loading image icons public: @@ -321,8 +311,7 @@ private: NS_DECL_ISUPPORTS NS_DECL_NSIOBSERVER - NS_DECL_IMGICONTAINEROBSERVER - NS_DECL_IMGIDECODEROBSERVER + NS_DECL_IMGINOTIFICATIONOBSERVER void AddIconObserver(nsImageFrame *frame) { NS_ABORT_IF_FALSE(!mIconObservers.Contains(frame), diff --git a/layout/style/ImageLoader.cpp b/layout/style/ImageLoader.cpp index 2adf0a0a0169..9cd885a9a077 100644 --- a/layout/style/ImageLoader.cpp +++ b/layout/style/ImageLoader.cpp @@ -56,8 +56,8 @@ ImageLoader::AssociateRequestToFrame(imgIRequest* aRequest, mFrameToRequestMap.IsInitialized() && mImages.IsInitialized()); - nsCOMPtr observer; - aRequest->GetDecoderObserver(getter_AddRefs(observer)); + nsCOMPtr observer; + aRequest->GetNotificationObserver(getter_AddRefs(observer)); if (!observer) { // The request has already been canceled, so ignore it. This is ok because // we're not going to get any more notifications from a canceled request. @@ -157,8 +157,8 @@ ImageLoader::DisassociateRequestFromFrame(imgIRequest* aRequest, #ifdef DEBUG { - nsCOMPtr observer; - aRequest->GetDecoderObserver(getter_AddRefs(observer)); + nsCOMPtr observer; + aRequest->GetNotificationObserver(getter_AddRefs(observer)); MOZ_ASSERT(!observer || observer == this); } #endif @@ -334,12 +334,35 @@ NS_IMPL_ADDREF(ImageLoader) NS_IMPL_RELEASE(ImageLoader) NS_INTERFACE_MAP_BEGIN(ImageLoader) - NS_INTERFACE_MAP_ENTRY(imgIDecoderObserver) - NS_INTERFACE_MAP_ENTRY(imgIContainerObserver) + NS_INTERFACE_MAP_ENTRY(imgINotificationObserver) NS_INTERFACE_MAP_ENTRY(imgIOnloadBlocker) NS_INTERFACE_MAP_END NS_IMETHODIMP +ImageLoader::Notify(imgIRequest *aRequest, int32_t aType, const nsIntRect* aData) +{ + if (aType == imgINotificationObserver::SIZE_AVAILABLE) { + nsCOMPtr image; + aRequest->GetImage(getter_AddRefs(image)); + return OnStartContainer(aRequest, image); + } + + if (aType == imgINotificationObserver::IS_ANIMATED) { + return OnImageIsAnimated(aRequest); + } + + if (aType == imgINotificationObserver::LOAD_COMPLETE) { + return OnStopFrame(aRequest); + } + + if (aType == imgINotificationObserver::FRAME_UPDATE) { + return FrameChanged(aRequest); + } + + return NS_OK; +} + +nsresult ImageLoader::OnStartContainer(imgIRequest* aRequest, imgIContainer* aImage) { nsPresContext* presContext = GetPresContext(); @@ -352,7 +375,7 @@ ImageLoader::OnStartContainer(imgIRequest* aRequest, imgIContainer* aImage) return NS_OK; } -NS_IMETHODIMP +nsresult ImageLoader::OnImageIsAnimated(imgIRequest* aRequest) { if (!mDocument) { @@ -376,8 +399,8 @@ ImageLoader::OnImageIsAnimated(imgIRequest* aRequest) return NS_OK; } -NS_IMETHODIMP -ImageLoader::OnStopFrame(imgIRequest *aRequest, uint32_t aFrame) +nsresult +ImageLoader::OnStopFrame(imgIRequest *aRequest) { if (!mDocument || mInClone) { return NS_OK; @@ -395,10 +418,8 @@ ImageLoader::OnStopFrame(imgIRequest *aRequest, uint32_t aFrame) return NS_OK; } -NS_IMETHODIMP -ImageLoader::FrameChanged(imgIRequest *aRequest, - imgIContainer *aContainer, - const nsIntRect *aDirtyRect) +nsresult +ImageLoader::FrameChanged(imgIRequest *aRequest) { if (!mDocument || mInClone) { return NS_OK; diff --git a/layout/style/ImageLoader.h b/layout/style/ImageLoader.h index 86d770be798d..73d630cf5f1a 100644 --- a/layout/style/ImageLoader.h +++ b/layout/style/ImageLoader.h @@ -12,7 +12,7 @@ #include "nsCSSValue.h" #include "imgIRequest.h" #include "imgIOnloadBlocker.h" -#include "nsStubImageDecoderObserver.h" +#include "imgINotificationObserver.h" #include "mozilla/Attributes.h" class nsIFrame; @@ -24,7 +24,7 @@ class nsIPrincipal; namespace mozilla { namespace css { -class ImageLoader MOZ_FINAL : public nsStubImageDecoderObserver, +class ImageLoader MOZ_FINAL : public imgINotificationObserver, public imgIOnloadBlocker { public: typedef mozilla::css::ImageValue Image; @@ -42,19 +42,7 @@ public: NS_DECL_ISUPPORTS NS_DECL_IMGIONLOADBLOCKER - - // imgIDecoderObserver (override nsStubImageDecoderObserver) - NS_IMETHOD OnStartContainer(imgIRequest *aRequest, imgIContainer *aImage); - NS_IMETHOD OnStopFrame(imgIRequest *aRequest, uint32_t aFrame); - NS_IMETHOD OnImageIsAnimated(imgIRequest *aRequest); - // Do not override OnDataAvailable since background images are not - // displayed incrementally; they are displayed after the entire image - // has been loaded. - - // imgIContainerObserver (override nsStubImageDecoderObserver) - NS_IMETHOD FrameChanged(imgIRequest* aRequest, - imgIContainer *aContainer, - const nsIntRect *aDirtyRect); + NS_DECL_IMGINOTIFICATIONOBSERVER void DropDocumentReference(); @@ -103,6 +91,14 @@ private: SetAnimationModeEnumerator(nsISupports* aKey, FrameSet* aValue, void* aClosure); + nsresult OnStartContainer(imgIRequest *aRequest, imgIContainer* aImage); + nsresult OnStopFrame(imgIRequest *aRequest); + nsresult OnImageIsAnimated(imgIRequest *aRequest); + nsresult FrameChanged(imgIRequest* aRequest); + // Do not override OnDataAvailable since background images are not + // displayed incrementally; they are displayed after the entire image + // has been loaded. + // A map of imgIRequests to the nsIFrames that are using them. RequestToFrameMap mRequestToFrameMap; diff --git a/layout/svg/nsSVGImageFrame.cpp b/layout/svg/nsSVGImageFrame.cpp index 7615802bc35b..9dd8ae38ac8a 100644 --- a/layout/svg/nsSVGImageFrame.cpp +++ b/layout/svg/nsSVGImageFrame.cpp @@ -11,7 +11,7 @@ #include "nsIDOMSVGImageElement.h" #include "nsLayoutUtils.h" #include "nsRenderingContext.h" -#include "nsStubImageDecoderObserver.h" +#include "imgINotificationObserver.h" #include "nsSVGEffects.h" #include "nsSVGImageElement.h" #include "nsSVGPathGeometryFrame.h" @@ -23,22 +23,13 @@ using namespace mozilla; class nsSVGImageFrame; -class nsSVGImageListener MOZ_FINAL : public nsStubImageDecoderObserver +class nsSVGImageListener MOZ_FINAL : public imgINotificationObserver { public: nsSVGImageListener(nsSVGImageFrame *aFrame); NS_DECL_ISUPPORTS - // imgIDecoderObserver (override nsStubImageDecoderObserver) - NS_IMETHOD OnStopDecode(imgIRequest *aRequest, nsresult status, - const PRUnichar *statusArg); - // imgIContainerObserver (override nsStubImageDecoderObserver) - NS_IMETHOD FrameChanged(imgIRequest *aRequest, - imgIContainer *aContainer, - const nsIntRect *aDirtyRect); - // imgIContainerObserver (override nsStubImageDecoderObserver) - NS_IMETHOD OnStartContainer(imgIRequest *aRequest, - imgIContainer *aContainer); + NS_DECL_IMGINOTIFICATIONOBSERVER void SetFrame(nsSVGImageFrame *frame) { mFrame = frame; } @@ -98,7 +89,7 @@ private: gfxMatrix GetVectorImageTransform(uint32_t aFor); bool TransformContextForPainting(gfxContext* aGfxContext); - nsCOMPtr mListener; + nsCOMPtr mListener; nsCOMPtr mImageContainer; @@ -560,49 +551,34 @@ nsSVGImageFrame::GetHitTestFlags() //---------------------------------------------------------------------- // nsSVGImageListener implementation -NS_IMPL_ISUPPORTS2(nsSVGImageListener, - imgIDecoderObserver, - imgIContainerObserver) +NS_IMPL_ISUPPORTS1(nsSVGImageListener, imgINotificationObserver) nsSVGImageListener::nsSVGImageListener(nsSVGImageFrame *aFrame) : mFrame(aFrame) { } -NS_IMETHODIMP nsSVGImageListener::OnStopDecode(imgIRequest *aRequest, - nsresult status, - const PRUnichar *statusArg) +NS_IMETHODIMP +nsSVGImageListener::Notify(imgIRequest *aRequest, int32_t aType, const nsIntRect* aData) { if (!mFrame) return NS_ERROR_FAILURE; - nsSVGUtils::InvalidateAndScheduleReflowSVG(mFrame); - return NS_OK; -} + if (aType == imgINotificationObserver::LOAD_COMPLETE) { + nsSVGUtils::InvalidateAndScheduleReflowSVG(mFrame); + } -NS_IMETHODIMP nsSVGImageListener::FrameChanged(imgIRequest *aRequest, - imgIContainer *aContainer, - const nsIntRect *aDirtyRect) -{ - if (!mFrame) - return NS_ERROR_FAILURE; + if (aType == imgINotificationObserver::FRAME_UPDATE) { + // No new dimensions, so we don't need to call + // nsSVGUtils::InvalidateAndScheduleBoundsUpdate. + nsSVGEffects::InvalidateRenderingObservers(mFrame); + nsSVGUtils::InvalidateBounds(mFrame); + } - // No new dimensions, so we don't need to call - // nsSVGUtils::InvalidateAndScheduleBoundsUpdate. - nsSVGEffects::InvalidateRenderingObservers(mFrame); - nsSVGUtils::InvalidateBounds(mFrame); - return NS_OK; -} - -NS_IMETHODIMP nsSVGImageListener::OnStartContainer(imgIRequest *aRequest, - imgIContainer *aContainer) -{ - // Called once the resource's dimensions have been obtained. - - if (!mFrame) - return NS_ERROR_FAILURE; - - mFrame->mImageContainer = aContainer; - nsSVGUtils::InvalidateAndScheduleReflowSVG(mFrame); + if (aType == imgINotificationObserver::SIZE_AVAILABLE) { + // Called once the resource's dimensions have been obtained. + aRequest->GetImage(getter_AddRefs(mFrame->mImageContainer)); + nsSVGUtils::InvalidateAndScheduleReflowSVG(mFrame); + } return NS_OK; } diff --git a/layout/tools/reftest/Makefile.in b/layout/tools/reftest/Makefile.in index 638a9ed29845..8b6bf2824ad8 100644 --- a/layout/tools/reftest/Makefile.in +++ b/layout/tools/reftest/Makefile.in @@ -63,6 +63,7 @@ _HARNESS_FILES = \ $(topsrcdir)/testing/mozbase/mozdevice/mozdevice/devicemanager.py \ $(topsrcdir)/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py \ $(topsrcdir)/testing/mozbase/mozdevice/mozdevice/devicemanagerSUT.py \ + $(topsrcdir)/testing/mozbase/mozdevice/mozdevice/Zeroconf.py \ $(topsrcdir)/build/mobile/b2gautomation.py \ $(topsrcdir)/build/automationutils.py \ $(topsrcdir)/build/mobile/remoteautomation.py \ diff --git a/layout/xul/base/src/nsImageBoxFrame.cpp b/layout/xul/base/src/nsImageBoxFrame.cpp index a5033ea40074..8d0563e12e87 100644 --- a/layout/xul/base/src/nsImageBoxFrame.cpp +++ b/layout/xul/base/src/nsImageBoxFrame.cpp @@ -188,7 +188,7 @@ nsImageBoxFrame::Init(nsIContent* aContent, nsImageBoxListener *listener = new nsImageBoxListener(); NS_ADDREF(listener); listener->SetFrame(this); - listener->QueryInterface(NS_GET_IID(imgIDecoderObserver), getter_AddRefs(mListener)); + listener->QueryInterface(NS_GET_IID(imgINotificationObserver), getter_AddRefs(mListener)); NS_RELEASE(listener); } @@ -577,9 +577,40 @@ nsImageBoxFrame::GetFrameName(nsAString& aResult) const } #endif +nsresult +nsImageBoxFrame::Notify(imgIRequest *aRequest, int32_t aType, const nsIntRect* aData) +{ + if (aType == imgINotificationObserver::SIZE_AVAILABLE) { + nsCOMPtr image; + aRequest->GetImage(getter_AddRefs(image)); + return OnStartContainer(aRequest, image); + } -NS_IMETHODIMP nsImageBoxFrame::OnStartContainer(imgIRequest *request, - imgIContainer *image) + if (aType == imgINotificationObserver::DECODE_COMPLETE) { + return OnStopDecode(aRequest); + } + + if (aType == imgINotificationObserver::LOAD_COMPLETE) { + uint32_t imgStatus; + aRequest->GetImageStatus(&imgStatus); + nsresult status = + imgStatus & imgIRequest::STATUS_ERROR ? NS_ERROR_FAILURE : NS_OK; + return OnStopRequest(aRequest, status); + } + + if (aType == imgINotificationObserver::IS_ANIMATED) { + return OnImageIsAnimated(aRequest); + } + + if (aType == imgINotificationObserver::FRAME_UPDATE) { + return FrameChanged(aRequest); + } + + return NS_OK; +} + +nsresult nsImageBoxFrame::OnStartContainer(imgIRequest *request, + imgIContainer *image) { NS_ENSURE_ARG_POINTER(image); @@ -603,8 +634,7 @@ NS_IMETHODIMP nsImageBoxFrame::OnStartContainer(imgIRequest *request, return NS_OK; } -NS_IMETHODIMP nsImageBoxFrame::OnStopContainer(imgIRequest *request, - imgIContainer *image) +nsresult nsImageBoxFrame::OnStopDecode(imgIRequest *request) { nsBoxLayoutState state(PresContext()); this->Redraw(state); @@ -612,9 +642,8 @@ NS_IMETHODIMP nsImageBoxFrame::OnStopContainer(imgIRequest *request, return NS_OK; } -NS_IMETHODIMP nsImageBoxFrame::OnStopDecode(imgIRequest *request, - nsresult aStatus, - const PRUnichar *statusArg) +nsresult nsImageBoxFrame::OnStopRequest(imgIRequest *request, + nsresult aStatus) { if (NS_SUCCEEDED(aStatus)) // Fire an onload DOM event. @@ -630,7 +659,7 @@ NS_IMETHODIMP nsImageBoxFrame::OnStopDecode(imgIRequest *request, return NS_OK; } -NS_IMETHODIMP nsImageBoxFrame::OnImageIsAnimated(imgIRequest *aRequest) +nsresult nsImageBoxFrame::OnImageIsAnimated(imgIRequest *aRequest) { // Register with our refresh driver, if we're animated. nsLayoutUtils::RegisterImageRequest(PresContext(), aRequest, @@ -639,9 +668,7 @@ NS_IMETHODIMP nsImageBoxFrame::OnImageIsAnimated(imgIRequest *aRequest) return NS_OK; } -NS_IMETHODIMP nsImageBoxFrame::FrameChanged(imgIRequest *aRequest, - imgIContainer *aContainer, - const nsIntRect *aDirtyRect) +nsresult nsImageBoxFrame::FrameChanged(imgIRequest *aRequest) { if ((0 == mRect.width) || (0 == mRect.height)) { return NS_OK; @@ -652,7 +679,7 @@ NS_IMETHODIMP nsImageBoxFrame::FrameChanged(imgIRequest *aRequest, return NS_OK; } -NS_IMPL_ISUPPORTS2(nsImageBoxListener, imgIDecoderObserver, imgIContainerObserver) +NS_IMPL_ISUPPORTS1(nsImageBoxListener, imgINotificationObserver) nsImageBoxListener::nsImageBoxListener() { @@ -662,49 +689,11 @@ nsImageBoxListener::~nsImageBoxListener() { } -NS_IMETHODIMP nsImageBoxListener::OnStartContainer(imgIRequest *request, - imgIContainer *image) +NS_IMETHODIMP +nsImageBoxListener::Notify(imgIRequest *request, int32_t aType, const nsIntRect* aData) { if (!mFrame) return NS_OK; - return mFrame->OnStartContainer(request, image); + return mFrame->Notify(request, aType, aData); } - -NS_IMETHODIMP nsImageBoxListener::OnStopContainer(imgIRequest *request, - imgIContainer *image) -{ - if (!mFrame) - return NS_OK; - - return mFrame->OnStopContainer(request, image); -} - -NS_IMETHODIMP nsImageBoxListener::OnStopDecode(imgIRequest *request, - nsresult status, - const PRUnichar *statusArg) -{ - if (!mFrame) - return NS_OK; - - return mFrame->OnStopDecode(request, status, statusArg); -} - -NS_IMETHODIMP nsImageBoxListener::OnImageIsAnimated(imgIRequest* aRequest) -{ - if (!mFrame) - return NS_OK; - - return mFrame->OnImageIsAnimated(aRequest); -} - -NS_IMETHODIMP nsImageBoxListener::FrameChanged(imgIRequest *aRequest, - imgIContainer *aContainer, - const nsIntRect *aDirtyRect) -{ - if (!mFrame) - return NS_ERROR_FAILURE; - - return mFrame->FrameChanged(aRequest, aContainer, aDirtyRect); -} - diff --git a/layout/xul/base/src/nsImageBoxFrame.h b/layout/xul/base/src/nsImageBoxFrame.h index a06f41fbb619..1dc86efeebc2 100644 --- a/layout/xul/base/src/nsImageBoxFrame.h +++ b/layout/xul/base/src/nsImageBoxFrame.h @@ -11,30 +11,20 @@ #include "imgILoader.h" #include "imgIRequest.h" #include "imgIContainer.h" -#include "nsStubImageDecoderObserver.h" +#include "imgINotificationObserver.h" class nsImageBoxFrame; class nsDisplayXULImage; -class nsImageBoxListener : public nsStubImageDecoderObserver +class nsImageBoxListener : public imgINotificationObserver { public: nsImageBoxListener(); virtual ~nsImageBoxListener(); NS_DECL_ISUPPORTS - // imgIDecoderObserver (override nsStubImageDecoderObserver) - NS_IMETHOD OnStartContainer(imgIRequest *request, imgIContainer *image); - NS_IMETHOD OnStopContainer(imgIRequest *request, imgIContainer *image); - NS_IMETHOD OnStopDecode(imgIRequest *request, nsresult status, - const PRUnichar *statusArg); - NS_IMETHOD OnImageIsAnimated(imgIRequest* aRequest); - - // imgIContainerObserver (override nsStubImageDecoderObserver) - NS_IMETHOD FrameChanged(imgIRequest *aRequest, - imgIContainer *aContainer, - const nsIntRect *aDirtyRect); + NS_DECL_IMGINOTIFICATIONOBSERVER void SetFrame(nsImageBoxFrame *frame) { mFrame = frame; } @@ -53,6 +43,8 @@ public: virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE; virtual void MarkIntrinsicWidthsDirty() MOZ_OVERRIDE; + nsresult Notify(imgIRequest *aRequest, int32_t aType, const nsIntRect* aData); + friend nsIFrame* NS_NewImageBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); NS_IMETHOD Init(nsIContent* aContent, @@ -89,17 +81,6 @@ public: const nsRect& aDirtyRect, const nsDisplayListSet& aLists) MOZ_OVERRIDE; - NS_IMETHOD OnStartContainer(imgIRequest *request, imgIContainer *image); - NS_IMETHOD OnStopContainer(imgIRequest *request, imgIContainer *image); - NS_IMETHOD OnStopDecode(imgIRequest *request, - nsresult status, - const PRUnichar *statusArg); - NS_IMETHOD OnImageIsAnimated(imgIRequest* aRequest); - - NS_IMETHOD FrameChanged(imgIRequest *aRequest, - imgIContainer *aContainer, - const nsIntRect *aDirtyRect); - virtual ~nsImageBoxFrame(); void PaintImage(nsRenderingContext& aRenderingContext, @@ -113,6 +94,11 @@ protected: virtual void GetImageSize(); private: + nsresult OnStartContainer(imgIRequest *request, imgIContainer *image); + nsresult OnStopDecode(imgIRequest *request); + nsresult OnStopRequest(imgIRequest *request, nsresult status); + nsresult OnImageIsAnimated(imgIRequest* aRequest); + nsresult FrameChanged(imgIRequest *aRequest); nsRect mSubRect; ///< If set, indicates that only the portion of the image specified by the rect should be used. nsSize mIntrinsicSize; @@ -123,7 +109,7 @@ private: bool mRequestRegistered; nsCOMPtr mImageRequest; - nsCOMPtr mListener; + nsCOMPtr mListener; int32_t mLoadFlags; diff --git a/layout/xul/base/src/nsListBoxBodyFrame.cpp b/layout/xul/base/src/nsListBoxBodyFrame.cpp index 67b0d6ea6eac..f22fe38363c9 100644 --- a/layout/xul/base/src/nsListBoxBodyFrame.cpp +++ b/layout/xul/base/src/nsListBoxBodyFrame.cpp @@ -907,11 +907,7 @@ nsListBoxBodyFrame::DoInternalPositionChanged(bool aUp, int32_t aDelta) PRTime end = PR_Now(); - PRTime difTime = end - start; - - int32_t newTime; - LL_L2I(newTime, difTime); - newTime /= aDelta; + int32_t newTime = int32_t(end - start) / aDelta; // average old and new mTimePerRow = (newTime + mTimePerRow)/2; diff --git a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp index 5033c1f71058..bb9ec8be464e 100644 --- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp +++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp @@ -2117,8 +2117,8 @@ nsTreeBodyFrame::GetImage(int32_t aRowIndex, nsTreeColumn* aCol, bool aUseContex if ((!(status & imgIRequest::STATUS_LOAD_COMPLETE)) || animated) { // We either aren't done loading, or we're animating. Add our row as a listener for invalidations. - nsCOMPtr obs; - imgReq->GetDecoderObserver(getter_AddRefs(obs)); + nsCOMPtr obs; + imgReq->GetNotificationObserver(getter_AddRefs(obs)); if (obs) { static_cast (obs.get())->AddCell(aRowIndex, aCol); @@ -2140,11 +2140,11 @@ nsTreeBodyFrame::GetImage(int32_t aRowIndex, nsTreeColumn* aCol, bool aUseContex } listener->AddCell(aRowIndex, aCol); - nsCOMPtr imgDecoderObserver = listener; + nsCOMPtr imgNotificationObserver = listener; nsCOMPtr imageRequest; if (styleRequest) { - styleRequest->Clone(imgDecoderObserver, getter_AddRefs(imageRequest)); + styleRequest->Clone(imgNotificationObserver, getter_AddRefs(imageRequest)); } else { nsIDocument* doc = mContent->GetDocument(); if (!doc) @@ -2169,7 +2169,7 @@ nsTreeBodyFrame::GetImage(int32_t aRowIndex, nsTreeColumn* aCol, bool aUseContex doc, mContent->NodePrincipal(), doc->GetDocumentURI(), - imgDecoderObserver, + imgNotificationObserver, nsIRequest::LOAD_NORMAL, getter_AddRefs(imageRequest)); NS_ENSURE_SUCCESS(rv, rv); @@ -2187,7 +2187,7 @@ nsTreeBodyFrame::GetImage(int32_t aRowIndex, nsTreeColumn* aCol, bool aUseContex // In a case it was already cached. imageRequest->GetImage(aResult); - nsTreeImageCacheEntry cacheEntry(imageRequest, imgDecoderObserver); + nsTreeImageCacheEntry cacheEntry(imageRequest, imgNotificationObserver); mImageCache.Put(imageSrc, cacheEntry); } return NS_OK; diff --git a/layout/xul/base/src/tree/src/nsTreeBodyFrame.h b/layout/xul/base/src/tree/src/nsTreeBodyFrame.h index 2446394fa630..41bc2644f1d0 100644 --- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.h +++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.h @@ -20,7 +20,7 @@ #include "nsAutoPtr.h" #include "nsDataHashtable.h" #include "imgIRequest.h" -#include "imgIDecoderObserver.h" +#include "imgINotificationObserver.h" #include "nsScrollbarFrame.h" #include "nsThreadUtils.h" #include "mozilla/LookAndFeel.h" @@ -32,11 +32,11 @@ class nsTreeImageListener; struct nsTreeImageCacheEntry { nsTreeImageCacheEntry() {} - nsTreeImageCacheEntry(imgIRequest *aRequest, imgIDecoderObserver *aListener) + nsTreeImageCacheEntry(imgIRequest *aRequest, imgINotificationObserver *aListener) : request(aRequest), listener(aListener) {} nsCOMPtr request; - nsCOMPtr listener; + nsCOMPtr listener; }; // The actual frame that paints the cells and rows. diff --git a/layout/xul/base/src/tree/src/nsTreeImageListener.cpp b/layout/xul/base/src/tree/src/nsTreeImageListener.cpp index f025be9fd47b..1680a4b5bc59 100644 --- a/layout/xul/base/src/tree/src/nsTreeImageListener.cpp +++ b/layout/xul/base/src/tree/src/nsTreeImageListener.cpp @@ -8,7 +8,7 @@ #include "imgIRequest.h" #include "imgIContainer.h" -NS_IMPL_ISUPPORTS2(nsTreeImageListener, imgIDecoderObserver, imgIContainerObserver) +NS_IMPL_ISUPPORTS1(nsTreeImageListener, imgINotificationObserver) nsTreeImageListener::nsTreeImageListener(nsTreeBodyFrame* aTreeFrame) : mTreeFrame(aTreeFrame), @@ -23,42 +23,26 @@ nsTreeImageListener::~nsTreeImageListener() } NS_IMETHODIMP -nsTreeImageListener::OnImageIsAnimated(imgIRequest *aRequest) +nsTreeImageListener::Notify(imgIRequest *aRequest, int32_t aType, const nsIntRect* aData) { - if (!mTreeFrame) { - return NS_OK; + if (aType == imgINotificationObserver::IS_ANIMATED) { + return mTreeFrame ? mTreeFrame->OnImageIsAnimated(aRequest) : NS_OK; } - return mTreeFrame->OnImageIsAnimated(aRequest); -} + if (aType == imgINotificationObserver::SIZE_AVAILABLE) { + // Ensure the animation (if any) is started. Note: There is no + // corresponding call to Decrement for this. This Increment will be + // 'cleaned up' by the Request when it is destroyed, but only then. + aRequest->IncrementAnimationConsumers(); + } + + if (aType == imgINotificationObserver::FRAME_UPDATE) { + Invalidate(); + } -NS_IMETHODIMP nsTreeImageListener::OnStartContainer(imgIRequest *aRequest, - imgIContainer *aImage) -{ - // Ensure the animation (if any) is started. Note: There is no - // corresponding call to Decrement for this. This Increment will be - // 'cleaned up' by the Request when it is destroyed, but only then. - aRequest->IncrementAnimationConsumers(); return NS_OK; } -NS_IMETHODIMP nsTreeImageListener::OnDataAvailable(imgIRequest *aRequest, - bool aCurrentFrame, - const nsIntRect *aRect) -{ - Invalidate(); - return NS_OK; -} - -NS_IMETHODIMP nsTreeImageListener::FrameChanged(imgIRequest *aRequest, - imgIContainer *aContainer, - const nsIntRect *aDirtyRect) -{ - Invalidate(); - return NS_OK; -} - - void nsTreeImageListener::AddCell(int32_t aIndex, nsITreeColumn* aCol) { diff --git a/layout/xul/base/src/tree/src/nsTreeImageListener.h b/layout/xul/base/src/tree/src/nsTreeImageListener.h index f880e4c15bec..940083869e3f 100644 --- a/layout/xul/base/src/tree/src/nsTreeImageListener.h +++ b/layout/xul/base/src/tree/src/nsTreeImageListener.h @@ -9,27 +9,18 @@ #include "nsString.h" #include "nsCOMPtr.h" #include "nsITreeColumns.h" -#include "nsStubImageDecoderObserver.h" #include "nsTreeBodyFrame.h" #include "mozilla/Attributes.h" // This class handles image load observation. -class nsTreeImageListener MOZ_FINAL : public nsStubImageDecoderObserver +class nsTreeImageListener MOZ_FINAL : public imgINotificationObserver { public: nsTreeImageListener(nsTreeBodyFrame *aTreeFrame); ~nsTreeImageListener(); NS_DECL_ISUPPORTS - // imgIDecoderObserver (override nsStubImageDecoderObserver) - NS_IMETHOD OnStartContainer(imgIRequest *aRequest, imgIContainer *aImage); - NS_IMETHOD OnImageIsAnimated(imgIRequest* aRequest); - NS_IMETHOD OnDataAvailable(imgIRequest *aRequest, bool aCurrentFrame, - const nsIntRect *aRect); - // imgIContainerObserver (override nsStubImageDecoderObserver) - NS_IMETHOD FrameChanged(imgIRequest *aRequest, - imgIContainer *aContainer, - const nsIntRect *aDirtyRect); + NS_DECL_IMGINOTIFICATIONOBSERVER NS_IMETHOD ClearFrame(); diff --git a/media/webrtc/signaling/include/CC_Call.h b/media/webrtc/signaling/include/CC_Call.h index d5540d4ab759..897ca7f8bc27 100644 --- a/media/webrtc/signaling/include/CC_Call.h +++ b/media/webrtc/signaling/include/CC_Call.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once @@ -112,7 +77,7 @@ namespace CSF @return true or false */ virtual bool endCall() = 0; - + /** Send digits on the call - can be invoked either to dial additional digits or send DTMF @@ -138,7 +103,7 @@ namespace CSF virtual bool redial (cc_sdp_direction_t video_pref) = 0; /** - Initiate Call Forward All + Initiate Call Forward All @return true or false */ @@ -187,7 +152,7 @@ namespace CSF @return true or false */ - virtual bool transferComplete (CC_CallPtr otherLeg, + virtual bool transferComplete (CC_CallPtr otherLeg, cc_sdp_direction_t video_pref) = 0; /** @@ -255,8 +220,8 @@ namespace CSF NOTE: The mute state is persisted within the stack and shall be remembered across hold/resume. */ virtual bool muteAudio(void) = 0; - - + + /** API to unmute audio @@ -273,8 +238,8 @@ namespace CSF NOTE: The mute state is persisted within the stack and shall be remembered across hold/resume. */ virtual bool muteVideo(void) = 0; - - + + /** API to unmute video diff --git a/media/webrtc/signaling/include/CC_CallInfo.h b/media/webrtc/signaling/include/CC_CallInfo.h index d8ac5965a1cc..9bc2f8955c98 100644 --- a/media/webrtc/signaling/include/CC_CallInfo.h +++ b/media/webrtc/signaling/include/CC_CallInfo.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once @@ -136,7 +101,7 @@ namespace CSF /** Get calling party number @return calling party number as a string - Note: this is a const reference to a string that's owned by the + Note: this is a const reference to a string that's owned by the */ virtual std::string getCallingPartyNumber() = 0; @@ -157,7 +122,7 @@ namespace CSF virtual bool hasCapability (CC_CallCapabilityEnum::CC_CallCapability capability) = 0; /** - If you need the complete set of capabilities + If you need the complete set of capabilities @return cc_return_t - set of Call Capabilities. */ @@ -208,7 +173,7 @@ namespace CSF /** get call instance number @param [in] handle - call info handle - @return + @return */ virtual cc_int32_t getCallInstance() = 0; @@ -310,7 +275,7 @@ namespace CSF //TODO NEED TO DO SOMETHING WRAP CALL LOG REF. @return string - INFO body - NOTE: Memory associated with the call log is tied to the + NOTE: Memory associated with the call log is tied to the this would be freed when the callinfo ref is freed. */ virtual cc_calllog_ref_t getCallLogRef() = 0; @@ -324,16 +289,16 @@ namespace CSF /** Find out if this call is capable of querying the media state, which includes mute state and video direction - @return bool - */ + @return bool + */ virtual bool isMediaStateAvailable() = 0; - + /** Get the audio mute state if available (check availability with isMediaStateAvailable()) @return bool - the current audio state of the call */ virtual bool isAudioMuted(void) = 0; - + /** Get the video mute state if available (check availability with isMediaStateAvailable()) @return bool - the current video state of the call @@ -347,7 +312,7 @@ namespace CSF virtual int getVolume() = 0; /** - get SDP from info object returned from JSEP functions + get SDP from info object returned from JSEP functions @param [in] handle - call info handle @return SDP string */ @@ -363,7 +328,7 @@ namespace CSF /** get media streams @return media stream table - Note:Ownership of the MediaStreamTable is responsibiliy of + Note:Ownership of the MediaStreamTable is responsibiliy of the caller. */ virtual MediaStreamTable* getMediaStreams() const = 0; diff --git a/media/webrtc/signaling/include/CC_CallServerInfo.h b/media/webrtc/signaling/include/CC_CallServerInfo.h index b24e64942ab4..4eb9d3c9675b 100644 --- a/media/webrtc/signaling/include/CC_CallServerInfo.h +++ b/media/webrtc/signaling/include/CC_CallServerInfo.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once diff --git a/media/webrtc/signaling/include/CC_CallTypes.h b/media/webrtc/signaling/include/CC_CallTypes.h index d8ca28f86357..aadc60189d44 100644 --- a/media/webrtc/signaling/include/CC_CallTypes.h +++ b/media/webrtc/signaling/include/CC_CallTypes.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once diff --git a/media/webrtc/signaling/include/CC_Common.h b/media/webrtc/signaling/include/CC_Common.h index 3e7544490384..fe629a8f452b 100644 --- a/media/webrtc/signaling/include/CC_Common.h +++ b/media/webrtc/signaling/include/CC_Common.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once diff --git a/media/webrtc/signaling/include/CC_Device.h b/media/webrtc/signaling/include/CC_Device.h index a1e05fdb33b1..4159152d06fa 100644 --- a/media/webrtc/signaling/include/CC_Device.h +++ b/media/webrtc/signaling/include/CC_Device.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once @@ -72,7 +37,7 @@ namespace CSF virtual CC_CallPtr createCall() = 0; virtual void enableVideo(bool enable) = 0; - virtual void enableCamera(bool enable) = 0; + virtual void enableCamera(bool enable) = 0; virtual void setDigestNamePasswd (char *name, char *pw) = 0; private: diff --git a/media/webrtc/signaling/include/CC_DeviceInfo.h b/media/webrtc/signaling/include/CC_DeviceInfo.h index e0a0b1ab9f3e..9b77d8929da6 100644 --- a/media/webrtc/signaling/include/CC_DeviceInfo.h +++ b/media/webrtc/signaling/include/CC_DeviceInfo.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once @@ -67,14 +32,14 @@ namespace CSF /** gets the service state - @param [in] handle - reference to device info - @returns cc_service_state_t - INS/OOS + @param [in] handle - reference to device info + @returns cc_service_state_t - INS/OOS */ virtual cc_service_state_t getServiceState() = 0; /** gets the service cause - @param [in] handle - reference to device info + @param [in] handle - reference to device info @returns cc_service_cause_t - reason for service state */ virtual cc_service_cause_t getServiceCause() = 0; @@ -114,7 +79,7 @@ namespace CSF /** gets handles of call agent servers - @returns + @returns */ virtual std::vector getCallServers () = 0; diff --git a/media/webrtc/signaling/include/CC_FeatureInfo.h b/media/webrtc/signaling/include/CC_FeatureInfo.h index 055ef534a6a3..c212725ddeb5 100644 --- a/media/webrtc/signaling/include/CC_FeatureInfo.h +++ b/media/webrtc/signaling/include/CC_FeatureInfo.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once diff --git a/media/webrtc/signaling/include/CC_Line.h b/media/webrtc/signaling/include/CC_Line.h index b194c8cc5ff7..64576fb495fa 100644 --- a/media/webrtc/signaling/include/CC_Line.h +++ b/media/webrtc/signaling/include/CC_Line.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once diff --git a/media/webrtc/signaling/include/CC_LineInfo.h b/media/webrtc/signaling/include/CC_LineInfo.h index 1fdeda6ae61a..3409c1b6feb8 100644 --- a/media/webrtc/signaling/include/CC_LineInfo.h +++ b/media/webrtc/signaling/include/CC_LineInfo.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once @@ -109,7 +74,7 @@ namespace CSF /** Get calls on line - + @param [in] line - line @return vector */ @@ -120,7 +85,7 @@ namespace CSF @param [in] line - line @param [in] state - state - + @return vector */ virtual std::vector getCallsByState (CC_LinePtr linePtr, cc_call_state_t state) = 0; @@ -134,7 +99,7 @@ namespace CSF /** Get the MWI Type - + @return cc_uint32_t - MWI Type */ virtual cc_uint32_t getMWIType() = 0; @@ -148,14 +113,14 @@ namespace CSF /** Get the MWI old msg count - + @return cc_uint32_t - MWI old msg count */ virtual cc_uint32_t getMWIOldMsgCount() = 0; /** Get the MWI high priority new msg count - + @return cc_uint32_t - MWI new msg count */ virtual cc_uint32_t getMWIPrioNewMsgCount() = 0; diff --git a/media/webrtc/signaling/include/CC_Observer.h b/media/webrtc/signaling/include/CC_Observer.h index c0dbcd0f1a5b..1013e697e9f0 100644 --- a/media/webrtc/signaling/include/CC_Observer.h +++ b/media/webrtc/signaling/include/CC_Observer.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once diff --git a/media/webrtc/signaling/include/CC_Service.h b/media/webrtc/signaling/include/CC_Service.h index c212bad7da43..a4d1bf0a7cf9 100644 --- a/media/webrtc/signaling/include/CC_Service.h +++ b/media/webrtc/signaling/include/CC_Service.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once diff --git a/media/webrtc/signaling/include/CSFAudioControl.h b/media/webrtc/signaling/include/CSFAudioControl.h index d88eefcba258..9465b0e16de4 100644 --- a/media/webrtc/signaling/include/CSFAudioControl.h +++ b/media/webrtc/signaling/include/CSFAudioControl.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once diff --git a/media/webrtc/signaling/include/CSFVideoControl.h b/media/webrtc/signaling/include/CSFVideoControl.h index 5cf9a85687d6..0da95b708eff 100644 --- a/media/webrtc/signaling/include/CSFVideoControl.h +++ b/media/webrtc/signaling/include/CSFVideoControl.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once diff --git a/media/webrtc/signaling/include/CallControlManager.h b/media/webrtc/signaling/include/CallControlManager.h index 20de204b6ae1..93c81c1e472d 100755 --- a/media/webrtc/signaling/include/CallControlManager.h +++ b/media/webrtc/signaling/include/CallControlManager.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once @@ -129,9 +94,9 @@ namespace CSF /* P2P MODE */ virtual bool startP2PMode(const std::string& user) = 0; - + /* SDP MODE */ - virtual bool startSDPMode() = 0; + virtual bool startSDPMode() = 0; /** * Obtain the device object, from which call control can be done. diff --git a/media/webrtc/signaling/include/ECC_Observer.h b/media/webrtc/signaling/include/ECC_Observer.h index 2172f3a34032..d7ebd9009ccb 100644 --- a/media/webrtc/signaling/include/ECC_Observer.h +++ b/media/webrtc/signaling/include/ECC_Observer.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once diff --git a/media/webrtc/signaling/include/ECC_Types.h b/media/webrtc/signaling/include/ECC_Types.h index 7215adedb7f8..1b4e544546b5 100755 --- a/media/webrtc/signaling/include/ECC_Types.h +++ b/media/webrtc/signaling/include/ECC_Types.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once @@ -182,6 +147,6 @@ namespace CSF typedef void *VideoWindowHandle; typedef void* ExternalRendererHandle; - typedef unsigned int VideoFormat; + typedef unsigned int VideoFormat; } diff --git a/media/webrtc/signaling/include/PhoneDetails.h b/media/webrtc/signaling/include/PhoneDetails.h index 5ad17d8d7980..83bb285e03a5 100644 --- a/media/webrtc/signaling/include/PhoneDetails.h +++ b/media/webrtc/signaling/include/PhoneDetails.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once diff --git a/media/webrtc/signaling/include/SharedPtr.h b/media/webrtc/signaling/include/SharedPtr.h index 899cd5a5f620..6d841425260a 100644 --- a/media/webrtc/signaling/include/SharedPtr.h +++ b/media/webrtc/signaling/include/SharedPtr.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once diff --git a/media/webrtc/signaling/include/debug-psipcc-types.h b/media/webrtc/signaling/include/debug-psipcc-types.h index de65402a127e..d4e8424f3fc6 100644 --- a/media/webrtc/signaling/include/debug-psipcc-types.h +++ b/media/webrtc/signaling/include/debug-psipcc-types.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef T1_DEBUG_H #define T1_DEBUG_H diff --git a/media/webrtc/signaling/src/callcontrol/CC_CallTypes.cpp b/media/webrtc/signaling/src/callcontrol/CC_CallTypes.cpp index ebc950cabc91..1a6b81345b3b 100644 --- a/media/webrtc/signaling/src/callcontrol/CC_CallTypes.cpp +++ b/media/webrtc/signaling/src/callcontrol/CC_CallTypes.cpp @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "CC_CallTypes.h" diff --git a/media/webrtc/signaling/src/callcontrol/CallControlManager.cpp b/media/webrtc/signaling/src/callcontrol/CallControlManager.cpp index 967c120f289e..6ec3686ab2e5 100644 --- a/media/webrtc/signaling/src/callcontrol/CallControlManager.cpp +++ b/media/webrtc/signaling/src/callcontrol/CallControlManager.cpp @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "CallControlManager.h" #include "CallControlManagerImpl.h" diff --git a/media/webrtc/signaling/src/callcontrol/CallControlManagerImpl.cpp b/media/webrtc/signaling/src/callcontrol/CallControlManagerImpl.cpp index 55561580fc03..d976cedea9aa 100755 --- a/media/webrtc/signaling/src/callcontrol/CallControlManagerImpl.cpp +++ b/media/webrtc/signaling/src/callcontrol/CallControlManagerImpl.cpp @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include @@ -157,14 +122,14 @@ void CallControlManagerImpl::setSecureCachePath(const std::string &secureCachePa // Add local codecs void CallControlManagerImpl::setAudioCodecs(int codecMask) { - CSFLogDebug(logTag, "setAudioCodecs %X", codecMask); + CSFLogDebug(logTag, "setAudioCodecs %X", codecMask); VcmSIPCCBinding::setAudioCodecs(codecMask); } void CallControlManagerImpl::setVideoCodecs(int codecMask) { - CSFLogDebug(logTag, "setVideoCodecs %X", codecMask); + CSFLogDebug(logTag, "setVideoCodecs %X", codecMask); VcmSIPCCBinding::setVideoCodecs(codecMask); } @@ -251,7 +216,7 @@ bool CallControlManagerImpl::startSDPMode() softPhone->setLoggingMask(sipccLoggingMask); phone->addCCObserver(this); phone->setSDPMode(true); - + return phone->startService(); } diff --git a/media/webrtc/signaling/src/callcontrol/CallControlManagerImpl.h b/media/webrtc/signaling/src/callcontrol/CallControlManagerImpl.h index d7642089310e..d7a684c38e7c 100755 --- a/media/webrtc/signaling/src/callcontrol/CallControlManagerImpl.h +++ b/media/webrtc/signaling/src/callcontrol/CallControlManagerImpl.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once diff --git a/media/webrtc/signaling/src/callcontrol/ECC_Types.cpp b/media/webrtc/signaling/src/callcontrol/ECC_Types.cpp index 940069731a4a..eeedfebd4d6c 100644 --- a/media/webrtc/signaling/src/callcontrol/ECC_Types.cpp +++ b/media/webrtc/signaling/src/callcontrol/ECC_Types.cpp @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include "ECC_Types.h" diff --git a/media/webrtc/signaling/src/callcontrol/PhoneDetailsImpl.cpp b/media/webrtc/signaling/src/callcontrol/PhoneDetailsImpl.cpp index dbdf56002e09..f3edaccd2ad8 100644 --- a/media/webrtc/signaling/src/callcontrol/PhoneDetailsImpl.cpp +++ b/media/webrtc/signaling/src/callcontrol/PhoneDetailsImpl.cpp @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "PhoneDetailsImpl.h" diff --git a/media/webrtc/signaling/src/callcontrol/PhoneDetailsImpl.h b/media/webrtc/signaling/src/callcontrol/PhoneDetailsImpl.h index 691eb39ae9ae..0db842390980 100644 --- a/media/webrtc/signaling/src/callcontrol/PhoneDetailsImpl.h +++ b/media/webrtc/signaling/src/callcontrol/PhoneDetailsImpl.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once diff --git a/media/webrtc/signaling/src/callcontrol/debug-psipcc-types.cpp b/media/webrtc/signaling/src/callcontrol/debug-psipcc-types.cpp index 3586494ed344..96b720b93559 100644 --- a/media/webrtc/signaling/src/callcontrol/debug-psipcc-types.cpp +++ b/media/webrtc/signaling/src/callcontrol/debug-psipcc-types.cpp @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "CC_Common.h" #include @@ -87,7 +52,7 @@ egetname(const struct ename *index, int event) ECC_API cc_string_t typeName##_getname(tokenPrepend##typeName##eventOrType ev) \ {\ return egetname(&tokenPrepend##typeName##_names[0], (int) ev);\ - } + } //stringizing enums from ccapi_types.h diff --git a/media/webrtc/signaling/src/common/CommonTypes.h b/media/webrtc/signaling/src/common/CommonTypes.h index ddd6f51d3b92..96f1f342370b 100644 --- a/media/webrtc/signaling/src/common/CommonTypes.h +++ b/media/webrtc/signaling/src/common/CommonTypes.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once diff --git a/media/webrtc/signaling/src/common/NullDeleter.h b/media/webrtc/signaling/src/common/NullDeleter.h index cfafc7ff81c7..9b462839083b 100644 --- a/media/webrtc/signaling/src/common/NullDeleter.h +++ b/media/webrtc/signaling/src/common/NullDeleter.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once diff --git a/media/webrtc/signaling/src/common/Wrapper.h b/media/webrtc/signaling/src/common/Wrapper.h index a518954d1d97..49821cc47e7a 100644 --- a/media/webrtc/signaling/src/common/Wrapper.h +++ b/media/webrtc/signaling/src/common/Wrapper.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once @@ -116,7 +81,7 @@ public: private: LockNSPR& lock_; }; - + template class Wrapper { diff --git a/media/webrtc/signaling/src/common/browser_logging/CSFLog.cpp b/media/webrtc/signaling/src/common/browser_logging/CSFLog.cpp index 709aa828e5dc..e4d159866856 100644 --- a/media/webrtc/signaling/src/common/browser_logging/CSFLog.cpp +++ b/media/webrtc/signaling/src/common/browser_logging/CSFLog.cpp @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include @@ -54,15 +19,15 @@ void CSFLogV(CSFLogLevel priority, const char* sourceFile, int sourceLine, const printf("%s\n:",tag); vprintf(format, args); #else - + #define MAX_MESSAGE_LENGTH 1024 char message[MAX_MESSAGE_LENGTH]; - + vsnprintf(message, MAX_MESSAGE_LENGTH, format, args); - + if (gLogModuleInfo == NULL) gLogModuleInfo = PR_NewLogModule("ikran"); - + switch(priority) { case CSF_LOG_CRITICAL: @@ -80,7 +45,7 @@ void CSFLogV(CSFLogLevel priority, const char* sourceFile, int sourceLine, const default: PR_LOG(gLogModuleInfo, PR_LOG_ALWAYS, ("%s %s", tag, message)); } - + #endif } @@ -89,7 +54,7 @@ void CSFLog( CSFLogLevel priority, const char* sourceFile, int sourceLine, const { va_list ap; va_start(ap, format); - + CSFLogV(priority, sourceFile, sourceLine, tag, format, ap); va_end(ap); } diff --git a/media/webrtc/signaling/src/common/browser_logging/CSFLog.h b/media/webrtc/signaling/src/common/browser_logging/CSFLog.h index a27ecd5fcd00..2e416a8d4ca3 100644 --- a/media/webrtc/signaling/src/common/browser_logging/CSFLog.h +++ b/media/webrtc/signaling/src/common/browser_logging/CSFLog.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef CSFLOG_H #define CSFLOG_H diff --git a/media/webrtc/signaling/src/common/browser_logging/CSFLogStream.h b/media/webrtc/signaling/src/common/browser_logging/CSFLogStream.h index b764a00a3d73..bd9e60edb88b 100644 --- a/media/webrtc/signaling/src/common/browser_logging/CSFLogStream.h +++ b/media/webrtc/signaling/src/common/browser_logging/CSFLogStream.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef CSFLogStream_h #define CSFLogStream_h diff --git a/media/webrtc/signaling/src/common/csf_common.h b/media/webrtc/signaling/src/common/csf_common.h index 9af508e95485..f46abf69e78e 100644 --- a/media/webrtc/signaling/src/common/csf_common.h +++ b/media/webrtc/signaling/src/common/csf_common.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CSF_COMMON_E58E5677_950A_424c_B6C2_CA180092E6A2_H #define _CSF_COMMON_E58E5677_950A_424c_B6C2_CA180092E6A2_H diff --git a/media/webrtc/signaling/src/media-conduit/MediaEngineWrapper.h b/media/webrtc/signaling/src/media-conduit/MediaEngineWrapper.h index 2d926fb83c08..a9ccf0cf08ed 100755 --- a/media/webrtc/signaling/src/media-conduit/MediaEngineWrapper.h +++ b/media/webrtc/signaling/src/media-conduit/MediaEngineWrapper.h @@ -16,7 +16,7 @@ namespace mozilla * with a function of Type F * ScopedCustomReleasePtr ptr = * webrtc::VoENetwork->GetInterface(voiceEngine); - * + * */ template struct ScopedCustomReleaseTraits0 : public ScopedFreePtrTraits diff --git a/media/webrtc/signaling/src/media/CSFAudioControlWrapper.cpp b/media/webrtc/signaling/src/media/CSFAudioControlWrapper.cpp index 517c9b9156cf..ffe7bfe32d83 100644 --- a/media/webrtc/signaling/src/media/CSFAudioControlWrapper.cpp +++ b/media/webrtc/signaling/src/media/CSFAudioControlWrapper.cpp @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "CSFAudioControlWrapper.h" #include "CSFLogStream.h" @@ -84,7 +49,7 @@ namespace CSF { return ""; } } - + std::string AudioControlWrapper::getPlayoutDevice() { if (_realAudioControl != NULL) @@ -178,6 +143,6 @@ namespace CSF { AudioControlWrapper::~AudioControlWrapper() { - delete _realAudioControl; + delete _realAudioControl; } } diff --git a/media/webrtc/signaling/src/media/CSFAudioControlWrapper.h b/media/webrtc/signaling/src/media/CSFAudioControlWrapper.h index 64dc428b8050..3f7638762e8c 100644 --- a/media/webrtc/signaling/src/media/CSFAudioControlWrapper.h +++ b/media/webrtc/signaling/src/media/CSFAudioControlWrapper.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once diff --git a/media/webrtc/signaling/src/media/CSFAudioTermination.h b/media/webrtc/signaling/src/media/CSFAudioTermination.h index 9b741d4ad836..25bc0c09557c 100644 --- a/media/webrtc/signaling/src/media/CSFAudioTermination.h +++ b/media/webrtc/signaling/src/media/CSFAudioTermination.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef CSFAUDIOMEDIATERMINATION_H_ #define CSFAUDIOMEDIATERMINATION_H_ @@ -48,7 +13,7 @@ typedef enum AudioCodecMask_LINEAR = 2, AudioCodecMask_G722 = 4, AudioCodecMask_iLBC = 16, - AudioCodecMask_iSAC = 32 + AudioCodecMask_iSAC = 32 } AudioCodecMask; diff --git a/media/webrtc/signaling/src/media/CSFMediaProvider.h b/media/webrtc/signaling/src/media/CSFMediaProvider.h index 63188672dec7..2be41456171f 100644 --- a/media/webrtc/signaling/src/media/CSFMediaProvider.h +++ b/media/webrtc/signaling/src/media/CSFMediaProvider.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef CSFMEDIAPROVIDER_H_ #define CSFMEDIAPROVIDER_H_ diff --git a/media/webrtc/signaling/src/media/CSFMediaTermination.h b/media/webrtc/signaling/src/media/CSFMediaTermination.h index 885c6862b6ae..1636c6c5071c 100644 --- a/media/webrtc/signaling/src/media/CSFMediaTermination.h +++ b/media/webrtc/signaling/src/media/CSFMediaTermination.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef CSFMEDIATERMINATION_H_ #define CSFMEDIATERMINATION_H_ @@ -66,11 +31,11 @@ namespace CSF { public: virtual int getCodecList( CodecRequestType requestType ) = 0; - + virtual int rxAlloc ( int groupId, int streamId, int requestedPort ) = 0; virtual int rxOpen ( int groupId, int streamId, int requestedPort, int listenIp, bool isMulticast ) = 0; virtual int rxStart ( int groupId, int streamId, int payloadType, int packPeriod, int localPort, int rfc2833PayloadType, - EncryptionAlgorithm algorithm, unsigned char* key, int keyLen, unsigned char* salt, int saltLen, int mode, int party ) = 0; + EncryptionAlgorithm algorithm, unsigned char* key, int keyLen, unsigned char* salt, int saltLen, int mode, int party ) = 0; virtual void rxClose ( int groupId, int streamId ) = 0; virtual void rxRelease ( int groupId, int streamId, int port ) = 0; diff --git a/media/webrtc/signaling/src/media/CSFToneDefinitions.h b/media/webrtc/signaling/src/media/CSFToneDefinitions.h index 2c73564fa264..2fe6f879d112 100644 --- a/media/webrtc/signaling/src/media/CSFToneDefinitions.h +++ b/media/webrtc/signaling/src/media/CSFToneDefinitions.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* Tone Coefficients and YN_2 values */ /* Based on 8kHz sampling rate */ diff --git a/media/webrtc/signaling/src/media/CSFVideoCallMediaControl.h b/media/webrtc/signaling/src/media/CSFVideoCallMediaControl.h index 4f7f1a59de3b..67c35ed7bd43 100644 --- a/media/webrtc/signaling/src/media/CSFVideoCallMediaControl.h +++ b/media/webrtc/signaling/src/media/CSFVideoCallMediaControl.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef CSFVIDEOCALLMEDIACONTROL_H_ #define CSFVIDEOCALLMEDIACONTROL_H_ diff --git a/media/webrtc/signaling/src/media/CSFVideoControlWrapper.cpp b/media/webrtc/signaling/src/media/CSFVideoControlWrapper.cpp index 4dcaddba160d..bff2a79e09d6 100644 --- a/media/webrtc/signaling/src/media/CSFVideoControlWrapper.cpp +++ b/media/webrtc/signaling/src/media/CSFVideoControlWrapper.cpp @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "CSFVideoControlWrapper.h" #include "CSFLogStream.h" diff --git a/media/webrtc/signaling/src/media/CSFVideoControlWrapper.h b/media/webrtc/signaling/src/media/CSFVideoControlWrapper.h index 1f79da2f2349..1d689e00f3bf 100644 --- a/media/webrtc/signaling/src/media/CSFVideoControlWrapper.h +++ b/media/webrtc/signaling/src/media/CSFVideoControlWrapper.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef CSFVIDEOCONTROLWRAPPER_H_ #define CSFVIDEOCONTROLWRAPPER_H_ @@ -51,7 +16,7 @@ namespace CSF { typedef void *VideoWindowHandle; - + DECLARE_PTR(VideoControlWrapper); class ECC_API VideoControlWrapper : public VideoControl { diff --git a/media/webrtc/signaling/src/media/CSFVideoTermination.h b/media/webrtc/signaling/src/media/CSFVideoTermination.h index ab6a3ed787a9..62fcf856979e 100644 --- a/media/webrtc/signaling/src/media/CSFVideoTermination.h +++ b/media/webrtc/signaling/src/media/CSFVideoTermination.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef CSFVIDEOMEDIATERMINATION_H_ #define CSFVIDEOMEDIATERMINATION_H_ diff --git a/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp b/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp index 6e84c1286e8f..13e0aeb78988 100644 --- a/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp +++ b/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "CC_Common.h" @@ -101,7 +66,7 @@ int VcmSIPCCBinding::mVideoCodecMask = 0; /** * Convert a combined payload type value to a config value - * + * * @param [in] payload - the combined payload type integer * @param [out] config - the returned config value * @@ -556,7 +521,7 @@ void vcmRxAllocPort(cc_mcapid_t mcap_id, * @param[out] default_addrp - the ICE default addr * @param[out] port_allocatedp - the ICE default port * @param[out] candidatesp - the ICE candidate array - * @param[out] candidate_ctp length of the array + * @param[out] candidate_ctp length of the array * * @return void * @@ -589,8 +554,8 @@ void vcmRxAllocICE(cc_mcapid_t mcap_id, CSFLogError(logTag, "%s: AcquireInstance returned NULL", __FUNCTION__); return; } - - CSFLogDebug( logTag, "%s: Getting stream %d", __FUNCTION__, level); + + CSFLogDebug( logTag, "%s: Getting stream %d", __FUNCTION__, level); mozilla::RefPtr stream = pc->impl()->ice_media_stream(level-1); MOZ_ASSERT(stream); if (!stream) { @@ -608,15 +573,15 @@ void vcmRxAllocICE(cc_mcapid_t mcap_id, if (!NS_SUCCEEDED(res)) { return; } - + CSFLogDebug( logTag, "%s: Got default candidates %s:%d", __FUNCTION__, default_addr.c_str(), default_port); - + // Note: this leaks memory if we are out of memory. Oh well. *candidatesp = (char **) cpr_malloc(candidates.size() * sizeof(char *)); if (!(*candidatesp)) return; - + for (size_t i=0; i attrs = pc->impl()->ice_ctx()->GetGlobalAttributes(); - + // Now fish through these looking for a ufrag and passwd char *ufrag = NULL; char *pwd = NULL; - + for (size_t i=0; iimpl()->ice_ctx()->ParseGlobalAttributes(attributes); - + if (!NS_SUCCEEDED(res)) { CSFLogError( logTag, "%s: couldn't parse global parameters", __FUNCTION__ ); return VCM_ERROR; @@ -755,7 +720,7 @@ short vcmSetIceCandidate(const char *peerconnection, const char *icecandidate, u return VCM_ERROR; } - CSFLogDebug( logTag, "%s(): Getting stream %d", __FUNCTION__, level); + CSFLogDebug( logTag, "%s(): Getting stream %d", __FUNCTION__, level); mozilla::RefPtr stream = pc->impl()->ice_media_stream(level-1); if (!stream) return VCM_ERROR; @@ -804,7 +769,7 @@ short vcmStartIceChecks(const char *peerconnection) /* Set remote ICE media-level parameters. - * + * * @param[in] peerconnection - the peerconnection in use * @param[in] level - the m-line * @param[in] ufrag - the ufrag @@ -826,7 +791,7 @@ short vcmSetIceMediaParams(const char *peerconnection, int level, char *ufrag, c return VCM_ERROR; } - CSFLogDebug( logTag, "%s(): Getting stream %d", __FUNCTION__, level); + CSFLogDebug( logTag, "%s(): Getting stream %d", __FUNCTION__, level); mozilla::RefPtr stream = pc->impl()->ice_media_stream(level-1); if (!stream) return VCM_ERROR; @@ -837,7 +802,7 @@ short vcmSetIceMediaParams(const char *peerconnection, int level, char *ufrag, c attributes.push_back(ufrag); if (pwd) attributes.push_back(pwd); - + for (int i = 0; iimpl()->GetIdentity()->ComputeFingerprint("sha-256", digest, sizeof(digest), &digest_len); @@ -963,7 +928,7 @@ short vcmGetDtlsIdentity(const char *peerconnection, __FUNCTION__); return VCM_ERROR; } - + sstrncpy(digest_algp, "sha-256", max_digest_alg_len); sstrncpy(digestp, fingerprint_txt.c_str(), max_digest_len); @@ -1178,7 +1143,7 @@ int vcmRxStart(cc_mcapid_t mcap_id, * @param[in] call_handle - call handle * @param[in] peerconnection - the peerconnection in use * @param[in] num_payloads - number of negotiated payloads - * @param[in] payloads - negotiated codec details list + * @param[in] payloads - negotiated codec details list * @param[in] fingerprint_alg - the DTLS fingerprint algorithm * @param[in] fingerprint - the DTLS fingerprint * @param[in] attrs - media attributes @@ -1195,7 +1160,7 @@ int vcmRxStartICE(cc_mcapid_t mcap_id, cc_call_handle_t call_handle, const char *peerconnection, int num_payloads, - const vcm_media_payload_type_t* payloads, + const vcm_media_payload_type_t* payloads, const char *fingerprint_alg, const char *fingerprint, vcm_mediaAttrs_t *attrs) @@ -1214,7 +1179,7 @@ int vcmRxStartICE(cc_mcapid_t mcap_id, CSFLogError( logTag, "Unitialized payload list"); return VCM_ERROR; } - + // Find the stream we need nsRefPtr stream = pc->impl()->GetRemoteStream(pc_stream_id); @@ -1227,9 +1192,17 @@ int vcmRxStartICE(cc_mcapid_t mcap_id, mozilla::RefPtr rtp_flow = vcmCreateTransportFlow(pc->impl(), level, false, fingerprint_alg, fingerprint); + if (!rtp_flow) { + CSFLogError( logTag, "Could not create RTP flow"); + return VCM_ERROR; + } mozilla::RefPtr rtcp_flow = vcmCreateTransportFlow(pc->impl(), level, true, fingerprint_alg, fingerprint); + if (!rtcp_flow) { + CSFLogError( logTag, "Could not create RTCP flow"); + return VCM_ERROR; + } if (CC_IS_AUDIO(mcap_id)) { std::vector configs; @@ -1240,7 +1213,7 @@ int vcmRxStartICE(cc_mcapid_t mcap_id, return VCM_ERROR; mozilla::AudioCodecConfig *config_raw; - + for(int i=0; i ConfigureRecvMediaCodecs(configs)) @@ -1280,8 +1253,8 @@ int vcmRxStartICE(cc_mcapid_t mcap_id, PR_ASSERT(PR_FALSE); return VCM_ERROR; } - configs.push_back(config_raw); - } + configs.push_back(config_raw); + } if (conduit->ConfigureRecvMediaCodecs(configs)) return VCM_ERROR; @@ -1439,13 +1412,13 @@ map_tone_type( vcm_tones_t tone ) case VCM_BEEP_BONK: return ToneType_BEEP_BONK; case VCM_RECORDERWARNING_TONE: - return ToneType_RECORDERWARNING_TONE; + return ToneType_RECORDERWARNING_TONE; case VCM_RECORDERDETECTED_TONE: return ToneType_RECORDERDETECTED_TONE; case VCM_MONITORWARNING_TONE: return ToneType_MONITORWARNING_TONE; case VCM_SECUREWARNING_TONE: - return ToneType_SECUREWARNING_TONE; + return ToneType_SECUREWARNING_TONE; default: CSFLogDebugS( logTag, "map_tone_type(): WARNING..tone type not mapped."); return ToneType_NO_TONE; @@ -1495,7 +1468,7 @@ void vcmToneStart(vcm_tones_t tone, case VCM_MSG_WAITING_TONE: lsm_start_multipart_tone_timer(tone, MSG_WAITING_DELAY, call_handle); break; - + case VCM_HOLD_TONE: lsm_start_continuous_tone_timer(tone, TOH_DELAY, call_handle); break; @@ -1753,7 +1726,7 @@ int vcmTxStartICE(cc_mcapid_t mcap_id, vcm_media_payload_type_t payload, short tos, const char *fingerprint_alg, - const char *fingerprint, + const char *fingerprint, vcm_mediaAttrs_t *attrs) { CSFLogDebug( logTag, "%s(%s)", __FUNCTION__, peerconnection); @@ -1766,14 +1739,22 @@ int vcmTxStartICE(cc_mcapid_t mcap_id, return VCM_ERROR; } nsRefPtr stream = pc->impl()->GetLocalStream(pc_stream_id); - + // Create the transport flows - mozilla::RefPtr rtp_flow = + mozilla::RefPtr rtp_flow = vcmCreateTransportFlow(pc->impl(), level, false, - fingerprint_alg, fingerprint); - mozilla::RefPtr rtcp_flow = + fingerprint_alg, fingerprint); + if (!rtp_flow) { + CSFLogError( logTag, "Could not create RTP flow"); + return VCM_ERROR; + } + mozilla::RefPtr rtcp_flow = vcmCreateTransportFlow(pc->impl(), level, true, fingerprint_alg, fingerprint); + if (!rtcp_flow) { + CSFLogError( logTag, "Could not create RTCP flow"); + return VCM_ERROR; + } if (CC_IS_AUDIO(mcap_id)) { // Find the appropriate media conduit config @@ -1906,9 +1887,9 @@ map_codec_request_type( int request_type ) /** * Get current list of audio codec that could be used - * @param request_type - + * @param request_type - * The request_type should be VCM_DECODEONLY/ENCODEONLY/FULLDUPLEX/IGNORE - * + * * @return A bit mask should be returned that specifies the list of the audio * codecs. The bit mask should conform to the defines in this file. * #define VCM_RESOURCE_G711 0x00000001 @@ -1916,7 +1897,7 @@ map_codec_request_type( int request_type ) * .... */ -int vcmGetAudioCodecList(int request_type) +int vcmGetAudioCodecList(int request_type) { // Direct access to media layer replaced by locally stored codecMask // set in PeerConnectionImpl @@ -1940,14 +1921,14 @@ int vcmGetAudioCodecList(int request_type) #else int codecMask = VcmSIPCCBinding::getAudioCodecs(); CSFLogDebug(logTag, "GetAudioCodecList returning %X", codecMask); - + return codecMask; #endif } /** * Get current list of video codec that could be used - * @param request_type - + * @param request_type - * The request_type should be VCM_DECODEONLY/ENCODEONLY/FULLDUPLEX/IGNORE * * @return A bit mask should be returned that specifies the list of the audio @@ -1988,13 +1969,13 @@ int vcmGetVideoCodecList(int request_type) #else int codecMask = VcmSIPCCBinding::getVideoCodecs(); CSFLogDebug(logTag, "GetVideoCodecList returning %X", codecMask); - + return codecMask; #endif } /** - * Get max supported H.264 video packetization mode. + * Get max supported H.264 video packetization mode. * @return maximum supported video packetization mode for H.264. Value returned * must be 0 or 1. Value 2 is not supported yet. */ @@ -2168,7 +2149,7 @@ cc_boolean vcmCheckAttribs(cc_uint32_t media_type, void *sdp_p, int level, void if ( (ptr = ccsdpAttrGetFmtpParamSets(sdp_p, level, 0, 1)) != NULL ) { memset(rcap->sprop_parameter_set, 0, csf_countof(rcap->sprop_parameter_set)); - sstrncpy(rcap->sprop_parameter_set, ptr, csf_countof(rcap->sprop_parameter_set)); + sstrncpy(rcap->sprop_parameter_set, ptr, csf_countof(rcap->sprop_parameter_set)); } if ( ccsdpAttrGetFmtpPackMode(sdp_p, level, 0, 1, &temp) == SDP_SUCCESS ) @@ -2228,8 +2209,8 @@ cc_boolean vcmCheckAttribs(cc_uint32_t media_type, void *sdp_p, int level, void rcap->packetization_mode, rcap->profile_level_id, rcap->max_mbps, - rcap->max_fs, - rcap->max_cpb, + rcap->max_fs, + rcap->max_cpb, rcap->max_dpb, rcap->max_br, rcap->tias_bw); @@ -2319,7 +2300,7 @@ int vcmDtmfBurst(int digit, int duration, int direction) /** * vcmGetILBCMode * - * This method should return the mode that needs to be used in + * This method should return the mode that needs to be used in * SDP * @return int */ @@ -2397,7 +2378,7 @@ static int vcmPayloadType2AudioCodec(vcm_media_payload_type_t payload_in, static int vcmPayloadType2VideoCodec(vcm_media_payload_type_t payload_in, mozilla::VideoCodecConfig **config) { int wire_payload = -1; - int payload = -1; + int payload = -1; *config = NULL; if (CHECK_DYNAMIC_PAYLOAD_TYPE(payload_in)) { @@ -2442,7 +2423,7 @@ vcmCreateTransportFlow(sipcc::PeerConnectionImpl *pc, int level, bool rtcp, // Not clear that either of these cases matters. mozilla::RefPtr flow; flow = pc->GetTransportFlow(level, rtcp); - + if (!flow) { CSFLogDebug(logTag, "Making new transport flow for level=%d rtcp=%s", level, rtcp ? "true" : "false"); @@ -2461,7 +2442,7 @@ vcmCreateTransportFlow(sipcc::PeerConnectionImpl *pc, int level, bool rtcp, unsigned char remote_digest[TransportLayerDtls::kMaxDigestLength]; size_t digest_len; - + nsresult res = DtlsIdentity::ParseFingerprint(fingerprint, remote_digest, sizeof(remote_digest), diff --git a/media/webrtc/signaling/src/media/VcmSIPCCBinding.h b/media/webrtc/signaling/src/media/VcmSIPCCBinding.h index 6672dc3b477c..678413ccd65a 100644 --- a/media/webrtc/signaling/src/media/VcmSIPCCBinding.h +++ b/media/webrtc/signaling/src/media/VcmSIPCCBinding.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CSF_VCM_SIPCC_BINDING_H_ #define _CSF_VCM_SIPCC_BINDING_H_ diff --git a/media/webrtc/signaling/src/media/cip_Sipcc_CodecMask.h b/media/webrtc/signaling/src/media/cip_Sipcc_CodecMask.h index 2b15f641b9a7..2eb147bbc784 100644 --- a/media/webrtc/signaling/src/media/cip_Sipcc_CodecMask.h +++ b/media/webrtc/signaling/src/media/cip_Sipcc_CodecMask.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _Included_cip_sipcc_CodecMask #define _Included_cip_sipcc_CodecMask diff --git a/media/webrtc/signaling/src/media/cip_mmgr_mediadefinitions.h b/media/webrtc/signaling/src/media/cip_mmgr_mediadefinitions.h index f3528d2452f3..7d1706ce261c 100644 --- a/media/webrtc/signaling/src/media/cip_mmgr_mediadefinitions.h +++ b/media/webrtc/signaling/src/media/cip_mmgr_mediadefinitions.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _Included_cip_mmgr_MediaDefinitions #define _Included_cip_mmgr_MediaDefinitions diff --git a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp index 0da3de91f63a..25cf329efac6 100644 --- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp +++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp @@ -45,7 +45,7 @@ nsresult MediaPipeline::Init() { MOZ_ASSERT(rtp_transport_); nsresult res; - + // Look to see if the transport is ready rtp_transport_->SignalStateChange.connect(this, &MediaPipeline::StateChange); @@ -360,10 +360,10 @@ bool MediaPipeline::IsRtp(const unsigned char *data, size_t len) { // Anything outside this range is RTP. if ((data[1] < 192) || (data[1] > 207)) return true; - + if (data[1] == 192) // FIR return false; - + if (data[1] == 193) // NACK, but could also be RTP. This makes us sad return true; // but it's how webrtc.org behaves. @@ -371,7 +371,7 @@ bool MediaPipeline::IsRtp(const unsigned char *data, size_t len) { return true; if (data[1] == 195) // IJ. - return false; + return false; if ((data[1] > 195) && (data[1] < 200)) // the > 195 is redundant return true; @@ -400,9 +400,9 @@ void MediaPipeline::PacketReceived(TransportLayer *layer, nsresult MediaPipelineTransmit::Init() { // TODO(ekr@rtfm.com): Check for errors - MOZ_MTLOG(PR_LOG_DEBUG, "Attaching pipeline to stream " + MOZ_MTLOG(PR_LOG_DEBUG, "Attaching pipeline to stream " << static_cast(stream_) << - " conduit type=" << + " conduit type=" << (conduit_->type() == MediaSessionConduit::AUDIO ? "audio" : "video") << " hints=" << stream_->GetHintContents()); @@ -610,7 +610,7 @@ void MediaPipelineTransmit::ProcessVideoChunk(VideoSessionConduit *conduit, static_cast(img)); // Big-time assumption here that this is all contiguous data coming - // from getUserMedia or other sources. + // from getUserMedia or other sources. const layers::PlanarYCbCrImage::Data *data = yuv->GetData(); uint8_t *y = data->mYChannel; diff --git a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h index 5028fd51d1c0..40744c797f99 100644 --- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h +++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h @@ -32,7 +32,7 @@ namespace mozilla { // CaptureDevice -> stream -> [us] -> conduit -> [us] -> transport -> network // // RECEIVE -// network -> transport -> [us] -> conduit -> [us] -> stream -> Playout +// network -> transport -> [us] -> conduit -> [us] -> stream -> Playout // // The boxes labeled [us] are just bridge logic implemented in this class class MediaPipeline : public sigslot::has_slots<> { diff --git a/media/webrtc/signaling/src/mediapipeline/SrtpFlow.cpp b/media/webrtc/signaling/src/mediapipeline/SrtpFlow.cpp index e2bbb4971b71..945a0b8354cf 100644 --- a/media/webrtc/signaling/src/mediapipeline/SrtpFlow.cpp +++ b/media/webrtc/signaling/src/mediapipeline/SrtpFlow.cpp @@ -13,7 +13,7 @@ #include "logging.h" #include "mozilla/RefPtr.h" - + // Logging context using namespace mozilla; MOZ_MTLOG_MODULE("mediapipeline"); diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp index 00f911e07b1c..97c32cb5d09e 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp @@ -1,31 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "CallControlManager.h" diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.h b/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.h index f1e4f5083d12..e8ef9de1e039 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.h +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.h @@ -1,31 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef peerconnectionctx_h___h__ #define peerconnectionctx_h___h__ diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp index b7da27c7bfc1..de1d61651086 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp @@ -393,10 +393,10 @@ PeerConnectionImpl::Initialize(IPeerConnectionObserver* aObserver, PK11_GenerateRandom(handle_bin, sizeof(handle_bin)); char hex[17]; - PR_snprintf(hex,sizeof(hex),"%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x", - handle_bin[0], + PR_snprintf(hex,sizeof(hex),"%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x", + handle_bin[0], handle_bin[1], - handle_bin[2], + handle_bin[2], handle_bin[3], handle_bin[4], handle_bin[5], @@ -456,7 +456,8 @@ PeerConnectionImpl::Initialize(IPeerConnectionObserver* aObserver, ); if (NS_FAILED(res)) { - CSFLogErrorS(logTag, __FUNCTION__ << ": StartGathering failed: " << res); + CSFLogErrorS(logTag, __FUNCTION__ << ": StartGathering failed: " << + static_cast(res)); return res; } @@ -482,7 +483,8 @@ PeerConnectionImpl::Initialize(IPeerConnectionObserver* aObserver, &fingerprint_length); if (NS_FAILED(res)) { - CSFLogErrorS(logTag, __FUNCTION__ << ": ComputeFingerprint failed: " << res); + CSFLogErrorS(logTag, __FUNCTION__ << ": ComputeFingerprint failed: " << + static_cast(res)); return res; } @@ -493,7 +495,8 @@ PeerConnectionImpl::Initialize(IPeerConnectionObserver* aObserver, mSTSThread = do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &res); if (NS_FAILED(res)) { - CSFLogErrorS(logTag, __FUNCTION__ << ": do_GetService failed: " << res); + CSFLogErrorS(logTag, __FUNCTION__ << ": do_GetService failed: " << + static_cast(res)); return res; } diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/CCProvider.h b/media/webrtc/signaling/src/sipcc/core/ccapp/CCProvider.h index 750aa280f977..1e1a035c65a4 100755 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/CCProvider.h +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/CCProvider.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef __CCPROVIDER_H__ #define __CCPROVIDER_H__ diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/call_logger.c b/media/webrtc/signaling/src/sipcc/core/ccapp/call_logger.c index cac8b78aeb58..e3ec264bf8ff 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/call_logger.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/call_logger.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_stdio.h" #include @@ -98,14 +63,14 @@ void calllogger_print_call_log(cc_call_log_t *log) static const char *fname = "calllogger_print_call_log"; CCLOG_DEBUG(DEB_F_PREFIX"Entering...\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname)); - CCLOG_DEBUG("Remote ID %s:%s %s:%s\n LocalID %s:%s \n alt %s:%s\n", - log->remotePartyName[0], log->remotePartyNumber[0], - log->remotePartyName[1], log->remotePartyNumber[1], - log->localPartyName, log->localPartyNumber, + CCLOG_DEBUG("Remote ID %s:%s %s:%s\n LocalID %s:%s \n alt %s:%s\n", + log->remotePartyName[0], log->remotePartyNumber[0], + log->remotePartyName[1], log->remotePartyNumber[1], + log->localPartyName, log->localPartyNumber, log->altPartyNumber[0], log->altPartyNumber[1] ); CCLOG_DEBUG("state %d \n Disp %d\n", log->callState, log->logDisp); } - + /** * Call logger update to be called placed call num update */ @@ -114,7 +79,7 @@ void calllogger_setPlacedCallInfo (session_data_t *data) static const char *fname = "calllogger_setPlacedCallInfo"; CCLOG_DEBUG(DEB_F_PREFIX"updating placed number for session %x to %s:%s\n", - DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), data->sess_id, + DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), data->sess_id, data->cld_name, data->cld_number); if ( data->call_log.logDisp == CC_LOGD_RCVD ) { return;} data->call_log.remotePartyName[0] = strlib_copy(data->plcd_name); @@ -134,8 +99,8 @@ void calllogger_updateLogDisp (session_data_t *data) DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), data->sess_id, data->log_disp); data->call_log.logDisp = data->log_disp; } - -cc_boolean partyInfoPassedTheNumberFilter (cc_string_t partyString) + +cc_boolean partyInfoPassedTheNumberFilter (cc_string_t partyString) { static const char *fname = "partyInfoPassedTheNumberFilter"; @@ -168,7 +133,7 @@ cc_boolean partyInfoPassedTheNameFilter(cc_string_t partyString) { CCLOG_DEBUG(DEB_F_PREFIX"Entering...\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname)); // If the name String has Conference, filter it out - if (partyString && strlen(partyString) > 1 && + if (partyString && strlen(partyString) > 1 && (partyString[1] == 52 || partyString[1] == 53)) { CCLOG_DEBUG(DEB_F_PREFIX"Filtering out the partyName=%s\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), partyString); return FALSE; @@ -180,7 +145,7 @@ static cc_string_t missedCallMask=NULL; void calllogger_setMissedCallLoggingConfig(cc_string_t mask) { static const char *fname = "calllogger_setMissedCallLoggingConfig"; - + CCLOG_DEBUG(DEB_F_PREFIX"Entering... mask=%s\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), mask); if ( missedCallMask == NULL) { missedCallMask = strlib_empty(); @@ -206,10 +171,10 @@ cc_boolean isMissedCallLoggingEnabled (unsigned int line) } -void handlePlacedCall (session_data_t *data) +void handlePlacedCall (session_data_t *data) { static const char *fname = "handlePlacedCall"; - + CCLOG_DEBUG(DEB_F_PREFIX"Entering...\n",DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname)); //populate calling party if not already populated @@ -220,13 +185,13 @@ void handlePlacedCall (session_data_t *data) // first update or update with the same number we update name and number if ( data->call_log.remotePartyNumber[0] == strlib_empty() || - (data->cld_number[0] != 0 && strncmp(data->call_log.remotePartyNumber[0], + (data->cld_number[0] != 0 && strncmp(data->call_log.remotePartyNumber[0], data->cld_number, strlen(data->cld_number)) == 0 )) { if ( partyInfoPassedTheNameFilter(data->cld_name) && partyInfoPassedTheNumberFilter(data->cld_number) ) data->call_log.remotePartyNumber[0] = strlib_update(data->call_log.remotePartyNumber[0], data->cld_number); data->call_log.remotePartyName[0] = strlib_update(data->call_log.remotePartyName[0], data->cld_name); - } + } // Start the duration count once the call reaches connected state. if ( data->state == CONNECTED && @@ -241,7 +206,7 @@ void handlePlacedCall (session_data_t *data) } else { data->call_log.startTime = time(NULL); } - } + } data->call_log.callState = data->state; } @@ -253,7 +218,7 @@ void handleMissedOrReceviedCall ( session_data_t *data ) int line = GET_LINE_ID(data->sess_id); cc_string_t localName = strlib_empty(), localNumber = strlib_empty(); cc_string_t remoteName = strlib_empty(), remoteNumber = strlib_empty(); - + CCLOG_DEBUG(DEB_F_PREFIX"Entering...\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname)); if (data->type == CC_CALL_TYPE_INCOMING || data->type == CC_CALL_TYPE_FORWARDED ) { @@ -275,7 +240,7 @@ void handleMissedOrReceviedCall ( session_data_t *data ) // first update or update with the same number we update name and number if ( data->call_log.remotePartyNumber[0] == strlib_empty() || - (remoteNumber[0] != 0 && strncmp(data->call_log.remotePartyNumber[0], + (remoteNumber[0] != 0 && strncmp(data->call_log.remotePartyNumber[0], remoteNumber, strlen(remoteNumber)) == 0 )) { data->call_log.remotePartyNumber[0] = strlib_update(data->call_log.remotePartyNumber[0], remoteNumber); data->call_log.altPartyNumber[0] = strlib_update(data->call_log.altPartyNumber[0], data->alt_number); @@ -292,9 +257,9 @@ void handleMissedOrReceviedCall ( session_data_t *data ) if ( data->state == ONHOOK ) { if ( data->call_log.callState == RINGIN ) { data->call_log.startTime = time(NULL); - if (isMissedCallLoggingEnabled(line)) { + if (isMissedCallLoggingEnabled(line)) { data->call_log.logDisp = CC_LOGD_MISSED; - } else { + } else { data->call_log.logDisp = CC_LOGD_DELETE; } data->call_log.startTime = time(NULL); @@ -312,7 +277,7 @@ void handleMissedOrReceviedCall ( session_data_t *data ) data->call_log.callState = data->state; } - + /** * Call logger update to be called on attr or callinfo or state events @@ -320,10 +285,10 @@ void handleMissedOrReceviedCall ( session_data_t *data ) void calllogger_update (session_data_t *data) { static const char *fname = "calllogger_update"; - + CCLOG_DEBUG(DEB_F_PREFIX"Entering...\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname)); if (data->call_log.logDisp == CC_LOGD_DELETE) { - CCLOG_DEBUG(DEB_F_PREFIX"log disposition set to delete. Ignoring call logging for sess_id=%x\n", + CCLOG_DEBUG(DEB_F_PREFIX"log disposition set to delete. Ignoring call logging for sess_id=%x\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), data->sess_id); } diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/call_logger.h b/media/webrtc/signaling/src/sipcc/core/ccapp/call_logger.h index 20a7047ddec9..6ccec2e274b6 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/call_logger.h +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/call_logger.h @@ -1,47 +1,12 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef __CALL_LOGGER_H__ #define __CALL_LOGGER_H__ #include "cc_types.h" -#include "CCProvider.h" +#include "CCProvider.h" void calllogger_init_call_log(cc_call_log_t *log); void calllogger_copy_call_log(cc_call_log_t *dest, cc_call_log_t * src); diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/capability_set.c b/media/webrtc/signaling/src/sipcc/core/ccapp/capability_set.c index c706c96b51b0..71471fb60d92 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/capability_set.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/capability_set.c @@ -1,42 +1,7 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + #include "capability_set.h" #include "CCProvider.h" @@ -67,7 +32,7 @@ static const unsigned int CONFERENCE_LIST_FCP_INDEX = 4; static const unsigned int SPEED_DIAL_FCP_INDEX = 5; static const unsigned int CALL_BACK_FCP_INDEX = 6; static const unsigned int REDIAL_FCP_INDEX = 7; - + static int fcp_index = -1; // -------------------------------------------------------------------------------- @@ -113,22 +78,22 @@ static void fcp_set_index (unsigned int fcpCapabilityId, cc_boolean state) // range check the capability index if ((fcpCapabilityId <= 0) || (fcpCapabilityId > FCP_FEATURE_MAX)) { - CONFIG_ERROR(CFG_F_PREFIX "Unable to set capability of unknown feature [%d] in FCP \n", "fcp_set_index", fcpCapabilityId); - return; + CONFIG_ERROR(CFG_F_PREFIX "Unable to set capability of unknown feature [%d] in FCP \n", "fcp_set_index", fcpCapabilityId); + return; } - // convert the fcp index to an fcp capability id + // convert the fcp index to an fcp capability id capabilityId = cc_fcp_id_to_capability_map[fcpCapabilityId]; - - - // based on the capability id, invoke the appropate method specific to that capability + + + // based on the capability id, invoke the appropate method specific to that capability switch (capabilityId) { case CCAPI_CALL_CAP_CALLFWD : capset_set_fcp_forwardall (state); break; case CCAPI_CALL_CAP_REDIAL : capset_set_fcp_redial (state); break; default : { - CONFIG_ERROR(CFG_F_PREFIX "Unable to update settings for capability [%d]\n", "fcp_set_index", (int)capabilityId); + CONFIG_ERROR(CFG_F_PREFIX "Unable to update settings for capability [%d]\n", "fcp_set_index", (int)capabilityId); break; } } @@ -138,7 +103,7 @@ static void fcp_set_index (unsigned int fcpCapabilityId, cc_boolean state) * capset_init - initialize the internal capability data structures to defaults * */ -static void capset_init () +static void capset_init () { // initialize the 4 tables related to capability set to false memset(capability_idleset, 0, sizeof(capability_idleset)); @@ -147,19 +112,19 @@ static void capset_init () // ---------------------------------------------------------------------- // FCP based capabilities // ---------------------------------------------------------------------- - + CONFIG_DEBUG(DEB_F_PREFIX"FCP Initializing Capabilities to default\n", DEB_F_PREFIX_ARGS(JNI, "capset_init")); - + // ---------------------------------------------------------------------- // Non-FCP-based Capabilities // ---------------------------------------------------------------------- - + // Now, set all the non-FCP based capabilities to appropriate default settings // (some of which may be enabled by default) - + capability_idleset[CCAPI_CALL_CAP_NEWCALL] = TRUE; - // call-state based settings + // call-state based settings // offhook capability_set[OFFHOOK][CCAPI_CALL_CAP_ENDCALL] = TRUE; @@ -198,7 +163,7 @@ static void capset_init () capability_set[DIALING][CCAPI_CALL_CAP_SENDDIGIT] = TRUE; capability_set[DIALING][CCAPI_CALL_CAP_BACKSPACE] = TRUE; - // holdrevert + // holdrevert capability_set[HOLDREVERT][CCAPI_CALL_CAP_ANSWER] = TRUE; // preservation @@ -234,7 +199,7 @@ void capset_get_idleset ( cc_cucm_mode_t mode, cc_boolean features[]) * capset_get_allowed_features - get the set of features * */ -void capset_get_allowed_features ( cc_cucm_mode_t mode, cc_call_state_t state, cc_boolean features[]) +void capset_get_allowed_features ( cc_cucm_mode_t mode, cc_call_state_t state, cc_boolean features[]) { static const char fname[] = "capset_get_allowed_features"; int i; @@ -253,7 +218,7 @@ void capset_get_allowed_features ( cc_cucm_mode_t mode, cc_call_state_t state, c // -------------------------------------------------------------------------------------------------------- /* - * fcp_set_capabilities - updates the capabilities structure, based on the now parsed information + * fcp_set_capabilities - updates the capabilities structure, based on the now parsed information * from fcp xml file * */ @@ -264,16 +229,16 @@ static void fcp_set_capabilities() if ( (fcp_index+1) >= FCP_FEATURE_MAX) { fcp_index = (FCP_FEATURE_MAX -1); - CONFIG_ERROR(CFG_F_PREFIX "Received more than the maximum supported features [%d] in FCP \n", "fcp_set_capabilities", FCP_FEATURE_MAX); - + CONFIG_ERROR(CFG_F_PREFIX "Received more than the maximum supported features [%d] in FCP \n", "fcp_set_capabilities", FCP_FEATURE_MAX); + } - // loop over all the FCP features parsed, and for each one, based on ID, and enabled settings, + // loop over all the FCP features parsed, and for each one, based on ID, and enabled settings, // update the corresponding call capability flags for (my_fcp_index = 0; my_fcp_index <= fcp_index; my_fcp_index++) { // set the capability if fcp file has it marked as 'enabled' - fcp_set_index(cc_feat_control_policy[my_fcp_index].featureId, (cc_feat_control_policy[my_fcp_index].featureEnabled == TRUE)); + fcp_set_index(cc_feat_control_policy[my_fcp_index].featureId, (cc_feat_control_policy[my_fcp_index].featureEnabled == TRUE)); } -} +} /* * fcp_init - initialize the data structure used to store the fcp parse info @@ -283,14 +248,14 @@ static void fcp_init() { // master index; set to null fcp_index = -1; - + // initialize the map of fcp xml feature indexes to internal call capabilities cc_fcp_id_to_capability_map[CALL_FORWARD_ALL_FCP_INDEX] = CCAPI_CALL_CAP_CALLFWD; cc_fcp_id_to_capability_map[REDIAL_FCP_INDEX] = CCAPI_CALL_CAP_REDIAL; // initialize the capability set data structures capset_init(); - + // initialize the version g_fp_version_stamp[0] = '\0'; } @@ -301,14 +266,14 @@ static void fcp_init() */ int fcp_init_template (const char* fcp_plan_string) { - fcp_init(); - + fcp_init(); + if (fcp_plan_string == NULL) { // set up the default fcp - return (0); + return (0); } - // update the fcp capabilities structure, based on the parsed feature information + // update the fcp capabilities structure, based on the parsed feature information fcp_set_capabilities(); return (0); diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/capability_set.h b/media/webrtc/signaling/src/sipcc/core/ccapp/capability_set.h index 26154531b0cc..bad517a70a89 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/capability_set.h +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/capability_set.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CC_CAPABILITY_SET_H_ #define _CC_CAPABILITY_SET_H_ @@ -58,7 +23,7 @@ extern char g_fp_version_stamp[MAX_FP_VERSION_STAMP_LEN]; // for each feature in the XML FCP file, we'll receive the // feature name, featureId, and whether or not it is enabled -typedef struct cc_feature_control_policy_info_t_ +typedef struct cc_feature_control_policy_info_t_ { char featureName[FCP_FEATURE_NAME_MAX]; unsigned int featureId; diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/cc_blf.c b/media/webrtc/signaling/src/sipcc/core/ccapp/cc_blf.c index 284100c25053..49c500248ab6 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/cc_blf.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/cc_blf.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cc_blf.h" #include "pres_sub_not_handler.h" diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/cc_call_feature.c b/media/webrtc/signaling/src/sipcc/core/ccapp/cc_call_feature.c index 1a16369f4f50..98372f585ed5 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/cc_call_feature.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/cc_call_feature.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cc_call_feature.h" #include "CCProvider.h" diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/cc_config.c b/media/webrtc/signaling/src/sipcc/core/ccapp/cc_config.c index f3940ab68db8..d990051af8c0 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/cc_config.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/cc_config.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cc_config.h" #include "CCProvider.h" @@ -132,24 +97,24 @@ char* CC_Config_setDialPlan(const char *dial_plan_string, int length) { int ret; /** - * If the string is null, empty or oversized, we will reset the dial + * If the string is null, empty or oversized, we will reset the dial * plan by setting the length to 0. */ if (dial_plan_string == NULL || length == 0 || length >= DIALPLAN_MAX_SIZE) { - TNP_DEBUG(DEB_F_PREFIX"Setting NULL dialplan string (length [%d] is 0, or length is larger than maximum [%d])\n", + TNP_DEBUG(DEB_F_PREFIX"Setting NULL dialplan string (length [%d] is 0, or length is larger than maximum [%d])\n", DEB_F_PREFIX_ARGS(JNI, fname), length, DIALPLAN_MAX_SIZE); - + dp_init_template (NULL, 0); return (NULL); } ret = dp_init_template(dial_plan_string, length); TNP_DEBUG(DEB_F_PREFIX"Parsed dial_plan_string. Version=[%s], Length=[%d]\n", DEB_F_PREFIX_ARGS(JNI, fname), g_dp_version_stamp, length); - if (ret != 0) + if (ret != 0) { return (NULL); } - + return (g_dp_version_stamp); } @@ -167,23 +132,23 @@ char* CC_Config_setFcp(const char *fcp_plan_string, int len) { /** * If the string is null, return null (version) */ - - TNP_DEBUG(DEB_F_PREFIX"FCP Parsing FCP doc\n", DEB_F_PREFIX_ARGS(JNI, fname)); + + TNP_DEBUG(DEB_F_PREFIX"FCP Parsing FCP doc\n", DEB_F_PREFIX_ARGS(JNI, fname)); if (fcp_plan_string == NULL) - { - TNP_DEBUG(DEB_F_PREFIX"Null FCP xml document\n", + { + TNP_DEBUG(DEB_F_PREFIX"Null FCP xml document\n", DEB_F_PREFIX_ARGS(JNI, fname)); - + fcp_init_template (NULL); return (NULL); } - + ret = fcp_init_template (fcp_plan_string); TNP_DEBUG(DEB_F_PREFIX"Parsed FCP xml. Version=[%s]\n", DEB_F_PREFIX_ARGS(JNI, fname), g_fp_version_stamp); if (ret != 0) { return (NULL); } - + return (g_fp_version_stamp); } diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/cc_device_feature.c b/media/webrtc/signaling/src/sipcc/core/ccapp/cc_device_feature.c index 2989a487601e..930119f4efd4 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/cc_device_feature.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/cc_device_feature.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cc_device_feature.h" #include "sessionConstants.h" diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/cc_device_manager.c b/media/webrtc/signaling/src/sipcc/core/ccapp/cc_device_manager.c index 82eb6a9c282e..5a8c8d93a865 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/cc_device_manager.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/cc_device_manager.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cc_constants.h" #include "session.h" @@ -174,7 +139,7 @@ int action(int cmd) CCAPP_DEBUG("CC_device_manager_action: CMD_INIT \n"); proCmd.cmdData.ccData.reason = STARTUP_NORMAL; - + if (ccappTaskPostMsg(CCAPP_SERVICE_CMD, (cprBuffer_t)&proCmd, sizeof(sessionProvider_cmd_t), CCAPP_CCPROVIER) == CPR_FAILURE) { CCAPP_DEBUG("ccInvokeFeature: ccappTaskSendMsg failed\n"); @@ -184,7 +149,7 @@ int action(int cmd) CCAPP_DEBUG("CC_device_manager_action: CMD_RESTART \n"); updateMediaConfigProperties(); proCmd.cmdData.ccData.reason = STARTUP_NORMAL; - + if (ccappTaskPostMsg(CCAPP_SERVICE_CMD, (cprBuffer_t)&proCmd, sizeof(sessionProvider_cmd_t), CCAPP_CCPROVIER) == CPR_FAILURE) { CCAPP_DEBUG("ccInvokeFeature: ccappTaskSendMsg failed\n"); @@ -229,7 +194,7 @@ void setState(int st) { mgmtState = st; } -void processInsToOos (void ) +void processInsToOos (void ) { //CCAPP_DEBUG("CC_device_manager: processInsToOoS \n"); DEF_DEBUG("CC_device_manager: processInsToOoS \n"); @@ -243,14 +208,14 @@ void prepareForSoftReset() } -void processInserviceEvent( void) +void processInserviceEvent( void) { CCAPP_DEBUG("CC_device_manager: process Inservice Event\n"); if (g_deviceInfo.cucm_mode == CC_MODE_CCM ) { if (sub_hndlr_isAvailable() == FALSE) { sub_hndlr_start(); } - } + } setState(MGMT_STATE_REGISTERED); //TODO: check Java code } @@ -260,7 +225,7 @@ void processInserviceEvent( void) * Event handler for device manager */ void registration_processEvent(int event) { - + boolean ignored=0; DEF_DEBUG("registration_processEvent: Event %s, current State %s \n", @@ -273,7 +238,7 @@ void registration_processEvent(int event) { setState(MGMT_STATE_CREATED); init_empty_str(g_cfg_p); CC_Service_create(); - CC_Service_init(); + CC_Service_init(); break; case MGMT_STATE_REGISTERED: case MGMT_STATE_REGISTERING: @@ -350,12 +315,12 @@ void registration_processEvent(int event) { case MGMT_STATE_REGISTERED: if (is_action_to_be_deferred(RE_REGISTER_ACTION) == FALSE) { - processInsToOos(); + processInsToOos(); prepareForSoftReset(); setState(MGMT_STATE_OOS_AWAIT_UN_REG_ACK); action(CMD_SHUTDOWN); - } - break; + } + break; case MGMT_STATE_REGISTERING: case MGMT_STATE_OOS: if (is_action_to_be_deferred(RE_REGISTER_ACTION) @@ -363,8 +328,8 @@ void registration_processEvent(int event) { prepareForSoftReset(); setState(MGMT_STATE_OOS_AWAIT_UN_REG_ACK); action(CMD_SHUTDOWN); - } - break; + } + break; case MGMT_STATE_IDLE: case MGMT_STATE_WAITING_FOR_CONFIG_FILE: case MGMT_STATE_CREATED: @@ -431,7 +396,7 @@ void registration_processEvent(int event) { case MGMT_STATE_OOS: case MGMT_STATE_REGISTERING: setState(MGMT_STATE_REGISTERED); - case MGMT_STATE_REGISTERED: + case MGMT_STATE_REGISTERED: processInserviceEvent(); break; case MGMT_STATE_CREATED: diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/cc_device_manager.h b/media/webrtc/signaling/src/sipcc/core/ccapp/cc_device_manager.h index 557345cc8a00..ed0dbec7d2a7 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/cc_device_manager.h +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/cc_device_manager.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * Management Events diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/cc_info.c b/media/webrtc/signaling/src/sipcc/core/ccapp/cc_info.c index f5d155a3d30a..d6117100a5ed 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/cc_info.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/cc_info.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cc_info.h" #include "sessionTypes.h" diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/cc_service.c b/media/webrtc/signaling/src/sipcc/core/ccapp/cc_service.c index e2f324b73281..dd3dc3cd48b6 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/cc_service.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/cc_service.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cc_service.h" #include "phone_debug.h" diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_call.c b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_call.c index 879d684ebbe0..627bb7ec74f0 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_call.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_call.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_stdio.h" #include "ccapi_call.h" @@ -87,7 +52,7 @@ void CCAPI_Call_retainCallInfo(cc_callinfo_ref_t ref) { */ void CCAPI_Call_releaseCallInfo(cc_callinfo_ref_t ref) { if (ref != NULL ) { - DEF_DEBUG(DEB_F_PREFIX"ref=0x%x: count=%d", + DEF_DEBUG(DEB_F_PREFIX"ref=0x%x: count=%d", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI_Call_releaseCallInfo"), ref, ref->ref_count); ref->ref_count--; if ( ref->ref_count == 0 ) { @@ -114,7 +79,7 @@ cc_lineid_t CCAPI_Call_getLine(cc_call_handle_t call_handle){ } /** - * Originate call + * Originate call * Goes offhook and dials digits if specified * @param [in] handle - call handle * @param [in] video_pref - video direction desired on call @@ -197,7 +162,7 @@ cc_return_t CCAPI_Call_redial(cc_call_handle_t handle, cc_sdp_direction_t video_ } /** - * Initiate Call Forward All + * Initiate Call Forward All * @param [in] handle - call handle * @return SUCCESS or FAILURE */ @@ -294,7 +259,7 @@ cc_return_t CCAPI_Call_transferStart(cc_call_handle_t handle, cc_sdp_direction_t * @param [in] video_pref - video direction desired on consult call * @return SUCCESS or FAILURE */ -cc_return_t CCAPI_Call_transferComplete(cc_call_handle_t handle, cc_call_handle_t phandle, +cc_return_t CCAPI_Call_transferComplete(cc_call_handle_t handle, cc_call_handle_t phandle, cc_sdp_direction_t video_pref){ return CC_CallFeature_transfer(handle, phandle, video_pref); } @@ -334,7 +299,7 @@ cc_return_t CCAPI_Call_joinAcrossLine(cc_call_handle_t handle, cc_call_handle_t * @param [in] speed - speedDial Number * @return SUCCESS or FAILURE */ -cc_return_t CCAPI_Call_blfCallPickup(cc_call_handle_t handle, +cc_return_t CCAPI_Call_blfCallPickup(cc_call_handle_t handle, cc_sdp_direction_t video_pref, cc_string_t speed){ return CC_CallFeature_blfCallPickup(handle, video_pref, speed); } @@ -382,7 +347,7 @@ cc_return_t CCAPI_Call_sendInfo (cc_call_handle_t handle, cc_string_t infopackag cc_return_t CCAPI_Call_setAudioMute (cc_call_handle_t handle, cc_boolean val) { unsigned int session_id = ccpro_get_sessionId_by_callid(GET_CALL_ID(handle)); session_data_t * sess_data_p = (session_data_t *)findhash(session_id); - DEF_DEBUG(DEB_F_PREFIX": val=%d, handle=%d datap=%x", + DEF_DEBUG(DEB_F_PREFIX": val=%d, handle=%d datap=%x", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI_Call_setAudioMute"), val, handle, sess_data_p); if ( sess_data_p != NULL ) { sess_data_p->audio_mute = val; @@ -400,7 +365,7 @@ cc_return_t CCAPI_Call_setAudioMute (cc_call_handle_t handle, cc_boolean val) { cc_return_t CCAPI_Call_setVideoMute (cc_call_handle_t handle, cc_boolean val){ unsigned int session_id = ccpro_get_sessionId_by_callid(GET_CALL_ID(handle)); session_data_t * sess_data_p = (session_data_t *)findhash(session_id); - DEF_DEBUG(DEB_F_PREFIX": val=%d, handle=%d datap=%x", + DEF_DEBUG(DEB_F_PREFIX": val=%d, handle=%d datap=%x", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI_Call_setVideoMute"), val, handle, sess_data_p); if ( sess_data_p != NULL ) { sess_data_p->video_mute = val; diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_call_info.c b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_call_info.c index e26845ce06b0..20b379341031 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_call_info.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_call_info.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_stdio.h" #include "ccapi_call.h" @@ -55,8 +20,8 @@ cc_lineid_t CCAPI_CallInfo_getLine(cc_callinfo_ref_t handle) static const char *fname="CCAPI_CallInfo_getLine"; session_data_t *data = (session_data_t *)handle; CCAPP_DEBUG(DEB_F_PREFIX"Entering\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname)); - - if ( data != NULL){ + + if ( data != NULL){ CCAPP_DEBUG(DEB_F_PREFIX"returned %u\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), GET_LINE_ID(CREATE_CALL_HANDLE_FROM_SESSION_ID(data->sess_id))); return GET_LINE_ID(CREATE_CALL_HANDLE_FROM_SESSION_ID(data->sess_id)); } @@ -73,8 +38,8 @@ cc_call_state_t CCAPI_CallInfo_getCallState(cc_callinfo_ref_t handle){ static const char *fname="CCAPI_CallInfo_getCallState"; session_data_t *data = (session_data_t *)handle; CCAPP_DEBUG(DEB_F_PREFIX"Entering\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname)); - - if ( data != NULL){ + + if ( data != NULL){ CCAPP_DEBUG(DEB_F_PREFIX"returned %02X\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), data->state); return data->state; } @@ -119,7 +84,7 @@ cc_call_type_t CCAPI_CallInfo_getCallType(cc_callinfo_ref_t handle){ } /** - * get Called party name + * get Called party name * @param handle - call handle * @return called party name */ @@ -320,7 +285,7 @@ cc_string_t CCAPI_CallInfo_getPlacedCallPartyNumber(cc_callinfo_ref_t handle){ /** * get call instance number * @param handle - call handle - * @return + * @return */ cc_int32_t CCAPI_CallInfo_getCallInstance(cc_callinfo_ref_t handle){ static const char *fname="CCAPI_CallInfo_getCallInstance"; @@ -355,7 +320,7 @@ cc_string_t CCAPI_CallInfo_getStatus(cc_callinfo_ref_t handle){ } /** - * get call security + * get call security * @param handle - call handle * @return call security status */ @@ -580,7 +545,7 @@ cc_boolean CCAPI_CallInfo_getCapabilitySet(cc_callinfo_ref_t handle, cc_int32_t feat_set[feat_id] = data->allowed_features[feat_id]; CCAPP_DEBUG(DEB_F_PREFIX"feature id: %d , value %d\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname),feat_id, feat_set[feat_id]); } - + CCAPP_DEBUG(DEB_F_PREFIX"returned CC_SUCCESS\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname)); return CC_SUCCESS; } diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_config.c b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_config.c index cba2f117b39f..e54290119166 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_config.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_config.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "phone_debug.h" #include "CCProvider.h" @@ -56,7 +21,7 @@ extern cc_apply_config_result_t apply_config_result; cc_boolean parse_setup_properties (int device_handle, const char *device_name, const char *sipUser, const char *sipPassword, const char *sipDomain); /** - * + * * @return */ diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_device.c b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_device.c index 76ed12e565ed..79a919410f70 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_device.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_device.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_stdlib.h" #include "string_lib.h" @@ -53,7 +18,7 @@ #include "util_string.h" #include "ccapi_service.h" #include "ccapi_device_info.h" - + char g_new_signaling_ip[MAX_IPADDR_STR_LEN]; dock_undock_event_t g_dock_undock_event = MEDIA_INTERFACE_UPDATE_NOT_REQUIRED; @@ -63,19 +28,19 @@ extern void escalateDeescalate(); int signaling_interface_type; -/** +/** * Get device reference handle - * @return cc_deviceinfo_ref_t - reference handle of the device + * @return cc_deviceinfo_ref_t - reference handle of the device */ cc_device_handle_t CCAPI_Device_getDeviceID() { return CC_DEVICE_ID; } -/** +/** * Get device reference handle * @param handle - device handle - * @return cc_deviceinfo_ref_t - reference handle of the device + * @return cc_deviceinfo_ref_t - reference handle of the device */ cc_deviceinfo_ref_t CCAPI_Device_getDeviceInfo(cc_device_handle_t handle) { @@ -144,7 +109,7 @@ void CCAPI_Device_releaseDeviceInfo(cc_deviceinfo_ref_t ref){ * @param handle - device handle * @return cc_call_handle_t - handle of the call created */ -cc_call_handle_t CCAPI_Device_CreateCall(cc_device_handle_t handle) +cc_call_handle_t CCAPI_Device_CreateCall(cc_device_handle_t handle) { return CC_createCall(0); } @@ -177,7 +142,7 @@ void CCAPI_Device_enableCamera(cc_device_handle_t handle, cc_boolean enable) /** * CCAPI_Device_setDigestNamePasswd - * + * * @param handle - device handle * @param name - The Digest auth name * @param passwd - The password for that name for the line @@ -195,14 +160,14 @@ void CCAPI_Device_setDigestNamePasswd (cc_device_handle_t handle, } /** - * CCAPI_Device_IP_Update + * CCAPI_Device_IP_Update * * There is a change in the IP address and the values of new set * of signaling and media IP addresses are provided. * These value are compared with the current IP address values * and depending on what changed, restart and/or re-invite * action is taken. - * + * * The case being addressed. * 1) If the signaling IP change happens during a call, * the change is deferred till phone is idle. @@ -250,15 +215,15 @@ void CCAPI_Device_IP_Update (cc_device_handle_t handle, MAX_IPADDR_STR_LEN); DEF_DEBUG(DEB_F_PREFIX"New sig_ip=%s media_ip=%s Current: sig_ip: %s,"\ - "media_ip: %s \n", + "media_ip: %s \n", DEB_F_PREFIX_ARGS(CC_API, fname), signaling_ip, media_ip, - curr_signaling_ip, + curr_signaling_ip, curr_media_ip); /* - * If signaling and media IP are empty, stop the + * If signaling and media IP are empty, stop the * SIP service and return; */ if ((is_empty_str((char *)signaling_ip) || @@ -275,9 +240,9 @@ void CCAPI_Device_IP_Update (cc_device_handle_t handle, return; } } - + /* - * There is a change in the signaling IP, set the + * There is a change in the signaling IP, set the * new IP as the platform signaling IP and re-register */ if ((signaling_ip != NULL) && @@ -290,7 +255,7 @@ void CCAPI_Device_IP_Update (cc_device_handle_t handle, } /* - * There is a change in the media IP, set the + * There is a change in the media IP, set the * new IP as the platform media IP and post the call to GSM * to initiate re-inivite for all relevane calls */ @@ -311,7 +276,7 @@ void CCAPI_Device_IP_Update (cc_device_handle_t handle, /** * CCAPI_Device_setVideoAutoTxPreference - * + * * @param handle - device handle * @param txPref - TRUE=> auto Tx Video prefered * @return void diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_device_info.c b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_device_info.c index d0e13f24d0cf..c6671915b041 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_device_info.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_device_info.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "string_lib.h" #include "cc_constants.h" @@ -53,7 +18,7 @@ * gets the device name * @returns - a pointer to the device name */ -cc_deviceinfo_ref_t CCAPI_DeviceInfo_getDeviceHandle () +cc_deviceinfo_ref_t CCAPI_DeviceInfo_getDeviceHandle () { static const char *fname="CCAPI_DeviceInfo_getDeviceHandle"; CCAPP_DEBUG(DEB_F_PREFIX"Entering\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname)); @@ -65,7 +30,7 @@ cc_deviceinfo_ref_t CCAPI_DeviceInfo_getDeviceHandle () * gets the device name * @returns - a pointer to the device name */ -cc_string_t CCAPI_DeviceInfo_getDeviceName (cc_deviceinfo_ref_t handle) +cc_string_t CCAPI_DeviceInfo_getDeviceName (cc_deviceinfo_ref_t handle) { static const char *fname="CCAPI_DeviceInfo_getDeviceName"; cc_device_info_t *device = handle; @@ -81,10 +46,10 @@ cc_string_t CCAPI_DeviceInfo_getDeviceName (cc_deviceinfo_ref_t handle) /** * gets the device idle status - * @param [in] handle - reference to device info + * @param [in] handle - reference to device info * @returns boolean - idle status */ -cc_boolean CCAPI_DeviceInfo_isPhoneIdle(cc_deviceinfo_ref_t handle) +cc_boolean CCAPI_DeviceInfo_isPhoneIdle(cc_deviceinfo_ref_t handle) { static const char *fname="CCAPI_DeviceInfo_isPhoneIdle"; boolean ret = TRUE; @@ -105,7 +70,7 @@ cc_boolean CCAPI_DeviceInfo_isPhoneIdle(cc_deviceinfo_ref_t handle) CCAPP_DEBUG(DEB_F_PREFIX"idle state=%d session_id=0x%x call-state=%d handle=%x\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), ret, (session_data != NULL)? session_data->sess_id: 0, - (session_data != NULL)? session_data->state: 0, + (session_data != NULL)? session_data->state: 0, (handle)? handle:0); return ret; @@ -113,10 +78,10 @@ cc_boolean CCAPI_DeviceInfo_isPhoneIdle(cc_deviceinfo_ref_t handle) /** * gets the service state - * @param [in] handle - reference to device info - * @returns cc_service_state_t - INS/OOS + * @param [in] handle - reference to device info + * @returns cc_service_state_t - INS/OOS */ -cc_service_state_t CCAPI_DeviceInfo_getServiceState (cc_deviceinfo_ref_t handle) +cc_service_state_t CCAPI_DeviceInfo_getServiceState (cc_deviceinfo_ref_t handle) { static const char *fname="CCAPI_DeviceInfo_getServiceState"; cc_device_info_t *device = handle; @@ -132,10 +97,10 @@ cc_service_state_t CCAPI_DeviceInfo_getServiceState (cc_deviceinfo_ref_t handle) /** * gets the service cause - * @param [in] handle - reference to device info + * @param [in] handle - reference to device info * @returns cc_service_cause_t - reason for service state */ -cc_service_cause_t CCAPI_DeviceInfo_getServiceCause (cc_deviceinfo_ref_t handle) +cc_service_cause_t CCAPI_DeviceInfo_getServiceCause (cc_deviceinfo_ref_t handle) { static const char *fname="CCAPI_DeviceInfo_getServiceCause"; cc_device_info_t *device = handle; @@ -154,7 +119,7 @@ cc_service_cause_t CCAPI_DeviceInfo_getServiceCause (cc_deviceinfo_ref_t handle) * gets the cucm mode * @returns cc_cucm_mode_t - CUCM mode */ -cc_cucm_mode_t CCAPI_DeviceInfo_getCUCMMode (cc_deviceinfo_ref_t handle) +cc_cucm_mode_t CCAPI_DeviceInfo_getCUCMMode (cc_deviceinfo_ref_t handle) { static const char *fname="CCAPI_DeviceInfo_getCUCMMode"; cc_device_info_t *device = handle; @@ -173,16 +138,16 @@ cc_cucm_mode_t CCAPI_DeviceInfo_getCUCMMode (cc_deviceinfo_ref_t handle) * @param handle - device handle * @param handles - array of call handle to be returned * @param count[in/out] number allocated in array/elements returned - * @returns + * @returns */ -void CCAPI_DeviceInfo_getCalls (cc_deviceinfo_ref_t handle, cc_call_handle_t handles[], cc_uint16_t *count) +void CCAPI_DeviceInfo_getCalls (cc_deviceinfo_ref_t handle, cc_call_handle_t handles[], cc_uint16_t *count) { static const char *fname="CCAPI_DeviceInfo_getCalls"; hashItr_t itr; session_data_t *data; int i=0; CCAPP_DEBUG(DEB_F_PREFIX"Entering\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname)); - + hashItrInit(&itr); while ( (data = (session_data_t*)hashItrNext(&itr)) != NULL && i<*count ) { @@ -200,7 +165,7 @@ void CCAPI_DeviceInfo_getCalls (cc_deviceinfo_ref_t handle, cc_call_handle_t han * @param count[in/out] number allocated in array/elements returned * @returns */ -void CCAPI_DeviceInfo_getCallsByState (cc_deviceinfo_ref_t handle, cc_call_state_t state, +void CCAPI_DeviceInfo_getCallsByState (cc_deviceinfo_ref_t handle, cc_call_state_t state, cc_call_handle_t handles[], cc_uint16_t *count) { static const char *fname="CCAPI_DeviceInfo_getCallsByState"; @@ -224,9 +189,9 @@ void CCAPI_DeviceInfo_getCallsByState (cc_deviceinfo_ref_t handle, cc_call_state * gets list of handles to lines on the device * @param handles[in,out] - array of line handle to be returned * @param count[in/out] number allocated in array/elements returned - * @returns + * @returns */ -void CCAPI_DeviceInfo_getLines (cc_deviceinfo_ref_t handle, cc_lineid_t handles[], cc_uint16_t *count) +void CCAPI_DeviceInfo_getLines (cc_deviceinfo_ref_t handle, cc_lineid_t handles[], cc_uint16_t *count) { static const char *fname="CCAPI_DeviceInfo_getLines"; cc_line_info_t *line; @@ -272,9 +237,9 @@ void CCAPI_DeviceInfo_getFeatures (cc_deviceinfo_ref_t handle, cc_featureinfo_re * gets handles of call agent servers * @param handles - array of handles to call agent servers * @param count[in/out] number allocated in array/elements returned - * @returns + * @returns */ -void CCAPI_DeviceInfo_getCallServers (cc_deviceinfo_ref_t handle, cc_callserver_ref_t handles[], cc_uint16_t *count) +void CCAPI_DeviceInfo_getCallServers (cc_deviceinfo_ref_t handle, cc_callserver_ref_t handles[], cc_uint16_t *count) { static const char *fname="CCAPI_DeviceInfo_getCallServers"; int i, j=0; @@ -319,7 +284,7 @@ cc_cucm_mode_t CCAPI_DeviceInfo_getCallServerMode (cc_callserver_ref_t handle) cc_call_server_t *ref = (cc_call_server_t *) handle; CCAPP_DEBUG(DEB_F_PREFIX"Entering\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname)); - if (ref != NULL) { + if (ref != NULL) { CCAPP_DEBUG(DEB_F_PREFIX"returned %02X\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), ref->type); return ref->type; } @@ -335,14 +300,14 @@ cc_cucm_mode_t CCAPI_DeviceInfo_getCallServerMode (cc_callserver_ref_t handle) cc_ccm_status_t CCAPI_DeviceInfo_getCallServerStatus (cc_callserver_ref_t handle) { static const char *fname="CCAPI_DeviceInfo_getCallServerStatus"; - cc_call_server_t *ref = (cc_call_server_t *) handle; + cc_call_server_t *ref = (cc_call_server_t *) handle; CCAPP_DEBUG(DEB_F_PREFIX"Entering\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname)); - + if (ref != NULL) { CCAPP_DEBUG(DEB_F_PREFIX"returned %02X\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), (ref->status)); return ref->status; - } - + } + return CC_CCM_STATUS_NONE; } @@ -458,7 +423,7 @@ long long CCAPI_DeviceInfo_getRegTime (cc_deviceinfo_ref_t handle) * registered, then "0.0.0.0" is returned. * @return char IP address used to register phone. */ -cc_string_t CCAPI_DeviceInfo_getSignalingIPAddress(cc_deviceinfo_ref_t handle) +cc_string_t CCAPI_DeviceInfo_getSignalingIPAddress(cc_deviceinfo_ref_t handle) { static const char *fname="CCAPI_DeviceInfo_getSignalingIPAddress"; cpr_ip_addr_t ip_addr = {0,{0}}; @@ -491,7 +456,7 @@ cc_boolean CCAPI_DeviceInfo_isVideoCapEnabled(cc_deviceinfo_ref_t handle) { /** * gets the device mwi_lamp state - * @param [in] handle - reference to device info + * @param [in] handle - reference to device info * @returns boolean - mwi_lamp state */ cc_boolean CCAPI_DeviceInfo_getMWILampState(cc_deviceinfo_ref_t handle) diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_feature_info.c b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_feature_info.c index bfd820dbbeb3..cc40589d5b33 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_feature_info.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_feature_info.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "ccapi_snapshot.h" #include "sessionHash.h" diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_line.c b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_line.c index 1ff5a08bc2af..0931e11432af 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_line.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_line.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_stdlib.h" #include "string_lib.h" @@ -52,19 +17,19 @@ extern cc_line_info_t lineInfo[MAX_CONFIG_LINES+1]; cc_lineinfo_ref_t CCAPI_Line_getLineInfo(cc_uint32_t lineID) { cc_line_info_t *line_info = NULL; - int i; + int i; for (i=1;i<=MAX_CONFIG_LINES;i++) { if ( (cc_uint32_t)lineInfo[i].button == lineID ) { line_info = (cc_line_info_t*)cpr_malloc(sizeof(cc_line_info_t)); - + if (line_info) { *line_info = lineInfo[i]; line_info->ref_count = 1; line_info->name = strlib_copy(lineInfo[i].name); line_info->dn = strlib_copy(lineInfo[i].dn); line_info->cfwd_dest = strlib_copy(lineInfo[i].cfwd_dest); - line_info->externalNumber = + line_info->externalNumber = strlib_copy(lineInfo[i].externalNumber); } } diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_line_info.c b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_line_info.c index 059d6a3d17ee..dda2969e2706 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_line_info.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_line_info.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "ccapi_snapshot.h" #include "ccapi_line.h" @@ -54,7 +19,7 @@ cc_int32_t CCAPI_lineInfo_getID(cc_lineinfo_ref_t line) cc_line_info_t *info = (cc_line_info_t *) line; CCAPP_DEBUG(DEB_F_PREFIX"Entering\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname)); - + /* We will use button as line ID */ if ( info != NULL ) { CCAPP_DEBUG(DEB_F_PREFIX"returned %d\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), info->button); @@ -434,14 +399,14 @@ cc_boolean CCAPI_LineInfo_hasCapability (cc_lineinfo_ref_t line, cc_int32_t fea /** * get Allowed Feature set * @param [in] line - line reference handle - * @param [in,out] feat_set - array of len CC_CALL_CAP_MAX + * @param [in,out] feat_set - array of len CC_CALL_CAP_MAX * @return cc_return_t - CC_SUCCESS or CC_FAILURE */ cc_return_t CCAPI_LineInfo_getCapabilitySet (cc_lineinfo_ref_t line, cc_int32_t feat_set[]){ static const char *fname="CCAPI_LineInfo_getCapabilitySet"; cc_line_info_t *info = (cc_line_info_t *) line; int feat_id; - + CCAPP_DEBUG(DEB_F_PREFIX"Entering\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname)); if ( info != NULL){ @@ -449,7 +414,7 @@ cc_return_t CCAPI_LineInfo_getCapabilitySet (cc_lineinfo_ref_t line, cc_int32_t feat_set[feat_id] = info->allowed_features[feat_id]; CCAPP_DEBUG(DEB_F_PREFIX"feature id: %d , value %d\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname),feat_id, feat_set[feat_id]); } - + CCAPP_DEBUG(DEB_F_PREFIX"returned CC_SUCCESS\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname)); return CC_SUCCESS; } diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_service.c b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_service.c index dfa769a62b99..bd6cafe06636 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_service.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_service.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "ccapi_service.h" #include "cc_device_manager.h" @@ -62,7 +27,7 @@ char g_cfg_p[G_CFG_P_SIZE]; int g_compl_cfg; // Externs -extern void setState(); +extern void setState(); extern void resetReady(); extern void resetNotReady(); extern void ccpro_handleserviceControlNotify(); @@ -71,7 +36,7 @@ extern void ccpro_handleserviceControlNotify(); extern cc_srv_ctrl_cmd_t reset_type; boolean isServiceStartRequestPending = FALSE; cc_boolean is_action_to_be_deferred(cc_action_t action); -extern cc_action_t pending_action_type; +extern cc_action_t pending_action_type; //cc_boolean parse_config_properties (int device_handle, const char *device_name, const char *cfg, int from_memory); @@ -98,9 +63,9 @@ cc_return_t CCAPI_Service_create() { */ cc_return_t CCAPI_Service_destroy() { CCAPP_ERROR("CCAPI_Service_destroy - calling CC_Service_destroy \n"); - + // if (is_action_to_be_deferred(STOP_ACTION) == TRUE) { - // return CC_SUCCESS; + // return CC_SUCCESS; // } // initialize the config to empty init_empty_str(g_cfg_p); @@ -122,7 +87,7 @@ cc_return_t CCAPI_Service_start() { DEF_DEBUG("CCAPI_Service_start - \n"); isServiceStartRequestPending = TRUE; - + registration_processEvent(EV_CC_START); return (CC_SUCCESS); @@ -153,7 +118,7 @@ cc_return_t CCAPI_Service_stop() { /** * reregister the Sipcc stack service, without downloading the config file - * + * */ cc_return_t CCAPI_Service_reregister(int device_handle, const char *device_name, const char *cfg, @@ -162,16 +127,16 @@ cc_return_t CCAPI_Service_reregister(int device_handle, const char *device_name, CCAPP_ERROR("CCAPI_Service_reregister - initiate reregister \n"); if (is_action_to_be_deferred(RE_REGISTER_ACTION) == TRUE) { - return CC_SUCCESS; + return CC_SUCCESS; } if (pending_action_type != NO_ACTION) { CCAPP_ERROR("Reset/Restart is pending, reregister Ignored! \n"); return CC_FAILURE; } - + if (is_empty_str((char*)cfg)) { CCAPP_ERROR("Reregister request with empty config. Exiting.\n"); - return CC_FAILURE; + return CC_FAILURE; } g_dev_hdl = device_handle; @@ -181,17 +146,17 @@ cc_return_t CCAPI_Service_reregister(int device_handle, const char *device_name, g_compl_cfg = complete_config; registration_processEvent(EV_CC_RE_REGISTER); - + return (CC_SUCCESS); } /** - * Reset Manager has request a reset, send the current state and + * Reset Manager has request a reset, send the current state and * start sending updates. */ void CCAPI_Service_reset_request() { cc_deviceinfo_ref_t handle = 0; - sendResetUpdates = 1; + sendResetUpdates = 1; if (CCAPI_DeviceInfo_isPhoneIdle(handle) == TRUE) { resetReady(); } else { diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_snapshot.c b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_snapshot.c index 6ca2f33dbbeb..b2e15b44b07f 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_snapshot.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_snapshot.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "string.h" #include "string_lib.h" @@ -64,7 +29,7 @@ cc_string_t lineLabels[MAX_CONFIG_LINES+1] = {0}; void ccsnap_set_line_label(int btn, cc_string_t label) { - + CCAPP_ERROR(DEB_F_PREFIX"btn=%d label=%s\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "ccsnap_set_line_label"), btn, label); if ( btn > 0 && btn <= MAX_CONFIG_LINES+1 ) { if ( label == NULL ) { @@ -86,7 +51,7 @@ cc_string_t ccsnap_get_line_label(int btn) { /* * The below two functions are borrowed from CUCM/CUP as they both perform - * identical functions. That is, taking a DN 1555 and + * identical functions. That is, taking a DN 1555 and * a mask 919476XXXX to build a true external number 9194761555. */ static void stringInsert(char *string, int num, char ch) @@ -173,7 +138,7 @@ DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI_ApplyTranslationMask")); else translatedString[j++] = translationMask[i]; } - + translatedString[j] = 0; result = strlib_malloc(translatedString, strlen(translatedString)); return result; @@ -198,11 +163,11 @@ void ccsnap_line_pre_init () { if ((lineInfo[i].cfwd_dest) && (strlen(lineInfo[i].cfwd_dest) > 0)) { strlib_free(lineInfo[i].cfwd_dest); } - if ((lineInfo[i].externalNumber) && + if ((lineInfo[i].externalNumber) && (strlen(lineInfo[i].externalNumber) > 0)) { strlib_free(lineInfo[i].externalNumber); } - if ((featureInfo[i].speedDialNumber) && + if ((featureInfo[i].speedDialNumber) && (strlen(featureInfo[i].speedDialNumber) > 0)) { strlib_free(featureInfo[i].speedDialNumber); } @@ -212,7 +177,7 @@ void ccsnap_line_pre_init () { if ((featureInfo[i].name) && (strlen(featureInfo[i].name) > 0)) { strlib_free(featureInfo[i].name); } - if ((featureInfo[i].retrievalPrefix) && + if ((featureInfo[i].retrievalPrefix) && (strlen(featureInfo[i].retrievalPrefix) > 0)) { strlib_free(featureInfo[i].retrievalPrefix); } @@ -337,14 +302,14 @@ cc_line_info_t* ccsnap_getLineInfoFromBtn(int btnID) return NULL; } -cc_boolean allowedFeature(int fid){ +cc_boolean allowedFeature(int fid){ return TRUE; } cc_feature_info_t* ccsnap_getFeatureInfo(int featureIndex) { - if ( ( featureIndex<=MAX_CONFIG_LINES ) && - ( featureIndex>= 1 ) && + if ( ( featureIndex<=MAX_CONFIG_LINES ) && + ( featureIndex>= 1 ) && ( featureInfo[featureIndex].button == featureIndex ) ) { if ( allowedFeature(featureInfo[featureIndex].feature_id) ){ return &featureInfo[featureIndex]; @@ -370,7 +335,7 @@ void ccsnap_device_pre_init () { i = 0; while (i < CCAPI_MAX_SERVERS) { - if ((g_deviceInfo.ucm[i].name) && + if ((g_deviceInfo.ucm[i].name) && (strlen(g_deviceInfo.ucm[i].name) > 0)) { strlib_free(g_deviceInfo.ucm[i].name); } @@ -511,7 +476,7 @@ void ccsnap_update_ccm_status(cc_string_t addr, cc_ccm_status_t status) } } -void ccsnap_handle_mnc_reached (cc_line_info_t *line_info, cc_boolean mnc_reached, cc_cucm_mode_t mode) +void ccsnap_handle_mnc_reached (cc_line_info_t *line_info, cc_boolean mnc_reached, cc_cucm_mode_t mode) { cc_call_handle_t handles[MAX_CALLS]; int count = MAX_CALLS, i; diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_snapshot.h b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_snapshot.h index 1d8192b6981a..087513fea0ac 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_snapshot.h +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_snapshot.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCAPI_SNAPSHOT_H_ #define _CCAPI_SNAPSHOT_H_ @@ -58,7 +23,7 @@ typedef struct cc_mwi_info_t_ { /* * line reference data structure - */ + */ typedef struct cc_line_info_t_ { cc_uint32_t ref_count; cc_uint32_t line_id; @@ -133,7 +98,7 @@ void ccsnap_gen_deviceEvent(ccapi_device_event_e event, cc_device_handle_t handl void ccsnap_gen_lineEvent(ccapi_line_event_e event, cc_lineid_t handle); void ccsnap_gen_callEvent(ccapi_call_event_e event, cc_call_handle_t handle); void ccsnap_update_ccm_status(cc_string_t addr, cc_ccm_status_t status); -void ccsnap_handle_mnc_reached (cc_line_info_t *line_info, +void ccsnap_handle_mnc_reached (cc_line_info_t *line_info, cc_boolean mnc_reached, cc_cucm_mode_t mode); cc_feature_info_t* ccsnap_getFeatureInfo(int featureIndex); void ccsnap_gen_blfFeatureEvent(cc_blf_state_t state, int appId); diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapp_task.c b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapp_task.c index 90b9aa24692e..0920c1a35f65 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapp_task.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapp_task.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "ccapp_task.h" #include "phone.h" diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapp_task.h b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapp_task.h index 125151834cf9..e2792a3b0dcf 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapp_task.h +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapp_task.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "sll_lite.h" diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/ccprovider.c b/media/webrtc/signaling/src/sipcc/core/ccapp/ccprovider.c index 1f3ac7ac1c06..5046525720aa 100755 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/ccprovider.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/ccprovider.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include @@ -257,7 +222,7 @@ void ccpro_handleOOS() { cc_boolean is_action_to_be_deferred(cc_action_t action) { if (CCAPI_DeviceInfo_isPhoneIdle(CC_DEVICE_ID) == FALSE) { - pending_action_type = action; + pending_action_type = action; DEF_DEBUG("Action deferred=%d", action); return TRUE; } else { @@ -267,14 +232,14 @@ cc_boolean is_action_to_be_deferred(cc_action_t action) { void perform_deferred_action() { cc_action_t temp_action = pending_action_type; - + if (is_action_to_be_deferred(pending_action_type) == TRUE) { - return; + return; } pending_action_type = NO_ACTION; DEF_DEBUG("Perform deferred action=%d", temp_action); - + if (temp_action == RESET_ACTION || temp_action == RESTART_ACTION) { ccpro_handleserviceControlNotify(); } else if (temp_action == RE_REGISTER_ACTION) { @@ -293,7 +258,7 @@ void ccpro_handleserviceControlNotify() { } else if (reset_type == CC_DEVICE_RESTART) { temp_action = RESTART_ACTION; } - + if ((reset_type != CC_DEVICE_ICMP_UNREACHABLE) && is_action_to_be_deferred(temp_action) == TRUE) { return; @@ -307,7 +272,7 @@ void ccpro_handleserviceControlNotify() { } } -/** +/** * Returns the registration state */ cc_reg_state_t ccapp_get_state() { @@ -624,25 +589,25 @@ processSessionEvent (line_t line_id, callid_t call_id, unsigned int event, sdp_d dp_int_update_keypress(line_id, call_id, BKSP_KEY); break; case CC_FEATURE_CREATEOFFER: - cc_createoffer (CC_SRC_UI, CC_SRC_GSM, call_id, (line_t)instance, CC_FEATURE_CREATEOFFER, &featdata); + cc_createoffer (CC_SRC_UI, CC_SRC_GSM, call_id, (line_t)instance, CC_FEATURE_CREATEOFFER, &featdata); break; case CC_FEATURE_CREATEANSWER: - cc_createanswer (CC_SRC_UI, CC_SRC_GSM, call_id, (line_t)instance, CC_FEATURE_CREATEANSWER, data, &featdata); - break; + cc_createanswer (CC_SRC_UI, CC_SRC_GSM, call_id, (line_t)instance, CC_FEATURE_CREATEANSWER, data, &featdata); + break; case CC_FEATURE_SETLOCALDESC: cc_setlocaldesc (CC_SRC_UI, CC_SRC_GSM, call_id, (line_t)instance, CC_FEATURE_SETLOCALDESC, ccData.action, data, &featdata); break; case CC_FEATURE_SETREMOTEDESC: cc_setremotedesc (CC_SRC_UI, CC_SRC_GSM, call_id, (line_t)instance, CC_FEATURE_SETREMOTEDESC, ccData.action, data, &featdata); - break; + break; case CC_FEATURE_SETPEERCONNECTION: PR_ASSERT(strlen(data) < PC_HANDLE_SIZE); if (strlen(data) >= PC_HANDLE_SIZE) return; - + sstrncpy(featdata.pc.pc_handle, data, sizeof(featdata.pc.pc_handle)); - cc_int_feature2(CC_MSG_SETPEERCONNECTION, CC_SRC_UI, CC_SRC_GSM, + cc_int_feature2(CC_MSG_SETPEERCONNECTION, CC_SRC_UI, CC_SRC_GSM, call_id, (line_t)instance, CC_FEATURE_SETPEERCONNECTION, &featdata); break; @@ -858,7 +823,7 @@ processSessionEvent (line_t line_id, callid_t call_id, unsigned int event, sdp_d // for CUCM mode we will translate CONF to B2BCONF if ( gCCApp.mode == CC_MODE_CCM ) { if ( gCCApp.mode == CC_MODE_CCM && platGetFeatureAllowed(CC_SIS_B2B_CONF) ) { - //CUCME can't support B2BCONF currently. + //CUCME can't support B2BCONF currently. event = CC_FEATURE_B2BCONF; } }// DON'T ADD BREAK HERE. EVENT IS PASSED BELOW @@ -998,7 +963,7 @@ session_data_t * getDeepCopyOfSessionData(session_data_t *data) if ( newData != NULL ) { memset(newData, 0, sizeof(session_data_t)); - + if ( data != NULL ) { *newData = *data; newData->ref_count = 1; @@ -1297,7 +1262,7 @@ static boolean ccappCldNumIsCfwdallString(string_t cld_number) { return ((int) FALSE); } -/** +/** * Api to update mute state of connected call */ cc_call_handle_t ccappGetConnectedCall(){ @@ -1375,7 +1340,7 @@ static void ccappUpdateSessionData (session_update_t *sessUpd) data->state = call_state; data->line = sessUpd->update.ccSessionUpd.data.state_data.line_id; if (sessUpd->eventID == CALL_NEWCALL || sessUpd->eventID == CREATE_OFFER || - sessUpd->eventID == CREATE_ANSWER || sessUpd->eventID == SET_LOCAL_DESC || + sessUpd->eventID == CREATE_ANSWER || sessUpd->eventID == SET_LOCAL_DESC || sessUpd->eventID == SET_REMOTE_DESC || sessUpd->eventID == REMOTE_STREAM_ADD ) { data->attr = sessUpd->update.ccSessionUpd.data.state_data.attr; data->inst = sessUpd->update.ccSessionUpd.data.state_data.inst; @@ -1397,8 +1362,8 @@ static void ccappUpdateSessionData (session_update_t *sessUpd) data->vid_dir = SDP_DIRECTION_INACTIVE; data->callref = 0; calllogger_init_call_log(&data->call_log); - - if ( sessUpd->eventID == CREATE_OFFER || sessUpd->eventID == CREATE_ANSWER + + if ( sessUpd->eventID == CREATE_OFFER || sessUpd->eventID == CREATE_ANSWER || sessUpd->eventID == SET_LOCAL_DESC || sessUpd->eventID == SET_REMOTE_DESC || sessUpd->eventID == REMOTE_STREAM_ADD) { data->sdp = sessUpd->update.ccSessionUpd.data.state_data.sdp; @@ -1406,11 +1371,11 @@ static void ccappUpdateSessionData (session_update_t *sessUpd) data->media_stream_track_id = sessUpd->update.ccSessionUpd.data.state_data.media_stream_track_id; data->media_stream_id = sessUpd->update.ccSessionUpd.data.state_data.media_stream_id; } - + /* * If phone was idle, we not going to active state * send notification to resetmanager that we - * are no longer resetReady. + * are no longer resetReady. */ if ((CCAPI_DeviceInfo_isPhoneIdle(handle) == TRUE) && (sendResetUpdates)) { resetNotReady(); @@ -1485,9 +1450,9 @@ static void ccappUpdateSessionData (session_update_t *sessUpd) proceedWithFOFB(); } if ((CCAPI_DeviceInfo_isPhoneIdle(handle) == TRUE) && (sendResetUpdates)) { - resetReady(); + resetReady(); } - if (pending_action_type != NO_ACTION) { + if (pending_action_type != NO_ACTION) { perform_deferred_action(); } break; @@ -1499,7 +1464,7 @@ static void ccappUpdateSessionData (session_update_t *sessUpd) data->attr, sessUpd->update.ccSessionUpd.data.state_data.cause, data->inst); - if ( sessUpd->update.ccSessionUpd.data.state_data.state == HOLD && + if ( sessUpd->update.ccSessionUpd.data.state_data.state == HOLD && (data->state == REMHOLD || data->state == REMINUSE)){ data->state = REMHOLD; } else { @@ -1545,7 +1510,7 @@ static void ccappUpdateSessionData (session_update_t *sessUpd) if ((CCAPI_DeviceInfo_isPhoneIdle(handle) == TRUE) && (sendResetUpdates)) { resetReady(); } - if (pending_action_type != NO_ACTION) { + if (pending_action_type != NO_ACTION) { perform_deferred_action(); } } @@ -1579,7 +1544,7 @@ static void ccappUpdateSessionData (session_update_t *sessUpd) case CALL_INFORMATION: // check conference state, if it changes, we'll send a conference event notification previouslyInConference = CCAPI_CallInfo_getIsConference(data); - + data->clg_name = ccsnap_EscapeStrToLocaleStr(data->clg_name, sessUpd->update.ccSessionUpd.data.call_info.clgName, LEN_UNKNOWN); data->cld_name = ccsnap_EscapeStrToLocaleStr(data->cld_name, sessUpd->update.ccSessionUpd.data.call_info.cldName, LEN_UNKNOWN); data->orig_called_name = ccsnap_EscapeStrToLocaleStr(data->orig_called_name, sessUpd->update.ccSessionUpd.data.call_info.origCalledName, LEN_UNKNOWN); @@ -1604,16 +1569,16 @@ static void ccappUpdateSessionData (session_update_t *sessUpd) * dictionaries might not be equivalent. */ calllogger_update(data); - + ccsnap_gen_callEvent(CCAPI_CALL_EV_CALLINFO, CREATE_CALL_HANDLE_FROM_SESSION_ID(sessUpd->sessionID)); - + // if we're entering a conference, then indicate conference participant info (in case the info came earlier, app - // will receive the notification now. If info comes later, then app will receive an additional subsequent info notice + // will receive the notification now. If info comes later, then app will receive an additional subsequent info notice // at that time. if ((!previouslyInConference) && (CCAPI_CallInfo_getIsConference(data))) { ccsnap_gen_callEvent(CCAPI_CALL_EV_CONF_PARTICIPANT_INFO, CREATE_CALL_HANDLE_FROM_SESSION_ID(sessUpd->sessionID)); } - + break; case CALL_PLACED_INFO: @@ -1649,7 +1614,7 @@ static void ccappUpdateSessionData (session_update_t *sessUpd) if (data->status != NULL) { if(strncmp(data->status, UNKNOWN_PHRASE_STR, UNKNOWN_PHRASE_STR_SIZE) == 0){ data->status = strlib_empty(); - } + } if(strcmp(data->status, strlib_empty()) != 0){ ccsnap_gen_callEvent(CCAPI_CALL_EV_STATUS, CREATE_CALL_HANDLE_FROM_SESSION_ID(sessUpd->sessionID)); } @@ -1713,20 +1678,20 @@ static void ccappUpdateSessionData (session_update_t *sessUpd) //Should not come here. It's dealed in CCAPP_RCVD_INFO. break; case MEDIA_INTERFACE_UPDATE_BEGIN: - ccsnap_gen_callEvent(CCAPI_CALL_EV_MEDIA_INTERFACE_UPDATE_BEGIN, + ccsnap_gen_callEvent(CCAPI_CALL_EV_MEDIA_INTERFACE_UPDATE_BEGIN, CREATE_CALL_HANDLE_FROM_SESSION_ID(sessUpd->sessionID)); break; case MEDIA_INTERFACE_UPDATE_SUCCESSFUL: - ccsnap_gen_callEvent(CCAPI_CALL_EV_MEDIA_INTERFACE_UPDATE_SUCCESSFUL, + ccsnap_gen_callEvent(CCAPI_CALL_EV_MEDIA_INTERFACE_UPDATE_SUCCESSFUL, CREATE_CALL_HANDLE_FROM_SESSION_ID(sessUpd->sessionID)); break; case MEDIA_INTERFACE_UPDATE_FAIL: - ccsnap_gen_callEvent(CCAPI_CALL_EV_MEDIA_INTERFACE_UPDATE_FAIL, + ccsnap_gen_callEvent(CCAPI_CALL_EV_MEDIA_INTERFACE_UPDATE_FAIL, CREATE_CALL_HANDLE_FROM_SESSION_ID(sessUpd->sessionID)); break; case CREATE_OFFER: case CREATE_ANSWER: - case SET_LOCAL_DESC: + case SET_LOCAL_DESC: case SET_REMOTE_DESC: case REMOTE_STREAM_ADD: data->sdp = sessUpd->update.ccSessionUpd.data.state_data.sdp; @@ -1987,15 +1952,15 @@ void ccp_handler(void* msg, int type) { data->info_body = rcvdInfo->info.generic_raw.message_body; ccsnap_gen_callEvent(CCAPI_CALL_EV_RECEIVED_INFO, CREATE_CALL_HANDLE_FROM_SESSION_ID(rcvdInfo->sessionID)); - + // most of the time isConference will be true at this point, we can notify the app of // the updated participant info. However, if we're transitioning from non conference into - // conference, then we'll delay this notification until we're fully in conference state + // conference, then we'll delay this notification until we're fully in conference state if (CCAPI_CallInfo_getIsConference(data)) - { // in conference - send the info + { // in conference - send the info ccsnap_gen_callEvent(CCAPI_CALL_EV_CONF_PARTICIPANT_INFO, CREATE_CALL_HANDLE_FROM_SESSION_ID(rcvdInfo->sessionID)); } - + // one shot notify cleanup after event generation data->info_package = strlib_empty(); data->info_type = strlib_empty(); @@ -2175,7 +2140,7 @@ void ccappSyncSessionMgmt(session_mgmt_t *sessMgmt) case SESSION_MGMT_SET_TIME: g_deviceInfo.reg_time = sessMgmt->data.time.gmt_time; CCAPP_DEBUG(DEB_F_PREFIX"Setting reg_time to == %lld\n", - DEB_F_PREFIX_ARGS(SIP_CC_PROV, + DEB_F_PREFIX_ARGS(SIP_CC_PROV, "ccappSyncSessionMgmt"), g_deviceInfo.reg_time); platSetCucmRegTime(); break; @@ -2206,8 +2171,8 @@ void ccappSyncSessionMgmt(session_mgmt_t *sessMgmt) case SESSION_MGMT_APPLY_CONFIG: // save the proposed versions of fcp and dialplan to apply. Will check against // current versions and redownload if necessary - - if (pending_action_type == NO_ACTION) { + + if (pending_action_type == NO_ACTION) { configApplyConfigNotify(sessMgmt->data.config.config_version_stamp, sessMgmt->data.config.dialplan_version_stamp, sessMgmt->data.config.fcp_version_stamp, diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/conf_roster.c b/media/webrtc/signaling/src/sipcc/core/ccapp/conf_roster.c index 4407b7538017..2cb1f268d9f2 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/conf_roster.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/conf_roster.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include "sll_lite.h" @@ -89,12 +54,12 @@ convertStringToParticipantSecurity(const char *data) void conf_roster_init_call_conference (cc_call_conference_Info_t *info) { CCAPP_DEBUG(DEB_F_PREFIX"in init_call_conference \n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI-CONFPARSE")); - + info->participantMax = 0; info->participantCount = 0; info->myParticipantId = strlib_empty(); - - sll_lite_init(&info->currentParticipantsList); + + sll_lite_init(&info->currentParticipantsList); } void conf_roster_free_call_conference (cc_call_conference_Info_t *confInfo) @@ -104,17 +69,17 @@ void conf_roster_free_call_conference (cc_call_conference_Info_t *confInfo) CCAPP_DEBUG(DEB_F_PREFIX"in free_call_confrerence \n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI-CONFPARSE")); while((participant=(cc_call_conferenceParticipant_Info_t *) - sll_lite_unlink_head(&confInfo->currentParticipantsList)) != NULL) + sll_lite_unlink_head(&confInfo->currentParticipantsList)) != NULL) { strlib_free(participant->participantName); strlib_free(participant->endpointUri); strlib_free(participant->callid); strlib_free(participant->participantNumber); - - participant->participantSecurity = CC_SECURITY_NONE; + + participant->participantSecurity = CC_SECURITY_NONE; participant->participantStatus = CCAPI_CONFPARTICIPANT_UNKNOWN; participant->canRemoveOtherParticipants = FALSE; - + cpr_free(participant); participant = NULL; } @@ -142,7 +107,7 @@ void conf_roster_copy_call_conferance (cc_call_conference_Info_t *dest, cc_call_ while (iterator) { srcParticipant = (cc_call_conferenceParticipant_Info_t *)iterator; - destParticipant = cpr_malloc(sizeof(cc_call_conferenceParticipant_Info_t)); + destParticipant = cpr_malloc(sizeof(cc_call_conferenceParticipant_Info_t)); if (destParticipant == NULL) { CCAPP_ERROR(DEB_F_PREFIX" Malloc failure for participant\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI-CONFPARSE")); return; @@ -150,10 +115,10 @@ void conf_roster_copy_call_conferance (cc_call_conference_Info_t *dest, cc_call_ destParticipant->participantName = strlib_copy(srcParticipant->participantName); destParticipant->endpointUri = strlib_copy(srcParticipant->endpointUri); destParticipant->callid = strlib_copy(srcParticipant->callid); - + destParticipant->participantNumber = strlib_copy(srcParticipant->participantNumber); - destParticipant->participantSecurity = srcParticipant->participantSecurity; - destParticipant->participantStatus = srcParticipant->participantStatus; + destParticipant->participantSecurity = srcParticipant->participantSecurity; + destParticipant->participantStatus = srcParticipant->participantStatus; destParticipant->canRemoveOtherParticipants = srcParticipant->canRemoveOtherParticipants; } @@ -165,7 +130,7 @@ void conf_roster_copy_call_conferance (cc_call_conference_Info_t *dest, cc_call_ } iterator = iterator->next_p; - } + } } // ------------------- @@ -180,7 +145,7 @@ void conf_roster_copy_call_conferance (cc_call_conference_Info_t *dest, cc_call_ * @return void */ void CCAPI_CallInfo_getConfParticipants (cc_callinfo_ref_t handle, cc_participant_ref_t participantHandles[], int* count) -{ +{ cc_call_conference_ref_t callConference = NULL; // conference reference (from call info) cc_call_conference_participant_ref_t participant = NULL; // participant reference cc_uint16_t participantIndex = 0; // participant index @@ -200,9 +165,9 @@ void CCAPI_CallInfo_getConfParticipants (cc_callinfo_ref_t handle, cc_participan nodeCount = SLL_LITE_NODE_COUNT(&(callConference->currentParticipantsList)); CCAPP_DEBUG(DEB_F_PREFIX"SLL NODE COUNT = [%d]\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI-CONF"), nodeCount); if (nodeCount <= 0) - { + { *count = 0; - return; + return; } participant = (cc_call_conference_participant_ref_t)SLL_LITE_LINK_HEAD(&callConference->currentParticipantsList); @@ -211,12 +176,12 @@ void CCAPI_CallInfo_getConfParticipants (cc_callinfo_ref_t handle, cc_participan if (participantIndex >= *count) { CCAPP_ERROR(DEB_F_PREFIX"Not Enough Room Provided To List All Participants. Listed [%d] of [%d]\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI-CONF"), count, nodeCount); - return; + return; } - + // add this participant to our list of particpiants participantHandles[participantIndex] = (participant->callid); - + // step to the next stored participant in the list participant = (cc_call_conference_participant_ref_t)SLL_LITE_LINK_NEXT_NODE(participant); participantIndex++; @@ -230,7 +195,7 @@ void CCAPI_CallInfo_getConfParticipants (cc_callinfo_ref_t handle, cc_participan *count = 0; return; } - + // return number of participants *count = nodeCount; return; @@ -242,7 +207,7 @@ void CCAPI_CallInfo_getConfParticipants (cc_callinfo_ref_t handle, cc_participan * @return maximum number of conference participants */ cc_uint16_t CCAPI_CallInfo_getConfParticipantMax (cc_callinfo_ref_t handle) -{ // +{ // cc_call_conference_ref_t callConference; // conference reference (from call info) CCAPP_DEBUG(DEB_F_PREFIX"Entering: CCAPI_CallInfo_getConfParticipantMax\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI-CONF")); @@ -267,11 +232,11 @@ cc_uint16_t CCAPI_CallInfo_getConfParticipantMax (cc_callinfo_ref_t handle) * @return display name of the conference participant */ cc_string_t CCAPI_CallInfo_getConfParticipantName (cc_callinfo_ref_t handle, cc_participant_ref_t participantHandle) -{ +{ cc_call_conference_participant_ref_t participant = getConferenceParticipantRef (handle, participantHandle); if (participant == NULL) { - return strlib_empty(); + return strlib_empty(); } return (participant->participantName); @@ -284,7 +249,7 @@ cc_string_t CCAPI_CallInfo_getConfParticipantName (cc_callinfo_ref_t handle, cc_ * @return display number of the conference participant */ cc_string_t CCAPI_CallInfo_getConfParticipantNumber (cc_callinfo_ref_t handle, cc_participant_ref_t participantHandle) -{ +{ cc_call_conference_participant_ref_t participant = getConferenceParticipantRef (handle, participantHandle); if (participant == NULL) { @@ -298,7 +263,7 @@ cc_string_t CCAPI_CallInfo_getConfParticipantNumber (cc_callinfo_ref_t handle, c * Get Conference Participant Status * @param [in] handle - call handle * @param [in] participantHandle - handle of conference participant -* @return conference participant status +* @return conference participant status */ cc_conf_participant_status_t CCAPI_CallInfo_getConfParticipantStatus (cc_callinfo_ref_t handle, cc_participant_ref_t participantHandle) { @@ -318,38 +283,38 @@ cc_conf_participant_status_t CCAPI_CallInfo_getConfParticipantStatus (cc_callinf * @return security setting of the specific conference participant */ cc_call_security_t CCAPI_CallInfo_getConfParticipantSecurity (cc_callinfo_ref_t handle, cc_participant_ref_t participantHandle) -{ +{ cc_call_conference_participant_ref_t participant = getConferenceParticipantRef (handle, participantHandle); if (participant == NULL) { return (CC_SECURITY_NONE); } - return (participant->participantSecurity); + return (participant->participantSecurity); } /** */ cc_boolean CCAPI_CallInfo_isConfSelfParticipant (cc_callinfo_ref_t handle, cc_participant_ref_t participantHandle) -{ +{ cc_call_conference_ref_t callConference; // conference reference (from call info) // get conference reference from the call info callConference = getCallConferenceRef(handle); if (callConference == NULL) { - // error - log + // error - log CCAPP_ERROR(DEB_F_PREFIX"Unable to get conference reference\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI-CONF")); return (FALSE); } - + return (strcmp((callConference->myParticipantId), participantHandle) == 0); } /** */ cc_participant_ref_t CCAPI_CallInfo_getConfSelfParticipant (cc_callinfo_ref_t handle) -{ +{ cc_call_conference_ref_t callConference; // conference reference (from call info) // get conference reference from the call info @@ -360,7 +325,7 @@ cc_participant_ref_t CCAPI_CallInfo_getConfSelfParticipant (cc_callinfo_ref_t ha CCAPP_ERROR(DEB_F_PREFIX"Unable to get conference reference\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI-CONF")); return strlib_empty(); } - + return (callConference->myParticipantId); } @@ -384,7 +349,7 @@ cc_call_conference_ref_t getCallConferenceRef(cc_callinfo_ref_t handle) { return (NULL); } - + return (&data->call_conference); } @@ -394,7 +359,7 @@ cc_call_conference_ref_t getCallConferenceRef(cc_callinfo_ref_t handle) cc_call_conference_participant_ref_t getConferenceParticipantRef(cc_callinfo_ref_t handle, cc_participant_ref_t participantHandle) { cc_call_conference_ref_t callConference; // conference reference (from call info) - cc_call_conference_participant_ref_t participant; + cc_call_conference_participant_ref_t participant; // get conference reference from the call info callConference = getCallConferenceRef(handle); @@ -420,14 +385,14 @@ cc_call_conference_participant_ref_t getConferenceParticipantRef(cc_callinfo_ref participant = (cc_call_conference_participant_ref_t)SLL_LITE_LINK_HEAD(&callConference->currentParticipantsList); while (participant != NULL) - { + { // see if we've found the participant we're looking for if (strcmp(participant->callid, participantHandle) == 0) { return (participant); } - // no match so far, so look at the next item in the list... + // no match so far, so look at the next item in the list... participant = (cc_call_conference_participant_ref_t)SLL_LITE_LINK_NEXT_NODE(participant); } diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/conf_roster.h b/media/webrtc/signaling/src/sipcc/core/ccapp/conf_roster.h index b3baf0ecadfc..4eda1bca14cf 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/conf_roster.h +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/conf_roster.h @@ -1,48 +1,13 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef __CONFROSTER_H__ #define __CONFROSTER_H__ #include "sll_lite.h" #include "cpr_string.h" -#include "cc_constants.h" +#include "cc_constants.h" #include "cpr_stdio.h" #include "ccapi_conf_roster.h" @@ -52,8 +17,8 @@ typedef struct cc_call_conferenceParticipant_Info_t_ { cc_participant_ref_t callid; string_t participantName; string_t participantNumber; - cc_conf_participant_status_t participantStatus; - cc_call_security_t participantSecurity; + cc_conf_participant_status_t participantStatus; + cc_call_security_t participantSecurity; string_t endpointUri; cc_boolean canRemoveOtherParticipants; } cc_call_conferenceParticipant_Info_t; @@ -66,7 +31,7 @@ typedef struct cc_call_conference_Info_t_ { int32_t participantMax; int32_t participantCount; cc_participant_ref_t myParticipantId; - sll_lite_list_t currentParticipantsList; + sll_lite_list_t currentParticipantsList; } cc_call_conference_Info_t; // reference to above structure diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/sessionHash.c b/media/webrtc/signaling/src/sipcc/core/ccapp/sessionHash.c index 712e4302f49d..972a5cd38513 100755 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/sessionHash.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/sessionHash.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifdef UNIT_TEST #define cpr_malloc malloc @@ -45,13 +10,13 @@ #include "cpr_stdlib.h" #endif -#include "sessionHash.h" +#include "sessionHash.h" #define HASHBUCKETS 67 hash_table_t *hashtable[HASHBUCKETS]={0}; -void hashItrInit(hashItr_t *itr) +void hashItrInit(hashItr_t *itr) { itr->bucket = 0; itr->node = NULL; @@ -65,8 +30,8 @@ void * hashItrNext(hashItr_t *itr) if ( itr->node->next != NULL ) { itr->node = itr->node->next; return itr->node->data; - } - // We just iterated to the end of the list. + } + // We just iterated to the end of the list. // Increment the bucket to search next itr->bucket++; } @@ -83,14 +48,14 @@ void * hashItrNext(hashItr_t *itr) /** - * sessionHash + * sessionHash * function to add generate hash given the key - * - * @param key - * - * @return the hash index + * @param key - + * + * @return the hash index */ -unsigned int sessionHash (unsigned int key) +unsigned int sessionHash (unsigned int key) { // since the key is session_id create the hashval to be line_id + call_id unsigned int hashval = key + ((key & 0xFFFF0000)>>16); @@ -99,16 +64,16 @@ unsigned int sessionHash (unsigned int key) } /** - * addhash + * addhash * function to add data for a given key in the table - * - * @param key - * @param data - pointer to data stored + * + * @param key + * @param data - pointer to data stored * * @return - 0 for success */ -int addhash (unsigned int key, void *data) +int addhash (unsigned int key, void *data) { hash_table_t *newhash; hash_table_t *cur_hash; @@ -139,7 +104,7 @@ int addhash (unsigned int key, void *data) newhash->next = NULL; newhash->prev = cur_hash; } - + return 0; } @@ -155,7 +120,7 @@ unsigned int ccpro_get_sessionId_by_callid(unsigned short call_id) { for ( i=0; ikey & 0xffff) == call_id ) { return cur_hash->key; } @@ -175,16 +140,16 @@ unsigned int ccpro_get_sessionId_by_callid(unsigned short call_id) { * @return the data ptr or NULL */ -void *findhash(unsigned int key) +void *findhash(unsigned int key) { unsigned int hashval; hash_table_t *cur_hash; - + hashval = 0; hashval = sessionHash(key); - + cur_hash = hashtable[hashval]; while ( cur_hash != NULL ) { if ( cur_hash->key == key) { @@ -205,20 +170,20 @@ void *findhash(unsigned int key) * @return - 0 for success */ -int delhash(unsigned int key) +int delhash(unsigned int key) { unsigned int hashval; hash_table_t *cur_hash; - + hashval = 0; hashval = sessionHash(key); - + if (hashtable[hashval] == NULL) { return -1; } - + if (hashtable[hashval]->key == key) { cur_hash = hashtable[hashval]; hashtable[hashval] = cur_hash->next; @@ -226,7 +191,7 @@ int delhash(unsigned int key) hashtable[hashval]->prev = NULL; } cpr_free(cur_hash); - return 0; + return 0; } else { @@ -239,7 +204,7 @@ int delhash(unsigned int key) cur_hash->next->prev = cur_hash->prev; } cpr_free(cur_hash); - return 0; + return 0; } cur_hash = cur_hash->next; } @@ -249,16 +214,16 @@ int delhash(unsigned int key) #ifdef UNIT_TEST -void hashstats(int detail) +void hashstats(int detail) { static const char *fname="hashstats"; int max, total, i, nodes, used; double avg; hash_table_t *cur_hash; - + max = total = i = nodes = used = 0; avg = 0; - + if (detail > 0) { for (i = 0; i < HASHBUCKETS; i++) { if (hashtable[i] != NULL) { @@ -268,18 +233,18 @@ void hashstats(int detail) while(cur_hash != NULL) { nodes++; if (detail > 3) { - CCAPPDEBUG(DEB_F_PREFIX"%lx -> %lx: (%lx) (%lx) -> %lx\n", + CCAPPDEBUG(DEB_F_PREFIX"%lx -> %lx: (%lx) (%lx) -> %lx\n", DEB_F_PREFIX_ARGS(SIP_SES_HASH, fname), cur_hash->prev, cur_hash, cur_hash->key, cur_hash->data, cur_hash->next); } - cur_hash = cur_hash->next; + cur_hash = cur_hash->next; } - if (nodes != 0) total += nodes; + if (nodes != 0) total += nodes; if (nodes > max) { max = nodes; } if (detail > 1) { - CCAPPDEBUG(DEB_F_PREFIX"i: %d\n", DEB_F_PREFIX_ARGS(SIP_SES_HASH, fname), i); + CCAPPDEBUG(DEB_F_PREFIX"i: %d\n", DEB_F_PREFIX_ARGS(SIP_SES_HASH, fname), i); } } } diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/sessionHash.h b/media/webrtc/signaling/src/sipcc/core/ccapp/sessionHash.h index 4b85fae3ac7c..4722bb4de51e 100755 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/sessionHash.h +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/sessionHash.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ typedef struct hash_table { struct hash_table *next; diff --git a/media/webrtc/signaling/src/sipcc/core/common/cfgfile_utils.c b/media/webrtc/signaling/src/sipcc/core/common/cfgfile_utils.c index 9a629483d6cc..a31f80235be6 100755 --- a/media/webrtc/signaling/src/sipcc/core/common/cfgfile_utils.c +++ b/media/webrtc/signaling/src/sipcc/core/common/cfgfile_utils.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdio.h" @@ -49,8 +14,8 @@ #include #include "util_string.h" -#define IN6ADDRSZ 16 -#define INT16SZ 2 +#define IN6ADDRSZ 16 +#define INT16SZ 2 #define INADDRSZ 4 #define IS_DIGIT(ch) ((ch >= '0') && (ch <= '9')) @@ -109,7 +74,7 @@ str2ip (const char *str, cpr_ip_addr_t *cpr_addr) num = 0; digit_flag = 0; continue; - } + } /* if get here invalid dotted IP character or missing digit */ return (1); @@ -155,15 +120,15 @@ cfgfile_parse_ip (const var_t *entry, const char *value) */ int cfgfile_print_ip (const var_t *entry, char *buf, int len) -{ +{ // RT phones receive the IP address in this order: 0xf8332ca1 = 161.44.51.248 cpr_ip_addr_t *cprIpAddrPtr = (cpr_ip_addr_t *)entry->addr; - + if (cprIpAddrPtr->type == CPR_IP_ADDR_IPV4) { sprint_ip(buf, cprIpAddrPtr->u.ip4); return 1; } - + return 0; } @@ -389,7 +354,7 @@ cfgfile_print_mac (const var_t *entry, char *buf, int len) * keyword there is an associated enum value (key value). * search the keyword table for a matching keyword, and if found * save the entire key etnry into the table. - * + * * @param[in] entry - pointer ot var_t. * @param[in] value - pointer to const. string of configuration value. * @@ -426,7 +391,7 @@ cfgfile_parse_key_entry (const var_t *entry, const char *value) /** * print (format) a key value. Print the name of the key out. - * + * * @param[in] entry - pointer ot var_t. * @param[in] value - pointer to const. string of configuration value. * @@ -435,7 +400,7 @@ cfgfile_parse_key_entry (const var_t *entry, const char *value) * @pre (entry != NULL) * @pre (value != NULL) */ -int +int cfgfile_print_key_entry (const var_t *entry, char *buf, int len) { key_table_entry_t *key; @@ -444,7 +409,7 @@ cfgfile_print_key_entry (const var_t *entry, char *buf, int len) if (key->name != NULL) { return (snprintf(buf, len, "%s", key->name)); } else { - /* the entry is not even configured */ + /* the entry is not even configured */ return (0); } } diff --git a/media/webrtc/signaling/src/sipcc/core/common/cfgfile_utils.h b/media/webrtc/signaling/src/sipcc/core/common/cfgfile_utils.h index 1e12f9d70c7c..63e5465326af 100755 --- a/media/webrtc/signaling/src/sipcc/core/common/cfgfile_utils.h +++ b/media/webrtc/signaling/src/sipcc/core/common/cfgfile_utils.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CFGFILE_UTILS_H_ #define _CFGFILE_UTILS_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/common/config_api.c b/media/webrtc/signaling/src/sipcc/core/common/config_api.c index 258a709f7ec5..bd4d87c1cad7 100755 --- a/media/webrtc/signaling/src/sipcc/core/common/config_api.c +++ b/media/webrtc/signaling/src/sipcc/core/common/config_api.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdio.h" @@ -84,7 +49,7 @@ config_get_string (int id, char *buffer, int buffer_len) if ((id >= 0) && (id < CFGID_PROTOCOL_MAX)) { entry = &prot_cfg_table[id]; if (entry->length > buffer_len) { - CONFIG_ERROR(CFG_F_PREFIX"insufficient buffer: %d\n", "config_get_string", + CONFIG_ERROR(CFG_F_PREFIX"insufficient buffer: %d\n", "config_get_string", id); } else { buf_start = buffer; @@ -191,7 +156,7 @@ print_config_value (int id, char *get_set, const char *entry_name, *str_ptr = '\0'; CONFIG_DEBUG(DEB_F_PREFIX"CFGID %d: %s: %s = %s\n", DEB_F_PREFIX_ARGS(CONFIG_API, "print_config_value"), id, get_set, entry_name, str); } else { - CONFIG_ERROR(CFG_F_PREFIX"cfg_id = %d length too long -> %d\n", "print_config_value", + CONFIG_ERROR(CFG_F_PREFIX"cfg_id = %d length too long -> %d\n", "print_config_value", id, length); } } @@ -226,7 +191,7 @@ config_get_value (int id, void *buffer, int length) print_config_value(id, "Get Val", entry->name, buffer, length); } } else { - CONFIG_ERROR(CFG_F_PREFIX"%s size error\n", "config_get_value", + CONFIG_ERROR(CFG_F_PREFIX"%s size error\n", "config_get_value", entry->name); } } else { @@ -285,7 +250,7 @@ get_printable_cfg(unsigned int indx, char *buf, unsigned int len) { const var_t *table; buf[0]=0; - + table = &prot_cfg_table[indx]; // If this field has a password, print the param name, but NOT the // real password @@ -380,7 +345,7 @@ show_config_cmd (cc_int32_t argc, const char *argv[]) debugif_printf("%s\n", get_printable_cfg(CFGID_LINE_CONTACT+i, buf, MAX_CONFIG_VAL_PRINT_LEN)); } } - + return (0); } diff --git a/media/webrtc/signaling/src/sipcc/core/common/config_parser.c b/media/webrtc/signaling/src/sipcc/core/common/config_parser.c index 709ebeacc2cf..4f50fdd135e8 100644 --- a/media/webrtc/signaling/src/sipcc/core/common/config_parser.c +++ b/media/webrtc/signaling/src/sipcc/core/common/config_parser.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include "cc_constants.h" @@ -70,7 +35,7 @@ #define ID_BLOCK_PREF3 3 /* * File location is hardcoded for getting mac and IP addr - */ + */ #define IP_ADDR_FILE "/sdcard/myip.txt" static char autoreg_name[MAX_LINE_NAME_SIZE]; @@ -196,7 +161,7 @@ boolean is_cfgid_in_restart_list(int cfgid) { void compare_or_set_byte_value(int cfgid, unsigned char value, const unsigned char * config_name) { int temp_value ; const var_t *entry; - if (apply_config == TRUE) { + if (apply_config == TRUE) { if (is_cfgid_in_restart_list(cfgid) == TRUE) { config_get_value(cfgid, &temp_value, sizeof(temp_value)); if (((int)value) != temp_value) { @@ -218,7 +183,7 @@ void compare_or_set_byte_value(int cfgid, unsigned char value, const unsigned ch void compare_or_set_boolean_value(int cfgid, cc_boolean value, const unsigned char * config_name) { int temp_value ; const var_t *entry; - if (apply_config == TRUE) { + if (apply_config == TRUE) { if (is_cfgid_in_restart_list(cfgid) == TRUE) { config_get_value(cfgid, &temp_value, sizeof(temp_value)); if (((int)value) != temp_value) { @@ -240,7 +205,7 @@ void compare_or_set_boolean_value(int cfgid, cc_boolean value, const unsigned ch void compare_or_set_int_value(int cfgid, int value, const unsigned char * config_name) { int temp_value; const var_t *entry; - if (apply_config == TRUE) { + if (apply_config == TRUE) { if (is_cfgid_in_restart_list(cfgid) == TRUE) { config_get_value(cfgid, &temp_value, sizeof(temp_value)); if (value != temp_value) { @@ -263,7 +228,7 @@ void compare_or_set_int_value(int cfgid, int value, const unsigned char * config void compare_or_set_string_value (int cfgid, const char* value, const unsigned char * config_name) { static char temp_value[MAX_SIP_URL_LENGTH]; const var_t *entry; - if (apply_config == TRUE ) { + if (apply_config == TRUE ) { if (is_cfgid_in_restart_list(cfgid) == TRUE) { config_get_string(cfgid, temp_value, MAX_SIP_URL_LENGTH); if (strcmp(value, temp_value) != 0) { @@ -324,7 +289,7 @@ void config_set_autoreg_properties () void update_security_mode_and_ports(void) { sec_level_t sec_level = NON_SECURE; - // convert security mode (from UCM xml) into internal enum + // convert security mode (from UCM xml) into internal enum switch (security_mode) { case 1: sec_level = NON_SECURE; break; @@ -334,14 +299,14 @@ void update_security_mode_and_ports(void) { CONFIG_ERROR(CFG_F_PREFIX "unable to translate securite mode [%d]\n", "update_security_mode_and_ports", (int)security_mode); break; } - + compare_or_set_int_value(CFGID_CCM1_SEC_LEVEL, sec_level, (const unsigned char *)"deviceSecurityMode"); compare_or_set_int_value(CFGID_CCM2_SEC_LEVEL, sec_level, (const unsigned char *)"deviceSecurityMode"); compare_or_set_int_value(CFGID_CCM3_SEC_LEVEL, sec_level, (const unsigned char *)"deviceSecurityMode"); - + if (sec_level == NON_SECURE) { compare_or_set_int_value(CFGID_CCM1_SIP_PORT, sip_port[0], (const unsigned char *)"ccm1_sip_port"); @@ -367,7 +332,7 @@ void update_security_mode_and_ports(void) { /* * config_get_mac_addr * - * Get the filename that has the mac address and parse the string + * Get the filename that has the mac address and parse the string * convert it into an mac address stored in the bytearray maddr */ void config_get_mac_addr (char *maddr) @@ -388,7 +353,7 @@ void config_set_ccm_ip_mac () compare_or_set_int_value(CFGID_SPEAKER_ENABLED, 1, (const unsigned char *) "speakerEnabled"); if (apply_config == FALSE) { - config_get_mac_addr(macaddr); + config_get_mac_addr(macaddr); CONFIG_DEBUG(CFG_F_PREFIX ": MAC Address IS: %x:%x:%x:%x:%x:%x \n", "config_get_mac_addr", macaddr[0], macaddr[1], @@ -476,7 +441,7 @@ void config_setup_elements (const char *sipUser, const char *sipPassword, const compare_or_set_int_value(CFGID_DSCP_VIDEO, gDscpVideo, (const unsigned char *) "dscpVideo"); compare_or_set_int_value(CFGID_INTER_DIGIT_TIMER, gT302Timer, (const unsigned char *) "T302Timer"); - // TODO(emannion): You had line=1; line<= .... + // TODO(emannion): You had line=1; line<= .... // Debugging suggests that alghouth *line* is 1-indexed, the config entries // are 1-indexed. See. config_get_line_id(). // You may want to rewrite this in terms of config_get_line_id(). diff --git a/media/webrtc/signaling/src/sipcc/core/common/config_parser.h b/media/webrtc/signaling/src/sipcc/core/common/config_parser.h index 45830b13636b..35730eaaf8e3 100644 --- a/media/webrtc/signaling/src/sipcc/core/common/config_parser.h +++ b/media/webrtc/signaling/src/sipcc/core/common/config_parser.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef CONFIG_PARSER_H_ #define CONFIG_PARSER_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/common/init.c b/media/webrtc/signaling/src/sipcc/core/common/init.c index 8fda23ea2977..f64e393be999 100755 --- a/media/webrtc/signaling/src/sipcc/core/common/init.c +++ b/media/webrtc/signaling/src/sipcc/core/common/init.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr.h" #include "cpr_in.h" @@ -207,7 +172,7 @@ void send_protocol_config_msg(void); /** * ccMemInit() */ -extern +extern int ccMemInit(size_t size) { return CPR_SUCCESS; } @@ -314,7 +279,7 @@ thread_init () } #endif #endif - + /* SIP main thread */ sip_thread = cprCreateThread("SIPStack task", (cprThreadStartRoutine) sip_platform_task_loop, @@ -360,7 +325,7 @@ thread_init () #endif /* Associate the threads with the message queues */ - (void) cprSetMessageQueueThread(sip_msgq, sip_thread); + (void) cprSetMessageQueueThread(sip_msgq, sip_thread); (void) cprSetMessageQueueThread(gsm_msgq, gsm_thread); if (FALSE == gHardCodeSDPMode) { @@ -584,7 +549,7 @@ ccUnload (void) static const char fname[] = "ccUnload"; DEF_DEBUG(DEB_F_PREFIX"ccUnload called..\n", DEB_F_PREFIX_ARGS(SIP_CC_INIT, fname)); - if (platform_initialized == FALSE) + if (platform_initialized == FALSE) { TNP_DEBUG(DEB_F_PREFIX"system is not loaded, ignore unload\n", DEB_F_PREFIX_ARGS(SIP_CC_INIT, fname)); return; diff --git a/media/webrtc/signaling/src/sipcc/core/common/logger.c b/media/webrtc/signaling/src/sipcc/core/common/logger.c index 26d40417a0f4..6715c62ab669 100755 --- a/media/webrtc/signaling/src/sipcc/core/common/logger.c +++ b/media/webrtc/signaling/src/sipcc/core/common/logger.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_string.h" diff --git a/media/webrtc/signaling/src/sipcc/core/common/logger.h b/media/webrtc/signaling/src/sipcc/core/common/logger.h index c74c400e3858..3a1465b1a19a 100644 --- a/media/webrtc/signaling/src/sipcc/core/common/logger.h +++ b/media/webrtc/signaling/src/sipcc/core/common/logger.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _LOGGER_INCLUDED_H #define _LOGGER_INCLUDED_H diff --git a/media/webrtc/signaling/src/sipcc/core/common/logmsg.h b/media/webrtc/signaling/src/sipcc/core/common/logmsg.h index 0e919646c467..29ee709b2180 100644 --- a/media/webrtc/signaling/src/sipcc/core/common/logmsg.h +++ b/media/webrtc/signaling/src/sipcc/core/common/logmsg.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _LOGMSG_INCLUDED_H #define _LOGMSG_INCLUDED_H diff --git a/media/webrtc/signaling/src/sipcc/core/common/misc.c b/media/webrtc/signaling/src/sipcc/core/common/misc.c index cff66324141b..0fe4bf19fffa 100644 --- a/media/webrtc/signaling/src/sipcc/core/common/misc.c +++ b/media/webrtc/signaling/src/sipcc/core/common/misc.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include @@ -52,7 +17,7 @@ #include "debug.h" #include "cpr_string.h" #include "cpr_stdlib.h" - + /*-------------------------------------------------------------------------- * Local definitions *-------------------------------------------------------------------------- @@ -151,7 +116,7 @@ phone_reset (DeviceResetType resetType) } -/* +/* * Methods below should be moved to plat as they are exported as an external API. * For now keeping all miscellaneous methods here. */ diff --git a/media/webrtc/signaling/src/sipcc/core/common/plat.c b/media/webrtc/signaling/src/sipcc/core/common/plat.c index cfe945fc16f9..bbbcf6144c82 100644 --- a/media/webrtc/signaling/src/sipcc/core/common/plat.c +++ b/media/webrtc/signaling/src/sipcc/core/common/plat.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include "cpr.h" @@ -53,8 +18,8 @@ platform_apply_config (char * configVersionStamp, char * dialplanVersionStamp, char * fcpVersionStamp, char * cucmResult, - char * loadId, - char * inactiveLoadId, + char * loadId, + char * inactiveLoadId, char * loadServer, char * logServer, boolean ppid); @@ -80,7 +45,7 @@ platform_apply_config (char * configVersionStamp, char * fcpVersionStamp, char * cucmResult, char * loadId, - char * inactiveLoadId, + char * inactiveLoadId, char * loadServer, char * logServer, boolean ppid) diff --git a/media/webrtc/signaling/src/sipcc/core/common/platform_api.c b/media/webrtc/signaling/src/sipcc/core/common/platform_api.c index f55dba3a60df..233ce10be60b 100755 --- a/media/webrtc/signaling/src/sipcc/core/common/platform_api.c +++ b/media/webrtc/signaling/src/sipcc/core/common/platform_api.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include diff --git a/media/webrtc/signaling/src/sipcc/core/common/prot_cfgmgr_private.h b/media/webrtc/signaling/src/sipcc/core/common/prot_cfgmgr_private.h index 914a49f887e2..ddf609e62932 100755 --- a/media/webrtc/signaling/src/sipcc/core/common/prot_cfgmgr_private.h +++ b/media/webrtc/signaling/src/sipcc/core/common/prot_cfgmgr_private.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _PROT_CFGMGR_PRIVATE_H_ #define _PROT_CFGMGR_PRIVATE_H_ @@ -139,11 +104,11 @@ typedef struct * name field of the key is a primary indication whether the * parameter is configured or not. This is because the * zero value is a designated value for G711 and the -1 is - * for no codec. The -1 is not natural value of uninitialized + * for no codec. The -1 is not natural value of uninitialized * variable therefore keep the codec as name and value pair. * The missing of the name indiates there the parameter is not * configured. - */ + */ key_table_entry_t preferred_codec; int dtmf_db_level; DtmfOutOfBandTransport_t dtmf_outofband; @@ -272,7 +237,7 @@ static const key_table_entry_t codec_table[] = { {"iLBC", RTP_ILBC}, {"iSAC", RTP_ISAC}, {"opus", RTP_OPUS}, - {"none", RTP_NONE}, + {"none", RTP_NONE}, {0, RTP_NONE} }; diff --git a/media/webrtc/signaling/src/sipcc/core/common/prot_configmgr.c b/media/webrtc/signaling/src/sipcc/core/common/prot_configmgr.c index 38728c9a6bf2..93da2d5c3d03 100755 --- a/media/webrtc/signaling/src/sipcc/core/common/prot_configmgr.c +++ b/media/webrtc/signaling/src/sipcc/core/common/prot_configmgr.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdio.h" @@ -115,7 +80,7 @@ int i; initCfgTblEntry(CFGID_PROXY_ADDRESS+i, "ProxyAddr", CFGVAR(line[i].proxy_address), PA_STR, PR_STR, 0); initCfgTblEntry(CFGID_PROXY_PORT+i, "ProxyPort", CFGVAR(line[i].proxy_port), PA_INT, PR_INT, 0); initCfgTblEntry(CFGID_LINE_CALL_WAITING+i, "CWait", CFGVAR(line[i].call_waiting), PA_INT, PR_INT, 0); - initCfgTblEntry(CFGID_LINE_AUTOANSWER_ENABLED+i, "AAns", CFGVAR(line[i].autoanswer), PA_INT, PR_INT, 0); + initCfgTblEntry(CFGID_LINE_AUTOANSWER_ENABLED+i, "AAns", CFGVAR(line[i].autoanswer), PA_INT, PR_INT, 0); initCfgTblEntry(CFGID_LINE_AUTOANSWER_MODE+i, "AAnsMode", CFGVAR(line[i].autoanswer_mode), PA_STR, PR_STR, 0); initCfgTblEntry(CFGID_LINE_MSG_WAITING_LAMP+i, "MWILamp", CFGVAR(line[i].msg_waiting_lamp), PA_INT, PR_INT, 0); initCfgTblEntry(CFGID_LINE_MESSAGE_WAITING_AMWI+i, "AMWI", CFGVAR(line[i].msg_waiting_amwi), PA_INT, PR_INT, 0); @@ -163,7 +128,7 @@ sip_config_get_net_device_ipaddr (cpr_ip_addr_t *ip_addr) * Get the device IP address. * Note: the IP Address is returned in the non-Telecaster * SIP format, which is not byte reversed. - * + * */ void sip_config_get_net_ipv6_device_ipaddr (cpr_ip_addr_t *ip_addr) @@ -335,7 +300,7 @@ sip_config_get_button_from_line (line_t line) */ for (button = 1; button <= max_lines_allowed; button++) { - + config_get_line_value(CFGID_LINE_INDEX, &line_no, sizeof(line_no), button); if ((line_t)line_no == line) { @@ -346,7 +311,7 @@ sip_config_get_button_from_line (line_t line) button = 0; line_no = 0; - /* Nothing has found so far, try old way of calculating the + /* Nothing has found so far, try old way of calculating the * button number */ do { @@ -359,12 +324,12 @@ sip_config_get_button_from_line (line_t line) button++; line_no++; - } while (((line_t)line_no < line) && + } while (((line_t)line_no < line) && button <= max_lines_allowed); /* Above loop not able to find the correct button number - * so return value 0 + * so return value 0 */ if (button > max_lines_allowed) { return(0); @@ -441,13 +406,13 @@ sip_config_local_line_get (void) /* * sip_config_get_keepalive_expires() * - * Returns the keepalive expires configured. - * The minimum allowed value is returned if + * Returns the keepalive expires configured. + * The minimum allowed value is returned if * configured value is less than the minimum - * allowed value.If the configured value is + * allowed value.If the configured value is * greater than the maximum allowed then the * maximum allowed value is returned. - * + * */ int sip_config_get_keepalive_expires() @@ -459,12 +424,12 @@ sip_config_get_keepalive_expires() if (keepalive_interval < MIN_KEEPALIVE_EXPIRES) { keepalive_interval = MIN_KEEPALIVE_EXPIRES; - TNP_DEBUG(DEB_F_PREFIX"Keepalive interval less than minimum acceptable.Resetting it to %d\n", + TNP_DEBUG(DEB_F_PREFIX"Keepalive interval less than minimum acceptable.Resetting it to %d\n", DEB_F_PREFIX_ARGS(SIP_KA, "sip_config_get_keepalive_expires"), keepalive_interval); } else if (keepalive_interval > MAX_KEEPALIVE_EXPIRES) { keepalive_interval = MAX_KEEPALIVE_EXPIRES; - TNP_DEBUG(DEB_F_PREFIX"Keepalive interval more than maximum acceptable.Resetting it to %d\n", + TNP_DEBUG(DEB_F_PREFIX"Keepalive interval more than maximum acceptable.Resetting it to %d\n", DEB_F_PREFIX_ARGS(SIP_KA, "sip_config_get_keepalive_expires"), keepalive_interval); } @@ -489,18 +454,18 @@ sip_config_get_display_name (line_t line, char *buffer, int buffer_len) /** * Returns the configured value of preferred codec. The codec may - * or may not be available by the platform. - * + * or may not be available by the platform. + * * @param[in] none. - * + * * @return rtp_ptype of the codec. - */ + */ rtp_ptype sip_config_preferred_codec (void) { key_table_entry_t cfg_preferred_codec; - config_get_value(CFGID_PREFERRED_CODEC, &cfg_preferred_codec, + config_get_value(CFGID_PREFERRED_CODEC, &cfg_preferred_codec, sizeof(cfg_preferred_codec)); if ((cfg_preferred_codec.name != NULL) && (cfg_preferred_codec.name[0] != '\0')) { @@ -514,15 +479,15 @@ sip_config_preferred_codec (void) /** * sip_config_local_supported_codecs_get() * Get the locally supported codec list. The returned list - * of codecs will be in the ordered of preference. If there is + * of codecs will be in the ordered of preference. If there is * preferred condec configured and it is available, the * preferred codec will be put on the first entry of the * returned list. * - * @param[in,out] aSupportedCodecs - pointer to arrary fo the + * @param[in,out] aSupportedCodecs - pointer to arrary fo the * rtp_ptype to store the result of * currenlty available codecs. - * @param[in] supportedCodecsLen - indicates the number of entry + * @param[in] supportedCodecsLen - indicates the number of entry * of the aSupportedCodecs. * * @return number of current codecs available. @@ -546,10 +511,10 @@ sip_config_local_supported_codecs_get (rtp_ptype aSupportedCodecs[], if (!codec_mask) { codec_mask = VCM_CODEC_RESOURCE_G711 | VCM_CODEC_RESOURCE_OPUS; } - + /* - * convert the current available codec into the enumerated - * preferred list. + * convert the current available codec into the enumerated + * preferred list. */ current_codec_table[0] = RTP_NONE; current_codec_table[MAX_CODEC_ENTRIES] = RTP_NONE; @@ -574,7 +539,7 @@ sip_config_local_supported_codecs_get (rtp_ptype aSupportedCodecs[], break; } codec++; - } + } } if (preferred_codec_available) { @@ -614,7 +579,7 @@ sip_config_local_supported_codecs_get (rtp_ptype aSupportedCodecs[], * Get the locally supported codec list. */ uint16_t -sip_config_video_supported_codecs_get (rtp_ptype aSupportedCodecs[], +sip_config_video_supported_codecs_get (rtp_ptype aSupportedCodecs[], uint16_t supportedCodecsLen, boolean isOffer) { uint16_t count = 0; @@ -624,7 +589,7 @@ sip_config_video_supported_codecs_get (rtp_ptype aSupportedCodecs[], if ( isOffer ) { codec_mask = vcmGetVideoCodecList(VCM_DSP_FULLDUPLEX); } else { - /* we are trying to match the answer then we + /* we are trying to match the answer then we already have the rx stream open */ //codec_mask = vcmGetVideoCodecList(DSP_ENCODEONLY); codec_mask = vcmGetVideoCodecList(VCM_DSP_IGNORE); @@ -634,12 +599,12 @@ sip_config_video_supported_codecs_get (rtp_ptype aSupportedCodecs[], count++; } if ( codec_mask & VCM_CODEC_RESOURCE_H264) { - /* + /* * include payload type for packetization mode 1 only if ucm sis version * is equal to or greater than 5.1.0 (AngelFire). */ platGetSISProtocolVer(&major_ver, &minor_ver, NULL, NULL); - if ((major_ver > SIS_PROTOCOL_MAJOR_VERSION_ANGELFIRE) || + if ((major_ver > SIS_PROTOCOL_MAJOR_VERSION_ANGELFIRE) || (major_ver == SIS_PROTOCOL_MAJOR_VERSION_ANGELFIRE && minor_ver >= SIS_PROTOCOL_MINOR_VERSION_ANGELFIRE)) { if (vcmGetVideoMaxSupportedPacketizationMode() == 1) { @@ -662,19 +627,19 @@ sip_config_video_supported_codecs_get (rtp_ptype aSupportedCodecs[], * The function fills in the given codec array based on the * platform bit mask of codecs. Note, that the enumerated list * produced is also in the preferred order. - * + * * @param[in] codec_mask - platform bit mask corresponding to the * codecs. * @param[in/out] codecs - pointer to array of for storing the * output of the enumerated codec based on - * bit set in the codec_mask. - * + * bit set in the codec_mask. + * * @return None. - * + * * @pre (codec_table != NULL) * @pre storge of codec_table must be last enough to holds * supported codec in the bit mask. - */ + */ static void config_set_current_codec_table (int codec_mask, rtp_ptype *codecs) { @@ -701,7 +666,7 @@ config_set_current_codec_table (int codec_mask, rtp_ptype *codecs) codecs[idx] = RTP_L16; idx++; } - + if (codec_mask & VCM_CODEC_RESOURCE_G722) { codecs[idx] = RTP_G722; idx++; @@ -711,7 +676,7 @@ config_set_current_codec_table (int codec_mask, rtp_ptype *codecs) codecs[idx] = RTP_ILBC; idx++; } - + if (codec_mask & VCM_CODEC_RESOURCE_iSAC) { codecs[idx] = RTP_ISAC; idx++; diff --git a/media/webrtc/signaling/src/sipcc/core/common/prot_configmgr.h b/media/webrtc/signaling/src/sipcc/core/common/prot_configmgr.h index e67cd350fa55..204c3b600525 100755 --- a/media/webrtc/signaling/src/sipcc/core/common/prot_configmgr.h +++ b/media/webrtc/signaling/src/sipcc/core/common/prot_configmgr.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _PROT_CONFIGMGR_H_ #define _PROT_CONFIGMGR_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/common/resource_manager.c b/media/webrtc/signaling/src/sipcc/core/common/resource_manager.c index 3174ba648272..6e969a1ecfde 100644 --- a/media/webrtc/signaling/src/sipcc/core/common/resource_manager.c +++ b/media/webrtc/signaling/src/sipcc/core/common/resource_manager.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdlib.h" diff --git a/media/webrtc/signaling/src/sipcc/core/common/resource_manager.h b/media/webrtc/signaling/src/sipcc/core/common/resource_manager.h index b44d98fb4f43..4d34be59dc87 100644 --- a/media/webrtc/signaling/src/sipcc/core/common/resource_manager.h +++ b/media/webrtc/signaling/src/sipcc/core/common/resource_manager.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _RM_MGR_H__ #define _RM_MGR_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/common/sip_socket_api.c b/media/webrtc/signaling/src/sipcc/core/common/sip_socket_api.c index a14193c7abbf..15952840f18c 100755 --- a/media/webrtc/signaling/src/sipcc/core/common/sip_socket_api.c +++ b/media/webrtc/signaling/src/sipcc/core/common/sip_socket_api.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr.h" #include "cpr_socket.h" @@ -48,7 +13,7 @@ * @brief The sipSocketSend() function is a wrapper used by the sipstack to send * data over a socket. This function decides to use the secure versus unsecure * connection based on the "secure" flag. - * + * * @note - The implementation of both secure/non-secure is the same in RT/TNP * products. It is different for the other vendors and hence we need this * flexibility. @@ -63,7 +28,7 @@ ssize_t sipSocketSend (cpr_socket_t soc, CONST void *buf, - size_t len, + size_t len, int32_t flags, boolean secure) { @@ -80,7 +45,7 @@ sipSocketSend (cpr_socket_t soc, * @brief The sipSocketRecv() function is a wrapper used by the sipstack to send * data over a socket. This function decides to use the secure versus unsecure * connection based on the "secure" flag. - * + * * @note - The implementation of both secure/non-secure is the same in RT/TNP * products. It is different for the other vendors and hence we need this * flexibility. @@ -110,14 +75,14 @@ sipSocketRecv (cpr_socket_t soc, * @brief The sipSocketClose() function is a wrapper used by the sipstack to * close a socket. This function decides to use the secure versus unsecure * connection based on the "secure" flag. - * + * * @note - The implementation of both secure/non-secure is the same in RT/TNP * products. It is different for the other vendors and hence we need this * flexibility. * * @param[in] soc - The socket that needs to be destroyed * - * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. + * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. * * @note The possible error values this function should return are * @li [CPR_EBADF] socket is not a valid socket descriptor. diff --git a/media/webrtc/signaling/src/sipcc/core/common/subscription_handler.c b/media/webrtc/signaling/src/sipcc/core/common/subscription_handler.c index 568f7b5c6f73..f587379ccb9a 100755 --- a/media/webrtc/signaling/src/sipcc/core/common/subscription_handler.c +++ b/media/webrtc/signaling/src/sipcc/core/common/subscription_handler.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cc_types.h" @@ -70,7 +35,7 @@ static void ccBLFHandlerInitialized(); * * Returns: TRUE/FALSE */ -boolean sub_hndlr_isAlertingBLFState(int inst) +boolean sub_hndlr_isAlertingBLFState(int inst) { static const char fname[] = "sub_hndlr_isAlertingBLFState"; @@ -86,7 +51,7 @@ boolean sub_hndlr_isAlertingBLFState(int inst) inst); return FALSE; } - + /* * Function: sub_hndlr_isInUseBLFState * @@ -97,7 +62,7 @@ boolean sub_hndlr_isAlertingBLFState(int inst) * * Returns: TRUE/FALSE */ -boolean sub_hndlr_isInUseBLFState(int inst) +boolean sub_hndlr_isInUseBLFState(int inst) { static const char fname[] = "sub_hndlr_isInUseBLFState"; @@ -112,7 +77,7 @@ boolean sub_hndlr_isInUseBLFState(int inst) inst); return FALSE; } - + /* * Function: sub_hndlr_isAvailable * @@ -122,7 +87,7 @@ boolean sub_hndlr_isInUseBLFState(int inst) * * Returns: TRUE/FALSE */ -boolean sub_hndlr_isAvailable() +boolean sub_hndlr_isAvailable() { static const char fname[] = "sub_hndlr_isAvailable"; @@ -142,7 +107,7 @@ static unsigned short get_new_trans_id() return curr_trans_id; } - + /* * Function: sub_hndlr_start * @@ -152,7 +117,7 @@ static unsigned short get_new_trans_id() * * Returns: void */ -void sub_hndlr_start() +void sub_hndlr_start() { static const char fname[] = "sub_hndlr_start"; int i; @@ -169,7 +134,7 @@ void sub_hndlr_start() /* get primary DN */ config_get_line_string(CFGID_LINE_NAME, primaryLine, 1, sizeof(primaryLine)); - + /* * for speeddial/BLF buttons, make presence subscriptions. */ @@ -177,7 +142,7 @@ void sub_hndlr_start() // first line must always be a calling line. config_get_line_value(CFGID_LINE_FEATURE, &lineFeature, sizeof(lineFeature), i); - + CCAPP_DEBUG(DEB_F_PREFIX"inst=%d, lineFeature=%d\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), i, lineFeature); @@ -188,7 +153,7 @@ void sub_hndlr_start() break; } config_get_line_value(CFGID_LINE_FEATURE, &featureOptionMask, sizeof(featureOptionMask), i); - + transId = get_new_trans_id(); transactionIds[i - 1] = transId; CC_BLF_subscribe(transId, @@ -201,20 +166,20 @@ void sub_hndlr_start() default: break; } - + //Initializes native BLF handler ccBLFHandlerInitialized(); } } - -static void ccBLFHandlerInitialized() + +static void ccBLFHandlerInitialized() { if (!isBLFHandlerRunning) { CC_BLF_init(); isBLFHandlerRunning = TRUE; } } - + /* * Function: sub_hndlr_stop * @@ -224,7 +189,7 @@ static void ccBLFHandlerInitialized() * * Returns: void */ -void sub_hndlr_stop() +void sub_hndlr_stop() { static const char fname[] = "sub_hndlr_stop"; int i; @@ -244,7 +209,7 @@ void sub_hndlr_stop() CC_BLF_unsubscribe_All(); } - + /* * Function: hideBLFButtonsDisplay * @@ -254,7 +219,7 @@ void sub_hndlr_stop() * * Returns: void */ -static void hideBLFButtonsDisplay() +static void hideBLFButtonsDisplay() { static const char fname[] = "hideBLFButtonsDisplay"; int i; @@ -266,7 +231,7 @@ static void hideBLFButtonsDisplay() for (i = SPEEDDIAL_START_BUTTON_NUMBER; i <= MAX_REG_LINES; i++) { // first line must always be a calling line. config_get_line_value(CFGID_LINE_FEATURE, &lineFeature, sizeof(lineFeature), i); - + switch (lineFeature) { case cfgLineFeatureSpeedDialBLF: ccsnap_gen_blfFeatureEvent(CC_SIP_BLF_UNKNOWN, i); @@ -276,7 +241,7 @@ static void hideBLFButtonsDisplay() } } } - + /* * Function: unhideBLFButtonsDisplay * @@ -312,7 +277,7 @@ static void unhideBLFButtonsDisplay() } } } - + /* * Function: sub_hndlr_controlBLFButtons * @@ -336,20 +301,20 @@ void sub_hndlr_controlBLFButtons(boolean state) unhideBLFButtonsDisplay(); } } - + /* * Function: sub_hndlr_NotifyBLFStatus * * Description: notifies the app of BLF state. * - * Parameters: + * Parameters: * requestId - requestId of the subscription * status - BLF status * appId - button number of the BLF feature key. * * Returns: void */ -void sub_hndlr_NotifyBLFStatus(int requestId, cc_blf_state_t status, int appId) +void sub_hndlr_NotifyBLFStatus(int requestId, cc_blf_state_t status, int appId) { static const char fname[] = "sub_hndlr_NotifyBLFStatus"; cc_uint32_t lineFeature = 0; @@ -364,7 +329,7 @@ void sub_hndlr_NotifyBLFStatus(int requestId, cc_blf_state_t status, int appId) } else { config_get_line_value(CFGID_LINE_FEATURE, &lineFeature, sizeof(lineFeature), appId); config_get_line_string(CFGID_LINE_SPEEDDIAL_NUMBER, speedDialNumber, appId, sizeof(speedDialNumber)); - + blfStates[appId - 1] = status; if (displayBLFState == FALSE) { return; // ignore the notify diff --git a/media/webrtc/signaling/src/sipcc/core/common/subscription_handler.h b/media/webrtc/signaling/src/sipcc/core/common/subscription_handler.h index 59506a5a8b72..3bcf7317d29b 100755 --- a/media/webrtc/signaling/src/sipcc/core/common/subscription_handler.h +++ b/media/webrtc/signaling/src/sipcc/core/common/subscription_handler.h @@ -1,58 +1,23 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef __SUB_HANDLER_H__ #define __SUB_HANDLER_H__ boolean sub_hndlr_isAlertingBLFState(int inst); - -boolean sub_hndlr_isInUseBLFState(int inst); -boolean sub_hndlr_isAvailable(); +boolean sub_hndlr_isInUseBLFState(int inst); -void sub_hndlr_start(); +boolean sub_hndlr_isAvailable(); -void sub_hndlr_stop(); +void sub_hndlr_start(); + +void sub_hndlr_stop(); void sub_hndlr_controlBLFButtons(boolean state); -void sub_hndlr_NotifyBLFStatus(int requestId, int status, int appId); +void sub_hndlr_NotifyBLFStatus(int requestId, int status, int appId); #endif diff --git a/media/webrtc/signaling/src/sipcc/core/common/text_strings.c b/media/webrtc/signaling/src/sipcc/core/common/text_strings.c index d63691dd18b4..b8576c9c7d8b 100755 --- a/media/webrtc/signaling/src/sipcc/core/common/text_strings.c +++ b/media/webrtc/signaling/src/sipcc/core/common/text_strings.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include "text_strings.h" diff --git a/media/webrtc/signaling/src/sipcc/core/common/text_strings.h b/media/webrtc/signaling/src/sipcc/core/common/text_strings.h index 03b387451c58..0502a38e050a 100755 --- a/media/webrtc/signaling/src/sipcc/core/common/text_strings.h +++ b/media/webrtc/signaling/src/sipcc/core/common/text_strings.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef TEXT_STRINGS_H #define TEXT_STRINGS_H @@ -52,7 +17,7 @@ * Define hard coded Anonymous string to be used in From header * when call id blocking is enabled. This is also used to * compare to when anonymous call block is enabled. We can - * can not use the localized version of Anonymous for these + * can not use the localized version of Anonymous for these * actions. */ #define SIP_HEADER_ANONYMOUS_STR "Anonymous" @@ -62,7 +27,7 @@ * comparing special display names whether the names are special * and not to display the number associated with the name. */ -#define CONFERENCE_STR "conference" +#define CONFERENCE_STR "conference" #define CONFERENCE_STR_LEN (sizeof(CONFERENCE_STR)-1) #define CONFERENCE_LOCALE_CODE 964 /* @@ -77,7 +42,7 @@ #define STR_INDEX_CNFR_FAIL_NOCODEC 1054 #define STR_INDEX_REORDER 1055 #define STR_INDEX_ANONYMOUS_SPACE 1056 -#define STR_INDEX_NO_FREE_LINES 1057 +#define STR_INDEX_NO_FREE_LINES 1057 #define STR_INDEX_REGISTRATION_REJECTED 1058 #define STR_INDEX_REGISTERING 1 #define STR_INDEX_WHISPER 1 diff --git a/media/webrtc/signaling/src/sipcc/core/common/ui.c b/media/webrtc/signaling/src/sipcc/core/common/ui.c index d316b964428a..750a43539d6b 100755 --- a/media/webrtc/signaling/src/sipcc/core/common/ui.c +++ b/media/webrtc/signaling/src/sipcc/core/common/ui.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** @file tnp_ui.c * API provided by Platform to the Call Control for User Interface activities @@ -225,7 +190,7 @@ ui_set_call_attr (line_t line_id, callid_t call_id, call_attr_t attr) } /** - * Wrapper for ui_update_callref + * Wrapper for ui_update_callref * * @param line - line for the session * @param call_id - callid for the session @@ -326,12 +291,12 @@ ui_update_video_avail (line_t line, callid_t call_id, int avail) void ui_update_media_interface_change(line_t line, callid_t call_id, group_call_event_t event) { session_update_t msg; - + if (event != MEDIA_INTERFACE_UPDATE_BEGIN && event != MEDIA_INTERFACE_UPDATE_SUCCESSFUL && event != MEDIA_INTERFACE_UPDATE_FAIL) { // un-related event. ignore. - return; + return; } if (event != MEDIA_INTERFACE_UPDATE_BEGIN) { @@ -339,7 +304,7 @@ void ui_update_media_interface_change(line_t line, callid_t call_id, group_call_ g_dock_undock_event = MEDIA_INTERFACE_UPDATE_NOT_REQUIRED; } - DEF_DEBUG(DEB_L_C_F_PREFIX "event=%s", DEB_L_C_F_PREFIX_ARGS(UI_API, line, call_id, __FUNCTION__), + DEF_DEBUG(DEB_L_C_F_PREFIX "event=%s", DEB_L_C_F_PREFIX_ARGS(UI_API, line, call_id, __FUNCTION__), event == MEDIA_INTERFACE_UPDATE_BEGIN ? "MEDIA_INTERFACE_UPDATE_BEGIN" : event == MEDIA_INTERFACE_UPDATE_SUCCESSFUL ? "MEDIA_INTERFACE_UPDATE_SUCCESSFUL" : event == MEDIA_INTERFACE_UPDATE_FAIL ? "MEDIA_INTERFACE_UPDATE_FAIL" : "unknown"); @@ -1562,12 +1527,12 @@ ui_control_feature (line_t line_id, callid_t call_id, * */ static void post_message_helper( - group_call_event_t eventId, - call_events event, + group_call_event_t eventId, + call_events event, line_t nLine, callid_t nCallId, uint16_t call_instance_id, - char *sdp, + char *sdp, cc_int32_t status) { session_update_t msg; diff --git a/media/webrtc/signaling/src/sipcc/core/common/vcm_util.c b/media/webrtc/signaling/src/sipcc/core/common/vcm_util.c index ad539f919a48..f4daf87ce8ce 100644 --- a/media/webrtc/signaling/src/sipcc/core/common/vcm_util.c +++ b/media/webrtc/signaling/src/sipcc/core/common/vcm_util.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "debug.h" #include "rtp_defs.h" diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/ccapi.c b/media/webrtc/signaling/src/sipcc/core/gsm/ccapi.c index 94edbfd29df8..9f9a65800c84 100755 --- a/media/webrtc/signaling/src/sipcc/core/gsm/ccapi.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/ccapi.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdio.h" @@ -98,7 +63,7 @@ cc_print_msg (char *pData, int len) int ix; int msg_id = *((int *) pData); - buginf("\n" CCA_F_PREFIX "cc_msg= %s, 0x=", __FUNCTION__, + buginf("\n" CCA_F_PREFIX "cc_msg= %s, 0x=", __FUNCTION__, cc_msg_name((cc_msgs_t) msg_id)); for (ix = 0; ix < len; ix++) { if ((ix % 8 == 0) && ix) { @@ -252,7 +217,7 @@ cc_initialize_msg_body_parts_info (cc_msgbody_info_t *msg_body) */ void cc_mv_msg_body_parts (cc_msgbody_info_t *dst_msg, cc_msgbody_info_t *src_msg) -{ +{ if (dst_msg == NULL) { GSM_ERR_MSG(CCA_F_PREFIX "dst is NULL\n", __FUNCTION__); return; @@ -550,15 +515,15 @@ cc_mv_caller_id (cc_caller_id_t *dst_caller, cc_caller_id_t *src_caller) } dst_caller->last_redirect_number = src_caller->last_redirect_number; src_caller->last_redirect_number = NULL; - } - + } + if (src_caller->orig_rpid_number != NULL) { if (dst_caller->orig_rpid_number != NULL) { strlib_free(dst_caller->orig_rpid_number); } dst_caller->orig_rpid_number = src_caller->orig_rpid_number; src_caller->orig_rpid_number = NULL; - } + } dst_caller->display_calling_number = src_caller->display_calling_number; dst_caller->display_called_number = src_caller->display_called_number; } @@ -619,10 +584,10 @@ cc_free_caller_id (cc_caller_id_t *caller) if (caller->last_redirect_number) { strlib_free(caller->last_redirect_number); } - + if (caller->orig_rpid_number != NULL) { strlib_free(caller->orig_rpid_number); - } + } } /* @@ -820,7 +785,7 @@ cc_int_setup (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, } CC_DEBUG(DEB_L_C_F_PREFIX " CGPD= %s, CGPN= %s,\n CDPD= %s, CDPN= %s\n", - DEB_L_C_F_PREFIX_ARGS(CC_API, line, call_id, __FUNCTION__), + DEB_L_C_F_PREFIX_ARGS(CC_API, line, call_id, __FUNCTION__), caller_id->calling_name, caller_id->calling_number, caller_id->called_name, caller_id->called_number); @@ -1127,7 +1092,7 @@ cc_int_release_complete (cc_srcs_t src_id, cc_srcs_t dst_id, } CC_DEBUG_ENTRY(__FUNCTION__, src_id, dst_id, call_id, line, cc_msg_name(pmsg->msg_id)); - CC_DEBUG(DEB_L_C_F_PREFIX " cause= %s\n", + CC_DEBUG(DEB_L_C_F_PREFIX " cause= %s\n", DEB_L_C_F_PREFIX_ARGS(CC_API, line, call_id, __FUNCTION__), cc_cause_name(cause)); if (cc_send_msg((cprBuffer_t) pmsg, sizeof(*pmsg), dst_id) != CC_RC_SUCCESS) { @@ -1153,7 +1118,7 @@ cc_int_feature2 (cc_msgs_t msg_id, cc_srcs_t src_id, cc_srcs_t dst_id, cc_feature_name(feature_id)); return; } - + pmsg->msg_id = msg_id; pmsg->src_id = src_id; pmsg->call_id = call_id; @@ -1178,11 +1143,11 @@ cc_int_feature2 (cc_msgs_t msg_id, cc_srcs_t src_id, cc_srcs_t dst_id, msg_body = cc_get_msg_body_info_ptr_from_feature_data(feature_id, data); cc_initialize_msg_body_parts_info(msg_body); } - + if ((feature_id == CC_FEATURE_XFER) || (feature_id == CC_FEATURE_BLIND_XFER)) { if (data != NULL) { - CC_DEBUG(DEB_L_C_F_PREFIX + CC_DEBUG(DEB_L_C_F_PREFIX "method= %d, call_id= %d, cause= %s dialstring= %s\n", DEB_L_C_F_PREFIX_ARGS(CC_API, line, call_id, __FUNCTION__), data->xfer.method, data->xfer.target_call_id, @@ -1190,7 +1155,7 @@ cc_int_feature2 (cc_msgs_t msg_id, cc_srcs_t src_id, cc_srcs_t dst_id, } } CC_DEBUG_ENTRY(__FUNCTION__, src_id, dst_id, call_id, line, cc_feature_name(feature_id)); - CC_DEBUG(DEB_L_C_F_PREFIX "feature= %s, data= %p\n", + CC_DEBUG(DEB_L_C_F_PREFIX "feature= %s, data= %p\n", DEB_L_C_F_PREFIX_ARGS(CC_API, line, call_id, __FUNCTION__), cc_feature_name(feature_id), data); if (cc_send_msg((cprBuffer_t) pmsg, sizeof(*pmsg), dst_id) != CC_RC_SUCCESS) { // nobody checks the return code, so generate error message @@ -1207,11 +1172,11 @@ cc_int_feature2 (cc_msgs_t msg_id, cc_srcs_t src_id, cc_srcs_t dst_id, */ static void send_message_helper( cc_msgs_t msg_id, - cc_srcs_t src_id, - cc_srcs_t dst_id, + cc_srcs_t src_id, + cc_srcs_t dst_id, callid_t call_id, - line_t line, - cc_features_t feature_id, + line_t line, + cc_features_t feature_id, cc_feature_data_t *data, string_t sdp, cc_jsep_action_t action) @@ -1225,7 +1190,7 @@ static void send_message_helper( cc_feature_name(feature_id)); return; } - + pmsg->msg_id = msg_id; pmsg->src_id = src_id; pmsg->call_id = call_id; @@ -1239,7 +1204,7 @@ static void send_message_helper( if (msg_id == CC_MSG_CREATEANSWER || msg_id == CC_MSG_SETLOCALDESC || msg_id == CC_MSG_SETREMOTEDESC) { sstrncpy(pmsg->sdp, sdp, sizeof(pmsg->sdp)); - } + } if (pmsg->data_valid == TRUE) { pmsg->data = *data; @@ -1258,9 +1223,9 @@ static void send_message_helper( msg_body = cc_get_msg_body_info_ptr_from_feature_data(feature_id, data); cc_initialize_msg_body_parts_info(msg_body); } - + CC_DEBUG_ENTRY(__FUNCTION__, src_id, dst_id, call_id, line, cc_feature_name(feature_id)); - CC_DEBUG(DEB_L_C_F_PREFIX "feature= %s, data= %p\n", + CC_DEBUG(DEB_L_C_F_PREFIX "feature= %s, data= %p\n", DEB_L_C_F_PREFIX_ARGS(CC_API, line, call_id, __FUNCTION__), cc_feature_name(feature_id), data); if (cc_send_msg((cprBuffer_t) pmsg, sizeof(*pmsg), dst_id) != CC_RC_SUCCESS) { // nobody checks the return code, so generate error message @@ -1293,7 +1258,7 @@ cc_createanswer (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, } -void cc_setlocaldesc (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t line, +void cc_setlocaldesc (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t line, cc_features_t feature_id, cc_jsep_action_t action, string_t sdp, cc_feature_data_t *data) { send_message_helper(CC_MSG_SETLOCALDESC, src_id, dst_id, call_id, line, @@ -1302,7 +1267,7 @@ void cc_setlocaldesc (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line return; } -void cc_setremotedesc (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t line, +void cc_setremotedesc (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t line, cc_features_t feature_id, cc_jsep_action_t action, string_t sdp, cc_feature_data_t *data) { send_message_helper(CC_MSG_SETREMOTEDESC, src_id, dst_id, call_id, line, @@ -1311,7 +1276,7 @@ void cc_setremotedesc (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, lin return; } -void cc_localdesc (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t line, +void cc_localdesc (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t line, cc_features_t feature_id, cc_feature_data_t *data) { send_message_helper(CC_MSG_LOCALDESC, src_id, dst_id, call_id, line, @@ -1320,7 +1285,7 @@ void cc_localdesc (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t return; } -void cc_remotedesc (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t line, +void cc_remotedesc (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t line, cc_features_t feature_id, cc_feature_data_t *data) { send_message_helper(CC_MSG_REMOTEDESC, src_id, dst_id, call_id, line, @@ -1366,9 +1331,9 @@ cc_int_feature_ack (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, if ((feature_id == CC_FEATURE_XFER) || (feature_id == CC_FEATURE_BLIND_XFER)) { if (data != NULL) { - CC_DEBUG(DEB_L_C_F_PREFIX + CC_DEBUG(DEB_L_C_F_PREFIX "method= %d, call_id= %d, cause= %s dialstring= %s\n", - DEB_L_C_F_PREFIX_ARGS(CC_API, line, call_id, __FUNCTION__), + DEB_L_C_F_PREFIX_ARGS(CC_API, line, call_id, __FUNCTION__), data->xfer.method, data->xfer.target_call_id, cc_cause_name(data->xfer.cause), data->xfer.dialstring); } @@ -1376,7 +1341,7 @@ cc_int_feature_ack (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, CC_DEBUG_ENTRY(__FUNCTION__, src_id, dst_id, call_id, line, cc_msg_name(pmsg->msg_id)); CC_DEBUG(DEB_L_C_F_PREFIX "feature= %s, data= %p, cause= %s\n", - DEB_L_C_F_PREFIX_ARGS(CC_API, line, call_id, __FUNCTION__), cc_feature_name(feature_id), data, + DEB_L_C_F_PREFIX_ARGS(CC_API, line, call_id, __FUNCTION__), cc_feature_name(feature_id), data, cc_cause_name(cause)); if (cc_send_msg((cprBuffer_t) pmsg, sizeof(*pmsg), dst_id) != CC_RC_SUCCESS) { @@ -1525,7 +1490,7 @@ cc_int_dialstring (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, return; } - CC_DEBUG(DEB_L_C_F_PREFIX "dialstring= %s\n", + CC_DEBUG(DEB_L_C_F_PREFIX "dialstring= %s\n", DEB_L_C_F_PREFIX_ARGS(CC_API, line, call_id, __FUNCTION__),dialstring); pmsg = (cc_dialstring_t *) cc_get_msg_buf(sizeof(*pmsg)); @@ -1578,7 +1543,7 @@ cc_int_mwi (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t line, pmsg->msgSummary.hpOldCount = hpOldCount; CC_DEBUG_ENTRY(__FUNCTION__, src_id, dst_id, call_id, line, cc_msg_name(pmsg->msg_id)); - CC_DEBUG(DEB_L_C_F_PREFIX " mwi status= %d\n new count= %d old count= %d", + CC_DEBUG(DEB_L_C_F_PREFIX " mwi status= %d\n new count= %d old count= %d", DEB_L_C_F_PREFIX_ARGS(CC_API, line, call_id, __FUNCTION__), on, newCount, oldCount); if (cc_send_msg((cprBuffer_t) pmsg, sizeof(*pmsg), dst_id) != CC_RC_SUCCESS) { @@ -1608,7 +1573,7 @@ cc_int_options_sdp_req (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, pmsg->pMessage = pMessage; CC_DEBUG_ENTRY(__FUNCTION__, src_id, dst_id, call_id, line, cc_msg_name(pmsg->msg_id)); - CC_DEBUG(DEB_L_C_F_PREFIX " message ptr=%p\n", + CC_DEBUG(DEB_L_C_F_PREFIX " message ptr=%p\n", DEB_L_C_F_PREFIX_ARGS(CC_API, line, call_id, __FUNCTION__), pMessage); if (cc_send_msg((cprBuffer_t) pmsg, sizeof(*pmsg), dst_id) != CC_RC_SUCCESS) { @@ -1641,7 +1606,7 @@ cc_int_options_sdp_ack (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, cc_mv_msg_body_parts(&pmsg->msg_body, msg_body); CC_DEBUG_ENTRY(__FUNCTION__, src_id, dst_id, call_id, line, cc_msg_name(pmsg->msg_id)); - CC_DEBUG(DEB_L_C_F_PREFIX " message ptr=%p\n", + CC_DEBUG(DEB_L_C_F_PREFIX " message ptr=%p\n", DEB_L_C_F_PREFIX_ARGS(CC_API, line, call_id, __FUNCTION__), pMessage); if (cc_send_msg((cprBuffer_t) pmsg, sizeof(*pmsg), dst_id) != CC_RC_SUCCESS) { @@ -1732,7 +1697,7 @@ cc_int_fail_fallback (cc_srcs_t src_id, cc_srcs_t dst_id, int rsp_type, CC_DEBUG_ENTRY(__FUNCTION__, src_id, dst_id, 0, 0, cc_msg_name(pmsg->msg_id)); CC_DEBUG(DEB_F_PREFIX "rsp_type= %s rsp_id= %s waited = %d\n", - DEB_F_PREFIX_ARGS(CC_API, __FUNCTION__), + DEB_F_PREFIX_ARGS(CC_API, __FUNCTION__), rsp_type == RSP_START ? "RSP_START" : "RSP_COMPLETE", rsp_id == CC_REG_FAILOVER_RSP ? "REG_FAILOVER_RSP" : "REG_FALLBACK_RSP", waited); diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/ccapi_strings.c b/media/webrtc/signaling/src/sipcc/core/gsm/ccapi_strings.c index d89f41ef9ddb..23e6da7d5951 100644 --- a/media/webrtc/signaling/src/sipcc/core/gsm/ccapi_strings.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/ccapi_strings.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #define __CC_FEATURE_STRINGS__ // this is required to include feature strings. diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/dcsm.c b/media/webrtc/signaling/src/sipcc/core/gsm/dcsm.c index d657361841ab..0139e64b29e9 100755 --- a/media/webrtc/signaling/src/sipcc/core/gsm/dcsm.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/dcsm.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdlib.h" @@ -70,7 +35,7 @@ static struct dcsm_icb_t { line_t line; int gsm_state; sll_handle_t s_msg_list; - + dcsm_state_e state; } dcsm_cb; @@ -150,16 +115,16 @@ static dcsm_table_t *pdcsm_sm_table = &dcsm_sm_table; * Adds event to the dcsm queue. * * @param event - Call control event to add - * + * * @return TRUE if the event is added. - + * */ static boolean dcsm_add_event_to_queue (void *event) { (void) sll_append(dcsm_cb.s_msg_list, event); - + return TRUE; } @@ -167,18 +132,18 @@ dcsm_add_event_to_queue (void *event) * Get a event from the queue. * * @param none - * + * * @return pointer to the event. - + * */ static void * dcsm_get_first_event_from_queue (void) { void *msg_ptr = NULL; - + msg_ptr = sll_next(dcsm_cb.s_msg_list, NULL); - + sll_remove(dcsm_cb.s_msg_list, msg_ptr); return(msg_ptr); @@ -188,18 +153,18 @@ dcsm_get_first_event_from_queue (void) * Get dcsm state name. * * @param int - state id - * + * * @return ponter to the state name either * DCSM_READY or DCSM_WAITING. * */ const char *dcsm_get_state_name (int state) { - if ((state <= DCSM_S_MIN) || + if ((state <= DCSM_S_MIN) || (state >= DCSM_S_MAX)) { return (get_debug_string(GSM_UNDEFINED)); } - + return dcsm_state_names[state]; } @@ -214,7 +179,7 @@ const char *dcsm_get_state_name (int state) static void dcsm_process_event_to_gsm (void *msg_ptr) { if (fim_process_event(msg_ptr, FALSE) == TRUE) { - + fim_free_event(msg_ptr); /* Release buffer too */ @@ -244,7 +209,7 @@ static void dcsm_do_ready_state_job (void) DEB_F_PREFIX_ARGS("DCSM", fname)); return; } - + msg_ptr = dcsm_get_first_event_from_queue(); /* Check if there is any msg available */ @@ -256,7 +221,7 @@ static void dcsm_do_ready_state_job (void) call_id = feat_msg->call_id; } } - + DEF_DEBUG(DEB_F_PREFIX"%d: event (%s%s)\n", DEB_F_PREFIX_ARGS("DCSM", fname), call_id, cc_msg_name((cc_msgs_t)(event_id)), @@ -278,7 +243,7 @@ void dcsm_process_jobs (void) } /** - * Adds call_id to the list of call_id's which made DCSM to move + * Adds call_id to the list of call_id's which made DCSM to move * to waiting state. * * @param callid_t - call id that has to be added to the list @@ -289,7 +254,7 @@ static void dcsm_add_call_id_to_list (callid_t call_id) { static const char fname[] = "dcsm_add_call_id_to_list"; int i, loc = -1; - + for (i=0; i< DCSM_MAX_CALL_IDS; i++) { if (dcsm_cb.call_ids[i] == CC_NO_CALL_ID) { loc = i; @@ -300,13 +265,13 @@ static void dcsm_add_call_id_to_list (callid_t call_id) } if (loc == -1) { - + /* Should never happen as there is a space to store call_id - * for each calls + * for each calls */ DCSM_ERROR(DCSM_F_PREFIX"DCSM No space to store call_id.\n", DEB_F_PREFIX_ARGS("DCSM", fname)); - return; + return; } dcsm_cb.call_ids[loc] = call_id; @@ -324,24 +289,24 @@ static boolean dcsm_remove_check_for_empty_list (callid_t call_id) { int i; boolean call_id_present = FALSE; - + for (i=0; i< DCSM_MAX_CALL_IDS; i++) { if (dcsm_cb.call_ids[i] == call_id) { dcsm_cb.call_ids[i] = CC_NO_CALL_ID; - + /* Found out that other call_id exist by setting - * call_id_preset, so return true, don't have to + * call_id_preset, so return true, don't have to * continue */ if (call_id_present == TRUE) { return FALSE; } - + } else if (dcsm_cb.call_ids[i] != CC_NO_CALL_ID) { call_id_present = TRUE; } } - + if (call_id_present == TRUE) { return(FALSE); } @@ -365,16 +330,16 @@ dcsm_update_gsm_state (fsm_fcb_t *fcb, callid_t call_id, int state) int last_state; static const char fname[] = "dcsm_update_gsm_state"; fsmdef_dcb_t *dcb; - + if (fcb->fsm_type != FSM_TYPE_DEF) { - DEF_DEBUG(DEB_F_PREFIX"%d: Not handling for %s\n", - DEB_F_PREFIX_ARGS("DCSM", fname), call_id, + DEF_DEBUG(DEB_F_PREFIX"%d: Not handling for %s\n", + DEB_F_PREFIX_ARGS("DCSM", fname), call_id, fsm_type_name(fcb->fsm_type)); return; } last_state = dcsm_cb.state; - + switch (state) { case FSMDEF_S_RELEASING: dcb = fsmdef_get_dcb_by_call_id(call_id); @@ -386,7 +351,7 @@ dcsm_update_gsm_state (fsm_fcb_t *fcb, callid_t call_id, int state) case FSMDEF_S_HOLD_PENDING: case FSMDEF_S_RESUME_PENDING: dcsm_add_call_id_to_list(call_id); - + dcsm_cb.state = DCSM_S_WAITING; break; case FSMDEF_S_MIN: @@ -403,14 +368,14 @@ dcsm_update_gsm_state (fsm_fcb_t *fcb, callid_t call_id, int state) case FSMDEF_S_HOLDING: case FSMDEF_S_PRESERVED: case FSMDEF_S_MAX: - /* If there are no other call_id then move it to + /* If there are no other call_id then move it to * ready state else, it will remain in waiting * state */ if (dcsm_remove_check_for_empty_list(call_id) == TRUE) { dcsm_cb.state = DCSM_S_READY; /* Check if there are any pending events in the queue - * if so send a DCSM_EV_READY to the GSM so dcsm will + * if so send a DCSM_EV_READY to the GSM so dcsm will * get a chance to execute. */ if (sll_count(dcsm_cb.s_msg_list) > 0 ) { @@ -420,12 +385,12 @@ dcsm_update_gsm_state (fsm_fcb_t *fcb, callid_t call_id, int state) } } } - + break; default: break; } - + DEF_DEBUG(DEB_F_PREFIX"%d : %s --> %s\n", DEB_F_PREFIX_ARGS("DCSM", fname), call_id, dcsm_get_state_name(last_state), @@ -471,7 +436,7 @@ dcsm_wait_ev_feature_handling (void *event, int event_id) cc_feature_t *feat_msg = (cc_feature_t *) event; sm_rcs_t rc = SM_RC_END; cc_features_t ftr_id = CC_FEATURE_UNDEFINED; - callid_t call_id = CC_NO_CALL_ID; + callid_t call_id = CC_NO_CALL_ID; if (feat_msg != NULL) { ftr_id = feat_msg->feature_id; @@ -497,12 +462,12 @@ dcsm_wait_ev_feature_handling (void *event, int event_id) default: DEF_DEBUG(DEB_F_PREFIX"%d: Feature msg not handled\n", DEB_F_PREFIX_ARGS("DCSM", fname), call_id); - + rc = SM_RC_CONT; break; } - - + + return (rc); } @@ -559,15 +524,15 @@ dcsm_process_event (void *event, int event_id) call_id = feat_msg->call_id; } } - + DEF_DEBUG(DEB_F_PREFIX"DCSM %-4d:(%s:%s%s)\n", DEB_F_PREFIX_ARGS("DCSM", fname), call_id, dcsm_get_state_name(dcsm_cb.state), cc_msg_name((cc_msgs_t)(event_id)), feat_msg ? cc_feature_name(feat_msg->feature_id):" "); - + state_id = dcsm_cb.state; // Get current state; - + /* * validate the state and event * and that there is a valid function for this state-event pair. @@ -576,8 +541,8 @@ dcsm_process_event (void *event, int event_id) (state_id < pdcsm_sm_table->max_state) && (event_id > pdcsm_sm_table->min_event) && (event_id < pdcsm_sm_table->max_event)) { - - if ((hdlr = pdcsm_sm_table->table[pdcsm_sm_table->max_event * state_id + + + if ((hdlr = pdcsm_sm_table->table[pdcsm_sm_table->max_event * state_id + event_id]) != NULL) { DEF_DEBUG(DEB_F_PREFIX"%-4d: dcsm entry: (%s)\n", DEB_F_PREFIX_ARGS("DCSM", fname), call_id, @@ -585,7 +550,7 @@ dcsm_process_event (void *event, int event_id) rc = hdlr(event, event_id); } - + } return (rc); @@ -612,7 +577,7 @@ dcsm_match_event (void *key_p, void *msg_data) * Show function for DCSM * * @param argc - number of parameter passed - * argv - argument passed + * argv - argument passed * * @return 0 - if function successful */ @@ -636,11 +601,11 @@ dcsm_show_cmd (cc_int32_t argc, const char *argv[]) return (0); } - + if (dcsm_cb.s_msg_list == NULL) { return(0); } - + debugif_printf("\n-------------------------- DCSM Data --------------------------"); debugif_printf("\nDCSM State = %s",dcsm_get_state_name(dcsm_cb.state)); debugif_printf("\nDCSM waiting calls \n"); @@ -651,13 +616,13 @@ dcsm_show_cmd (cc_int32_t argc, const char *argv[]) } } debugif_printf("\n"); - + debugif_printf("\nDCSM waiting events \n"); i = 0; msg_ptr = sll_next(dcsm_cb.s_msg_list, NULL); while (msg_ptr) { msg_ptr = sll_next(dcsm_cb.s_msg_list, msg_ptr); - + if (msg_ptr) { msg = (cc_setup_t *) msg_ptr; msg_id = msg->msg_id; @@ -666,14 +631,14 @@ dcsm_show_cmd (cc_int32_t argc, const char *argv[]) if ((int)msg_id == CC_MSG_FEATURE) { feat_msg = (cc_feature_t *) msg_ptr; } - + debugif_printf("Event %d (%d/%d): (%s%s)\n", i++, line, call_id, cc_msg_name(msg_id), feat_msg ? cc_feature_name(feat_msg->feature_id):" "); } } debugif_printf("\n-------------------------- DCSM Data Done-----------------------"); - + return (0); } @@ -682,7 +647,7 @@ dcsm_show_cmd (cc_int32_t argc, const char *argv[]) * * Initialize dcsm state machine. * - * @param none + * @param none * * @return none * @@ -693,7 +658,7 @@ dcsm_init (void) { static const char fname[] = "dcsm_init"; int i; - + /* * Initialize the state/event table. */ @@ -702,13 +667,13 @@ dcsm_init (void) dcsm_sm_table.min_event = CC_MSG_MIN; dcsm_sm_table.max_event = CC_MSG_MAX; dcsm_sm_table.table = (&(dcsm_function_table[0][0])); - + dcsm_cb.state = DCSM_S_READY; for (i=0; i< DCSM_MAX_CALL_IDS; i++) { dcsm_cb.call_ids[i] = CC_NO_CALL_ID; } - + /* allocate and initialize cac list */ dcsm_cb.s_msg_list = sll_create((sll_match_e(*)(void *, void *)) dcsm_match_event); @@ -718,14 +683,14 @@ dcsm_init (void) DEB_F_PREFIX_ARGS("DCSM", fname)); } - + } /** * * Shut down routine for dcsm state machine. * - * @param none + * @param none * * @return none * @@ -735,15 +700,15 @@ void dcsm_shutdown (void) { void *msg_ptr; - + if (dcsm_cb.s_msg_list == NULL) { return; } - + msg_ptr = sll_next(dcsm_cb.s_msg_list, NULL); while (msg_ptr) { msg_ptr = sll_next(dcsm_cb.s_msg_list, msg_ptr); - + if (msg_ptr) { fim_free_event(msg_ptr); @@ -751,7 +716,7 @@ dcsm_shutdown (void) cpr_free(msg_ptr); } } - + sll_destroy(dcsm_cb.s_msg_list); dcsm_cb.s_msg_list = NULL; } diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/fim.c b/media/webrtc/signaling/src/sipcc/core/gsm/fim.c index 6cb38d6ce9a0..06b1b6dba7bf 100755 --- a/media/webrtc/signaling/src/sipcc/core/gsm/fim.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/fim.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdlib.h" @@ -444,15 +409,15 @@ fim_process_event (void *data, boolean cac_passed) cc_call_state(call_id, line, CC_STATE_UNKNOWN, NULL); return(TRUE); } - - /* Make sure to process the device events + + /* Make sure to process the device events */ - + if (dcsm_process_event(data, event_id) == SM_RC_END) { /* Keep the message in the dcsm state handler */ return(FALSE); } - + /* * Grab non-call control events and hand them off to other functions that * are not implemented by the fsms. @@ -465,12 +430,12 @@ fim_process_event (void *data, boolean cac_passed) fim_process_options_msg(data); return(TRUE); } - + if (platWlanISActive() && cac_passed == FALSE) { /* The WLAN will request for bandwidth only for the events received from * UI or other external entity. For internal events there is allocated bandwidth - * and do not need to request again. + * and do not need to request again. */ if ((msg->src_id != CC_SRC_GSM) && @@ -482,13 +447,13 @@ fim_process_event (void *data, boolean cac_passed) ((((cc_feature_t *) msg)->feature_id == CC_FEATURE_NEW_CALL))))) { bw_call_id = call_id; - - if ((event_id == CC_MSG_SETUP) && + + if ((event_id == CC_MSG_SETUP) && ((((cc_setup_t *)msg)->call_info.type == CC_FEAT_MONITOR))) { no_of_session = 2; bw_call_id = msg->call_info.data.join.join_call_id; } - + if (fsm_cac_call_bandwidth_req (bw_call_id, no_of_session, msg) != CC_CAUSE_OK) { return(TRUE); } @@ -538,7 +503,7 @@ fim_process_event (void *data, boolean cac_passed) (event_id == CC_MSG_CREATEOFFER) || (event_id == CC_MSG_CREATEANSWER) || (event_id == CC_MSG_SETLOCALDESC) || - (event_id == CC_MSG_SETREMOTEDESC) || + (event_id == CC_MSG_SETREMOTEDESC) || (event_id == CC_MSG_SETPEERCONNECTION) || (event_id == CC_MSG_ADDSTREAM) || (event_id == CC_MSG_REMOVESTREAM) || @@ -600,9 +565,9 @@ fim_process_event (void *data, boolean cac_passed) return(TRUE); } if (event_id != CC_MSG_SETUP) { - /* + /* * Increment the call chain cnt for this line - * For incoming calls, we don't know the line number + * For incoming calls, we don't know the line number * when SETUP msg is received, so it's an exception, it'll be * added in fsmdef_idle_setup */ @@ -654,7 +619,7 @@ fim_process_event (void *data, boolean cac_passed) line = fcb->dcb->line; } } - + /* * This update_call_cnt is only used when RC_CLEANUP is returned. */ @@ -698,12 +663,12 @@ fim_process_event (void *data, boolean cac_passed) cc_call_state(call_id, line, CC_STATE_UNKNOWN, NULL); break; } /* switch (rc) */ - - if ((rc == SM_RC_END) && (fcb->fsm_type == FSM_TYPE_DEF) && + + if ((rc == SM_RC_END) && (fcb->fsm_type == FSM_TYPE_DEF) && (event_id == CC_MSG_FEATURE)) { if ( ((cc_feature_t *) msg)->feature_id == CC_FEATURE_CFWD_ALL){ - lsm_decrement_call_chn_cnt(line); + lsm_decrement_call_chn_cnt(line); } } diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/fsm.c b/media/webrtc/signaling/src/sipcc/core/gsm/fsm.c index c311c748c30a..ebc9f9083888 100755 --- a/media/webrtc/signaling/src/sipcc/core/gsm/fsm.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/fsm.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdlib.h" @@ -204,7 +169,7 @@ fsm_get_fcb_by_call_id_and_type (callid_t call_id, fsm_types_t type) * NULL: fcb not found * */ -void +void fsm_get_fcb_by_selected_or_connected_call_fcb (callid_t call_id, fsm_fcb_t **con_fcb_found, fsm_fcb_t **sel_fcb_found) { @@ -220,7 +185,7 @@ fsm_get_fcb_by_selected_or_connected_call_fcb (callid_t call_id, fsm_fcb_t **con /* Do not count current call_id */ continue; } - if (fcb->fsm_type == FSM_TYPE_DEF && + if (fcb->fsm_type == FSM_TYPE_DEF && (fcb->state == FSMDEF_S_CONNECTED || fcb->state == FSMDEF_S_CONNECTED_MEDIA_PEND || fcb->state == FSMDEF_S_OUTGOING_ALERTING)) { @@ -376,7 +341,7 @@ fsm_change_state (fsm_fcb_t *fcb, int fname, int new_state) DEF_DEBUG(DEB_L_C_F_PREFIX"%s: %s -> %s\n", DEB_L_C_F_PREFIX_ARGS(FSM, ((fcb->dcb == NULL)? CC_NO_LINE: fcb->dcb->line), fcb->call_id, "fsm_change_state"), - fsm_type_name(fcb->fsm_type), + fsm_type_name(fcb->fsm_type), fsm_state_name(fcb->fsm_type, fcb->state), fsm_state_name(fcb->fsm_type, new_state)); @@ -884,7 +849,7 @@ fsmutil_init_groupid (fsmdef_dcb_t *dcb, callid_t call_id, * @pre none */ int -fsmutil_get_call_attr (fsmdef_dcb_t *dcb, +fsmutil_get_call_attr (fsmdef_dcb_t *dcb, line_t line, callid_t call_id) { int call_attr; @@ -1148,7 +1113,7 @@ fsmutil_free_ci_id (uint16_t id, line_t line) } #ifdef LOCAL_UI_CALLINSTANCE_ID -/*This routine is not needed now as the local assignment +/*This routine is not needed now as the local assignment *of call instance id is no longer supported. */ /* diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/fsmb2bcnf.c b/media/webrtc/signaling/src/sipcc/core/gsm/fsmb2bcnf.c index e18306f68552..e3c84f507366 100755 --- a/media/webrtc/signaling/src/sipcc/core/gsm/fsmb2bcnf.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/fsmb2bcnf.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdlib.h" @@ -174,7 +139,7 @@ fsmb2bcnf_init_ccb (fsmcnf_ccb_t *ccb) * * @param none * - * @return fsm_fcb_t if there is a active trasnfer pending + * @return fsm_fcb_t if there is a active trasnfer pending * else NULL * * @pre (none) @@ -187,7 +152,7 @@ fsm_fcb_t *fsmb2bcnf_get_active_cnf(void) FSM_FOR_ALL_CBS(b2bccb, fsmb2bcnf_ccbs, FSMCNF_MAX_CCBS) { fcb = fsm_get_fcb_by_call_id_and_type(b2bccb->cnf_call_id, - FSM_TYPE_B2BCNF); + FSM_TYPE_B2BCNF); if (fcb && fcb->state == FSMB2BCNF_S_ACTIVE) { return(fcb); } @@ -289,7 +254,7 @@ fsmb2bcnf_update_b2bcnf_context (fsmcnf_ccb_t *ccb, callid_t old_call_id, } /* - * Function to get line number of other call associated in + * Function to get line number of other call associated in * transfer. * * @param xcb and call_id. @@ -457,18 +422,18 @@ boolean fsmb2bcnf_check_if_ok_to_setup_conf (callid_t call_id) { fsmdef_dcb_t *dcb; - + if (call_id == CC_NO_CALL_ID) { return (FALSE); } dcb = fsm_get_dcb(call_id); - if(dcb && dcb->policy == CC_POLICY_CHAPERONE + if(dcb && dcb->policy == CC_POLICY_CHAPERONE && dcb->is_conf_call == TRUE){ return (FALSE); } - + return (TRUE); } @@ -530,7 +495,7 @@ fsmb2bcnf_cnf_invoke (callid_t call_id, callid_t target_call_id, /** * * Cancel b2b conference feature by sending cancel event to SIP stack. - * This routine is used in roundtable phone. + * This routine is used in roundtable phone. * * @param line, call_id, target_call_id, cause (implicit or explicit) * @@ -539,7 +504,7 @@ fsmb2bcnf_cnf_invoke (callid_t call_id, callid_t target_call_id, * @pre (none) */ void -fsmb2bcnf_feature_cancel (fsmcnf_ccb_t *ccb, line_t line, callid_t call_id, +fsmb2bcnf_feature_cancel (fsmcnf_ccb_t *ccb, line_t line, callid_t call_id, callid_t target_call_id, cc_rcc_skey_evt_type_e cause) { @@ -551,7 +516,7 @@ fsmb2bcnf_feature_cancel (fsmcnf_ccb_t *ccb, line_t line, callid_t call_id, if ((cause == CC_SK_EVT_TYPE_EXPLI) && (fcb_def != NULL) && ((fcb_def->dcb->selected == FALSE) && ((fcb_def->state == FSMDEF_S_OUTGOING_ALERTING) || - ((fcb_def->state == FSMDEF_S_CONNECTED) && + ((fcb_def->state == FSMDEF_S_CONNECTED) && (fcb_def->dcb->spoof_ringout_requested == TRUE) && (fcb_def->dcb->spoof_ringout_applied == TRUE))))) { @@ -564,7 +529,7 @@ fsmb2bcnf_feature_cancel (fsmcnf_ccb_t *ccb, line_t line, callid_t call_id, if ((cause == CC_SK_EVT_TYPE_EXPLI) && (fcb_def != NULL) && ((fcb_def->dcb->selected == FALSE) && ((fcb_def->state == FSMDEF_S_OUTGOING_ALERTING) || - ((fcb_def->state == FSMDEF_S_CONNECTED) && + ((fcb_def->state == FSMDEF_S_CONNECTED) && (fcb_def->dcb->spoof_ringout_requested == TRUE) && (fcb_def->dcb->spoof_ringout_applied == TRUE))))) { @@ -619,7 +584,7 @@ fsmb2bcnf_ev_idle_feature (sm_event_t *event) * call_id in the data then terminate the existing consulatative * call and link that to another call. */ - if (ftr_data && msg->data_valid && + if (ftr_data && msg->data_valid && (ftr_data->b2bconf.target_call_id != CC_NO_CALL_ID) && (cns_fcb = fsm_get_fcb_by_call_id_and_type(ftr_data->b2bconf.target_call_id, FSM_TYPE_B2BCNF)) != NULL) { @@ -633,7 +598,7 @@ fsmb2bcnf_ev_idle_feature (sm_event_t *event) return(SM_RC_END); } - /* Conference origination id, required later. This indicates conf is + /* Conference origination id, required later. This indicates conf is * because of UI or because of CTI */ ccb->cnf_orig = src_id; @@ -655,7 +620,7 @@ fsmb2bcnf_ev_idle_feature (sm_event_t *event) } fsm_change_state(fcb, __LINE__, FSMB2BCNF_S_ACTIVE); - + fsm_change_state(cns_fcb, __LINE__, FSMB2BCNF_S_ACTIVE); cc_int_feature(CC_SRC_GSM, CC_SRC_GSM, ccb->cns_call_id, @@ -773,8 +738,8 @@ fsmb2bcnf_ev_idle_feature (sm_event_t *event) case CC_SRC_GSM: switch (ftr_id) { case CC_FEATURE_NOTIFY: - - /* Since this message is specifically for conference, msg is + + /* Since this message is specifically for conference, msg is * consumed here and not forwarded */ if ((msg->data.notify.subscription == CC_SUBSCRIPTIONS_REMOTECC) @@ -855,7 +820,7 @@ fsmb2bcnf_ev_active_release (sm_event_t *event) * clear the conf state machine */ if (ccb->active == FALSE) { - fsmb2bcnf_feature_cancel(ccb, ccb->cnf_line, ccb->cnf_call_id, + fsmb2bcnf_feature_cancel(ccb, ccb->cnf_line, ccb->cnf_call_id, ccb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); fsmb2bcnf_cleanup((fsm_fcb_t *) event->data, __LINE__, TRUE); } @@ -908,14 +873,14 @@ fsmb2bcnf_ev_active_feature (sm_event_t *event) switch (ftr_id) { case CC_FEATURE_CANCEL: sm_rc = SM_RC_END; - fsmb2bcnf_feature_cancel(ccb, ccb->cnf_line, ccb->cnf_call_id, + fsmb2bcnf_feature_cancel(ccb, ccb->cnf_line, ccb->cnf_call_id, ccb->cns_call_id, CC_SK_EVT_TYPE_EXPLI); fsmb2bcnf_cleanup(fcb, __LINE__, TRUE); break; case CC_FEATURE_HOLD: - /* Do not send out protect parameter for CTI generated conference + /* Do not send out protect parameter for CTI generated conference * and send protect=true for swap or hold call */ if ((msg->data_valid) && @@ -929,11 +894,11 @@ fsmb2bcnf_ev_active_feature (sm_event_t *event) //Do nothing remote-cc will terminate the feature layer. } else { - DEF_DEBUG(DEB_F_PREFIX"Invoke hold call_id = %d t_call_id=%d\n", - DEB_F_PREFIX_ARGS(GSM, fname), ccb->cnf_call_id, ccb->cns_call_id); + DEF_DEBUG(DEB_F_PREFIX"Invoke hold call_id = %d t_call_id=%d\n", + DEB_F_PREFIX_ARGS(GSM, fname), ccb->cnf_call_id, ccb->cns_call_id); //Actual hold to this call, so break the feature layer. ui_terminate_feature(ccb->cnf_line, ccb->cnf_call_id, ccb->cns_call_id); - fsmb2bcnf_feature_cancel(ccb, ccb->cnf_line, ccb->cnf_call_id, + fsmb2bcnf_feature_cancel(ccb, ccb->cnf_line, ccb->cnf_call_id, ccb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); fsmb2bcnf_cleanup(fcb, __LINE__, TRUE); } @@ -946,15 +911,15 @@ fsmb2bcnf_ev_active_feature (sm_event_t *event) * call_id in the data then terminate the existing consulatative * call and link that to another call. */ - DEF_DEBUG(DEB_F_PREFIX"ACTIVE CNF call_id = %d, t_id = %d, cns_id=%d\n", - DEB_F_PREFIX_ARGS(GSM, fname), ccb->cnf_call_id, + DEF_DEBUG(DEB_F_PREFIX"ACTIVE CNF call_id = %d, t_id = %d, cns_id=%d\n", + DEB_F_PREFIX_ARGS(GSM, fname), ccb->cnf_call_id, feat_data->b2bconf.target_call_id, ccb->cns_call_id); if (feat_data && msg->data_valid && (feat_data->b2bconf.target_call_id != CC_NO_CALL_ID)) { - /* End existing consult call and then link another + /* End existing consult call and then link another * call with the trasfer. This is the case where User can - * select active call instead of consultative call + * select active call instead of consultative call */ cnf_fcb = fsm_get_fcb_by_call_id_and_type(ccb->cns_call_id, FSM_TYPE_DEF); @@ -966,15 +931,15 @@ fsmb2bcnf_ev_active_feature (sm_event_t *event) cnf_fcb = fsm_get_fcb_by_call_id_and_type(ccb->cns_call_id, FSM_TYPE_B2BCNF); - + if (cnf_fcb != NULL) { - DEF_DEBUG(DEB_F_PREFIX"INVOKE ACTIVE CNF call_id = %d, t_id=%d\n", - DEB_F_PREFIX_ARGS(GSM, fname), ccb->cnf_call_id, + DEF_DEBUG(DEB_F_PREFIX"INVOKE ACTIVE CNF call_id = %d, t_id=%d\n", + DEB_F_PREFIX_ARGS(GSM, fname), ccb->cnf_call_id, feat_data->b2bconf.target_call_id); cnf_fcb->b2bccb = ccb; fsm_change_state(cnf_fcb, __LINE__, FSMB2BCNF_S_ACTIVE); - + cc_int_feature(CC_SRC_GSM, CC_SRC_GSM, ccb->cns_call_id, ccb->cnf_line, CC_FEATURE_B2BCONF, NULL); @@ -1020,7 +985,7 @@ fsmb2bcnf_ev_active_feature (sm_event_t *event) /* Release ccbs related to conference and allow event to pass through * fsmdef */ - fsmb2bcnf_feature_cancel(ccb, ccb->cnf_line, ccb->cnf_call_id, + fsmb2bcnf_feature_cancel(ccb, ccb->cnf_line, ccb->cnf_call_id, ccb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); fsmb2bcnf_cleanup(fcb, __LINE__, TRUE); @@ -1033,7 +998,7 @@ fsmb2bcnf_ev_active_feature (sm_event_t *event) */ if (ccb->cnf_orig == CC_SRC_RCC) { if (ccb->cnf_call_id == call_id) { - fsmb2bcnf_feature_cancel(ccb, ccb->cnf_line, ccb->cnf_call_id, + fsmb2bcnf_feature_cancel(ccb, ccb->cnf_line, ccb->cnf_call_id, ccb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); fsmb2bcnf_cleanup(fcb, __LINE__, TRUE); cc_call_state(dcb->call_id, dcb->line, CC_STATE_CONNECTED, @@ -1048,8 +1013,8 @@ fsmb2bcnf_ev_active_feature (sm_event_t *event) && (msg->data.notify.data.rcc.feature == CC_FEATURE_B2BCONF)) { if (msg->data.notify.cause_code != RCC_SUCCESS) { - fsmb2bcnf_feature_cancel(fcb->b2bccb, fcb->b2bccb->cnf_line, - fcb->b2bccb->cnf_call_id, + fsmb2bcnf_feature_cancel(fcb->b2bccb, fcb->b2bccb->cnf_line, + fcb->b2bccb->cnf_call_id, fcb->b2bccb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); } /* @@ -1071,11 +1036,11 @@ fsmb2bcnf_ev_active_feature (sm_event_t *event) case CC_SRC_SIP: switch (ftr_id) { case CC_FEATURE_CALL_PRESERVATION: - DEF_DEBUG(DEB_F_PREFIX"Invoke hold call_id = %d t_call_id=%d\n", - DEB_F_PREFIX_ARGS(GSM, fname), ccb->cnf_call_id, ccb->cns_call_id); + DEF_DEBUG(DEB_F_PREFIX"Invoke hold call_id = %d t_call_id=%d\n", + DEB_F_PREFIX_ARGS(GSM, fname), ccb->cnf_call_id, ccb->cns_call_id); //Actual hold to this call, so break the feature layer. ui_terminate_feature(ccb->cnf_line, ccb->cnf_call_id, ccb->cns_call_id); - fsmb2bcnf_feature_cancel(ccb, ccb->cnf_line, ccb->cnf_call_id, + fsmb2bcnf_feature_cancel(ccb, ccb->cnf_line, ccb->cnf_call_id, ccb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); fsmb2bcnf_cleanup(fcb, __LINE__, TRUE); break; @@ -1124,11 +1089,11 @@ fsmb2bcnf_ev_active_feature_ack (sm_event_t *event) other_ui_id = lsm_get_ui_id(other_call_id); ui_set_call_status(platform_get_phrase_index_str(CONF_CANNOT_COMPLETE), msg->line, other_ui_id); - fsmb2bcnf_feature_cancel(fcb->b2bccb, fcb->b2bccb->cnf_line, fcb->b2bccb->cnf_call_id, + fsmb2bcnf_feature_cancel(fcb->b2bccb, fcb->b2bccb->cnf_line, fcb->b2bccb->cnf_call_id, fcb->b2bccb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); fsmb2bcnf_cleanup(fcb, __LINE__, TRUE); break; - } + } sm_rc = SM_RC_END; break; @@ -1164,13 +1129,13 @@ fsmb2bcnf_ev_active_feature_ack (sm_event_t *event) } void -fsmb2bcnf_get_sub_call_id_from_ccb(fsmcnf_ccb_t *ccb, callid_t *cnf_call_id, +fsmb2bcnf_get_sub_call_id_from_ccb(fsmcnf_ccb_t *ccb, callid_t *cnf_call_id, callid_t *cns_call_id) { static const char fname[] = "fsmb2bcnf_get_sub_call_id_from_ccb"; - DEF_DEBUG(DEB_F_PREFIX"call_id = %d t_call_id=%d\n", - DEB_F_PREFIX_ARGS(GSM, fname), ccb->cnf_call_id, ccb->cns_call_id); + DEF_DEBUG(DEB_F_PREFIX"call_id = %d t_call_id=%d\n", + DEB_F_PREFIX_ARGS(GSM, fname), ccb->cnf_call_id, ccb->cns_call_id); *cnf_call_id = ccb->cnf_call_id; *cns_call_id = ccb->cns_call_id; @@ -1193,7 +1158,7 @@ fsmb2bcnf_ev_active_onhook (sm_event_t *event) ccb->cns_call_id = CC_NO_CALL_ID; } else { - fsmb2bcnf_feature_cancel(ccb, ccb->cnf_line, ccb->cnf_call_id, + fsmb2bcnf_feature_cancel(ccb, ccb->cnf_line, ccb->cnf_call_id, ccb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); fsmb2bcnf_cleanup((fsm_fcb_t *) event->data, __LINE__, TRUE); } @@ -1307,7 +1272,7 @@ fsmb2bcnf_is_rcc_orig_b2bcnf (callid_t call_id) if (ccb && ccb->cnf_orig == CC_SRC_RCC) { return TRUE; } - + return FALSE; } diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/fsmcac.c b/media/webrtc/signaling/src/sipcc/core/gsm/fsmcac.c index 6a1daed7d9b6..21c32ef81c52 100755 --- a/media/webrtc/signaling/src/sipcc/core/gsm/fsmcac.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/fsmcac.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdlib.h" @@ -85,7 +50,7 @@ static sll_handle_t s_cac_list = NULL; /* - * Function responsible for searching the list waiting for + * Function responsible for searching the list waiting for * bandwidth allocation. * * @param cac_data_t *key_p - pointer to the key. @@ -186,10 +151,10 @@ static void fsm_cac_notify_failure (cac_data_t *cac_data) line_t line = msg->line; int event_id = msg_id; cc_srcs_t src_id = msg->src_id; - + /* Notify UI about the failure */ lsm_ui_display_notify_str_index(STR_INDEX_NO_BAND_WIDTH); - + /* Send response from network side regarding the failure */ if (event_id == CC_MSG_SETUP && src_id == CC_SRC_SIP) { @@ -198,20 +163,20 @@ static void fsm_cac_notify_failure (cac_data_t *cac_data) cc_int_release(CC_SRC_GSM, CC_SRC_SIP, call_id, line, CC_CAUSE_CONGESTION, NULL, NULL); } else { - /* If the cac failed, GSM is not spinning yet, so just send the + /* If the cac failed, GSM is not spinning yet, so just send the * information to UI in this case. Other case, where GSM receives event * will send the information from GSM. * If the UI is not cleaned up, session infomation is not cleared. */ ui_call_state(evOnHook, line, call_id, CC_CAUSE_CONGESTION); } - + } /** * * Initialize the cac timer. This timer is responsible for cleanup if the - * cac response is not received from lower layer. + * cac response is not received from lower layer. * * @param cac_data cac data structure * timeout specify the time out in sec @@ -228,7 +193,7 @@ fsm_init_cac_failure_timer(cac_data_t *cac_data, uint32_t timeout) const char fname[] = "fsm_init_cac_failure_timer"; CAC_DEBUG(DEB_F_PREFIX"cac_data call_id=%x\n", - DEB_F_PREFIX_ARGS("CAC", fname), + DEB_F_PREFIX_ARGS("CAC", fname), cac_data->call_id); cac_data->cac_fail_timer = @@ -243,14 +208,14 @@ fsm_init_cac_failure_timer(cac_data_t *cac_data, uint32_t timeout) (void) cprStartTimer(cac_data->cac_fail_timer, timeout * 1000, (void *)(long)cac_data->call_id); - + return(TRUE); } /** * * Serches through cac link list and returns cac_data - * based on call_id. This search is a singly link list search. + * based on call_id. This search is a singly link list search. * * @param call_id call_id of the call * @@ -272,17 +237,17 @@ fsm_cac_get_data_by_call_id (callid_t call_id) if (cac_data->call_id == call_id) { CAC_DEBUG(DEB_F_PREFIX"cac_data found call_id=%x\n", - DEB_F_PREFIX_ARGS("CAC", fname), + DEB_F_PREFIX_ARGS("CAC", fname), cac_data->call_id); return(cac_data); - } + } cac_data = (cac_data_t *) sll_next(s_cac_list, cac_data); } CAC_DEBUG(DEB_F_PREFIX"cac_data NOT found.\n", - DEB_F_PREFIX_ARGS("CAC", fname)); + DEB_F_PREFIX_ARGS("CAC", fname)); return(NULL); } @@ -366,7 +331,7 @@ void fsm_cac_shutdown (void) /** * - * Check if there are pending CAC requests + * Check if there are pending CAC requests * * @param none * @@ -398,7 +363,7 @@ fsm_cac_check_if_pending_req (void) /** * - * Check if there are pending CAC requests + * Check if there are pending CAC requests * * @param none * @@ -411,14 +376,14 @@ fsm_cac_process_bw_allocation (cac_data_t *cac_data) { const char fname[] = "fsm_cac_process_bw_allocation"; - if (lsm_allocate_call_bandwidth(cac_data->call_id, cac_data->sessions) == + if (lsm_allocate_call_bandwidth(cac_data->call_id, cac_data->sessions) == CC_CAUSE_CONGESTION) { DEF_DEBUG(DEB_F_PREFIX"CAC Allocation failed.\n", DEB_F_PREFIX_ARGS("CAC", fname)); fsm_cac_notify_failure(cac_data); - + fsm_clear_cac_data(cac_data); return(CC_CAUSE_CONGESTION); @@ -431,7 +396,7 @@ fsm_cac_process_bw_allocation (cac_data_t *cac_data) /** * - * Check if there are pending CAC requests + * Check if there are pending CAC requests * * @param call_id request a cac for this call_id * sessions number of sessions in the request @@ -441,7 +406,7 @@ fsm_cac_process_bw_allocation (cac_data_t *cac_data) * @return CC_CAUSE_BW_OK if the bandwidth is received. * CC_CAUSE_Ok Call returned successfully, not sure about BW yet * CC_CAUSE_ERROR: Call returned with failure. - * + * * @pre (NULL) */ cc_causes_t @@ -453,9 +418,9 @@ fsm_cac_call_bandwidth_req (callid_t call_id, uint32_t sessions, /* If wlan not connected return OK */ cac_data = fsm_get_new_cac_data(); - + if (cac_data == NULL) { - + return(CC_CAUSE_CONGESTION); } @@ -465,19 +430,19 @@ fsm_cac_call_bandwidth_req (callid_t call_id, uint32_t sessions, cac_data->sessions = sessions; fsm_init_cac_failure_timer(cac_data, CAC_FAILURE_TIMEOUT); - + /* Make sure there is no pending requests before submitting * another one */ if ((cac_pend_data = fsm_cac_check_if_pending_req()) == NULL) { /* - * Make sure sufficient bandwidth available to make a outgoing call. This + * Make sure sufficient bandwidth available to make a outgoing call. This * should be done before allocating other resources. */ DEF_DEBUG(DEB_F_PREFIX"CAC request for %d sessions %d.\n", DEB_F_PREFIX_ARGS("CAC", fname), call_id, sessions); - + if (fsm_cac_process_bw_allocation(cac_data) == CC_CAUSE_CONGESTION) { return(CC_CAUSE_CONGESTION); @@ -495,9 +460,9 @@ fsm_cac_call_bandwidth_req (callid_t call_id, uint32_t sessions, return(CC_CAUSE_CONGESTION); } - + } - + (void) sll_append(s_cac_list, cac_data); return(CC_CAUSE_OK); @@ -506,9 +471,9 @@ fsm_cac_call_bandwidth_req (callid_t call_id, uint32_t sessions, /** * - * This is called by gsm to cleanup the cac data. If there are any + * This is called by gsm to cleanup the cac data. If there are any * pending CAC requests and far end cancels the call, the pending - * request has to be canceled. + * request has to be canceled. * * @param call_id - call_id of the request * @@ -541,11 +506,11 @@ void fsm_cac_call_release_cleanup (callid_t call_id) * * @return CC_CAUSE_NO_RESOURCE No bandwidth * CC_CAUSE_OK if ok - * + * * * @pre (NULL) */ - + cc_causes_t fsm_cac_process_bw_avail_resp (void) { @@ -564,7 +529,7 @@ fsm_cac_process_bw_avail_resp (void) DEF_DEBUG(DEB_F_PREFIX"No Pending CAC request.\n", DEB_F_PREFIX_ARGS("CAC", fname)); /* - * Make sure sufficient bandwidth available to make a outgoing call. This + * Make sure sufficient bandwidth available to make a outgoing call. This * should be done before allocating other resources. */ if (fsm_cac_process_bw_allocation(cac_data) == CC_CAUSE_CONGESTION) { @@ -581,34 +546,34 @@ fsm_cac_process_bw_avail_resp (void) next_cac_data = (cac_data_t *) sll_next(s_cac_list, cac_data); sll_remove(s_cac_list, cac_data); - /* Request for the next bandwidth */ + /* Request for the next bandwidth */ DEF_DEBUG(DEB_F_PREFIX"Process pending responses %d.\n", DEB_F_PREFIX_ARGS("CAC", fname), cac_data->call_id); - /* Let GSM process completed request */ + /* Let GSM process completed request */ fim_process_event(cac_data->msg_ptr, TRUE); fsm_clear_cac_data(cac_data); if (next_cac_data != NULL) { /* - * Make sure sufficient bandwidth available to make a outgoing call. This + * Make sure sufficient bandwidth available to make a outgoing call. This * should be done before allocating other resources. */ DEF_DEBUG(DEB_F_PREFIX"Requesting next allocation %d.\n", DEB_F_PREFIX_ARGS("CAC", fname), next_cac_data->call_id); - if (fsm_cac_process_bw_allocation(next_cac_data) == + if (fsm_cac_process_bw_allocation(next_cac_data) == CC_CAUSE_CONGESTION) { - /* If the next data was in idle state and the request fialed - * then clean up the remaining list + /* If the next data was in idle state and the request fialed + * then clean up the remaining list */ if (next_cac_data->cac_state == FSM_CAC_IDLE) { /* Clear all remaining data */ fsm_cac_clear_list(); } else { - + sll_remove(s_cac_list, next_cac_data); } @@ -635,7 +600,7 @@ fsm_cac_process_bw_avail_resp (void) * * @return CC_CAUSE_NO_RESOURCE No bandwidth * CC_CAUSE_OK if ok - * + * * * @pre (NULL) */ @@ -657,7 +622,7 @@ fsm_cac_process_bw_failed_resp (void) DEF_DEBUG(DEB_F_PREFIX"No Pending request.\n", DEB_F_PREFIX_ARGS("CAC", fname)); /* - * Make sure sufficient bandwidth available to make a outgoing call. This + * Make sure sufficient bandwidth available to make a outgoing call. This * should be done before allocating other resources. */ if (fsm_cac_process_bw_allocation(cac_data) == CC_CAUSE_CONGESTION) { @@ -674,31 +639,31 @@ fsm_cac_process_bw_failed_resp (void) sll_remove(s_cac_list, cac_data); - /* Request for the next bandwidth */ + /* Request for the next bandwidth */ DEF_DEBUG(DEB_F_PREFIX"Process pending responses even after failure.\n", DEB_F_PREFIX_ARGS("CAC", fname)); - /* Let GSM process completed request */ + /* Let GSM process completed request */ fsm_cac_notify_failure(cac_data); fsm_clear_cac_data(cac_data); - + if (next_cac_data != NULL) { /* - * Make sure sufficient bandwidth available to make a outgoing call. This + * Make sure sufficient bandwidth available to make a outgoing call. This * should be done before allocating other resources. */ if (fsm_cac_process_bw_allocation(next_cac_data) == CC_CAUSE_CONGESTION) { - - /* If the next data was in idle state and the request fialed - * then clean up the remaining list + + /* If the next data was in idle state and the request fialed + * then clean up the remaining list */ if (next_cac_data->cac_state == FSM_CAC_IDLE) { /* Clear all remaining data */ fsm_cac_clear_list(); } else { - + sll_remove(s_cac_list, next_cac_data); } @@ -722,11 +687,11 @@ fsm_cac_process_bw_failed_resp (void) * @param void *tmr_data - timer data * * @return none - * + * * * @pre (NULL) */ -void +void fsm_cac_process_bw_fail_timer (void *tmr_data) { const char fname[] = "fsm_cac_process_bw_fail_timer"; @@ -734,7 +699,7 @@ fsm_cac_process_bw_fail_timer (void *tmr_data) DEF_DEBUG(DEB_F_PREFIX"CAC request timedout %d.\n", DEB_F_PREFIX_ARGS("CAC", fname), (callid_t)(long)tmr_data); - /* Time-out causes same set of processing as bw failure + /* Time-out causes same set of processing as bw failure */ fsm_cac_process_bw_failed_resp(); diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/fsmcnf.c b/media/webrtc/signaling/src/sipcc/core/gsm/fsmcnf.c index ee4531a5d7f3..7f92bfc36776 100755 --- a/media/webrtc/signaling/src/sipcc/core/gsm/fsmcnf.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/fsmcnf.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdlib.h" @@ -448,7 +413,7 @@ fsmcnf_free_cb (fim_icb_t *icb, callid_t call_id) /** * * Cancel conference feature by sending cancel event to SIP stack. - * This routine is used in roundtable phone. + * This routine is used in roundtable phone. * * Copied and pasted from fsmb2bcnf_feature_cancel(). * See also fsmxfr_feature_cancel(). @@ -460,7 +425,7 @@ fsmcnf_free_cb (fim_icb_t *icb, callid_t call_id) * @pre (none) */ void -fsmcnf_feature_cancel (fsmcnf_ccb_t *ccb, line_t line, callid_t call_id, +fsmcnf_feature_cancel (fsmcnf_ccb_t *ccb, line_t line, callid_t call_id, callid_t target_call_id) { cc_feature_data_t data; @@ -474,7 +439,7 @@ fsmcnf_feature_cancel (fsmcnf_ccb_t *ccb, line_t line, callid_t call_id, if (/*(cause == CC_SK_EVT_TYPE_EXPLI) && */ (fcb_def != NULL) && ((fcb_def->dcb->selected == FALSE) && ((fcb_def->state == FSMDEF_S_OUTGOING_ALERTING) || - ((fcb_def->state == FSMDEF_S_CONNECTED) && + ((fcb_def->state == FSMDEF_S_CONNECTED) && (fcb_def->dcb->spoof_ringout_requested == TRUE) && (fcb_def->dcb->spoof_ringout_applied == TRUE))))) { @@ -487,7 +452,7 @@ fsmcnf_feature_cancel (fsmcnf_ccb_t *ccb, line_t line, callid_t call_id, if (/* (cause == CC_SK_EVT_TYPE_EXPLI) && */ (fcb_def != NULL) && ((fcb_def->dcb->selected == FALSE) && ((fcb_def->state == FSMDEF_S_OUTGOING_ALERTING) || - ((fcb_def->state == FSMDEF_S_CONNECTED) && + ((fcb_def->state == FSMDEF_S_CONNECTED) && (fcb_def->dcb->spoof_ringout_requested == TRUE) && (fcb_def->dcb->spoof_ringout_applied == TRUE))))) { @@ -531,7 +496,7 @@ fsmcnf_ev_idle_setup (sm_event_t *event) return (SM_RC_DEF_CONT); } - /* This new call is part of a conference */ + /* This new call is part of a conference */ fcb->ccb = ccb; /* attach ccb to the new call chain */ fsm_change_state(fcb, __LINE__, FSMCNF_S_CNFING); @@ -580,7 +545,7 @@ fsmcnf_ev_idle_feature (sm_event_t *event) * call_id in the data then terminate the existing consulatative * call and link that to another call. */ - if (feat_data && msg->data_valid && + if (feat_data && msg->data_valid && (feat_data->cnf.target_call_id != CC_NO_CALL_ID) && (cns_fcb = fsm_get_fcb_by_call_id_and_type(feat_data->cnf.target_call_id, FSM_TYPE_CNF)) != NULL) { @@ -833,7 +798,7 @@ fsmcnf_ev_idle_feature (sm_event_t *event) ((fcb_def->state != FSMDEF_S_CONNECTED) && (fcb_def->state != FSMDEF_S_RESUME_PENDING))) { FSM_DEBUG_SM(DEB_L_C_F_PREFIX"Join target \ - call is not at connected state\n", + call is not at connected state\n", DEB_L_C_F_PREFIX_ARGS(FSM, line, call_id, fname)); break; } @@ -1011,7 +976,7 @@ fsmcnf_update_release (sm_event_t *event) FSM_TYPE_B2BCNF); xfr_fcb = fsm_get_fcb_by_call_id_and_type(other_call_id, FSM_TYPE_XFR); - if ((b2bcnf_fcb != NULL && b2bcnf_fcb->b2bccb == NULL) && + if ((b2bcnf_fcb != NULL && b2bcnf_fcb->b2bccb == NULL) && (xfr_fcb != NULL && xfr_fcb->xcb == NULL)) { cc_call_attribute(other_call_id, other_fcb->dcb->line, NORMAL_CALL); } @@ -1109,7 +1074,7 @@ fsmcnf_ev_cnfing_feature (sm_event_t *event) } /* * The answer to the a setup with replaced we have received. - * The setup with replaced is automatically answered + * The setup with replaced is automatically answered * by xfer state machine as UI source (simulate user pressing * the answer key). * @@ -1142,7 +1107,7 @@ fsmcnf_ev_cnfing_feature (sm_event_t *event) other_call_id = fsmcnf_get_other_call_id(ccb, call_id); other_dcb = fsm_get_dcb(other_call_id); - /* + /* * Since we are resuming the other leg, allocate the src_sdp * because src_sdp was freed and set to null when this other-leg * was put on hold. @@ -1164,7 +1129,7 @@ fsmcnf_ev_cnfing_feature (sm_event_t *event) if (other_fcb && other_fcb->state == FSMDEF_S_HOLDING) { other_dcb->session = LOCAL_CONF; - + cc_int_feature(CC_SRC_GSM, CC_SRC_GSM, other_dcb->call_id, other_dcb->line, CC_FEATURE_RESUME, &data); @@ -1205,8 +1170,8 @@ fsmcnf_ev_cnfing_feature (sm_event_t *event) feat_data->hold.call_info.data.hold_resume_reason != CC_REASON_CONF && feat_data->hold.call_info.data.hold_resume_reason != CC_REASON_INTERNAL)) { sm_rc = SM_RC_END; - DEF_DEBUG(DEB_F_PREFIX"Invoke hold call_id = %d t_call_id=%d\n", - DEB_F_PREFIX_ARGS(GSM, fname), ccb->cnf_call_id, ccb->cns_call_id); + DEF_DEBUG(DEB_F_PREFIX"Invoke hold call_id = %d t_call_id=%d\n", + DEB_F_PREFIX_ARGS(GSM, fname), ccb->cnf_call_id, ccb->cns_call_id); //Actual hold to this call, so break the feature layer. ui_terminate_feature(dcb->line, ccb->cnf_call_id, ccb->cns_call_id); @@ -1270,11 +1235,11 @@ fsmcnf_ev_cnfed_release (sm_event_t *event) fsm_fcb_t *other_fcb; cc_causes_t cause; - /* Conference is not active any more, clear that flag + /* Conference is not active any more, clear that flag */ ccb->active = FALSE; - - if( ccb->flags & JOINED ){ + + if( ccb->flags & JOINED ){ other_call_id = fsmcnf_get_other_call_id(ccb, call_id); if(other_call_id != CC_NO_CALL_ID ){ fsm_fcb_t *b2bcnf_fcb, *xfr_fcb; @@ -1282,7 +1247,7 @@ fsmcnf_ev_cnfed_release (sm_event_t *event) FSM_TYPE_B2BCNF); xfr_fcb = fsm_get_fcb_by_call_id_and_type(other_call_id, FSM_TYPE_XFR); - if ((b2bcnf_fcb != NULL && b2bcnf_fcb->b2bccb == NULL) && + if ((b2bcnf_fcb != NULL && b2bcnf_fcb->b2bccb == NULL) && (xfr_fcb != NULL && xfr_fcb->xcb == NULL)) { cc_call_attribute(other_call_id, dcb->line, NORMAL_CALL); } @@ -1338,7 +1303,7 @@ fsmcnf_ev_cnfed_release (sm_event_t *event) if (other_fcb != NULL) { other_fcb->ccb = ccb; - + fsm_change_state(other_fcb, __LINE__, FSMCNF_S_CNFED); action_data.update_ui.action = CC_UPDATE_CONF_ACTIVE; @@ -1404,7 +1369,7 @@ fsmcnf_ev_cnfed_feature (sm_event_t *event) * to end the call. */ config_get_value(CFGID_CNF_JOIN_ENABLE, &join, sizeof(join)); - if (((ccb->bridged == TRUE) && (join) && !(ccb->flags & JOINED)) || + if (((ccb->bridged == TRUE) && (join) && !(ccb->flags & JOINED)) || ((ccb->bridged == TRUE) && (ccb->flags & XFER))) { fsmcnf_cnf_xfer(ccb); @@ -1478,7 +1443,7 @@ fsmcnf_ev_cnfed_feature (sm_event_t *event) case CC_SRC_SIP: switch (ftr_id) { - case CC_FEATURE_CALLINFO: + case CC_FEATURE_CALLINFO: if ((ccb->flags & JOINED) && (call_id == ccb->cns_call_id)) { /* @@ -1486,7 +1451,7 @@ fsmcnf_ev_cnfed_feature (sm_event_t *event) * info event that came for the virtual bubble */ return (SM_RC_END); - } + } fsm_sm_ignore_ftr(fcb, __LINE__, ftr_id); break; @@ -1513,7 +1478,7 @@ fsmcnf_ev_cnfed_feature (sm_event_t *event) fsmcnf_update_cnf_context(ccb, call_id, msg->data.xfer.target_call_id); /* Drop this call from conferenced */ - fsmcnf_cleanup(fcb, __LINE__, FALSE); + fsmcnf_cleanup(fcb, __LINE__, FALSE); } else { fsm_sm_ignore_ftr(fcb, __LINE__, ftr_id); } @@ -1525,7 +1490,7 @@ fsmcnf_ev_cnfed_feature (sm_event_t *event) } break; - default: + default: fsm_sm_ignore_ftr(fcb, __LINE__, ftr_id); break; } @@ -1647,7 +1612,7 @@ fsmcnf_ev_cnfed_onhook (sm_event_t *event) * flag to dcb of cns_call_id to know of the event, * and vice versa. We do not want to process more than * one onhook for calls in a conf call. Note that this is - * needed because when in Speaker mode, onhook event is + * needed because when in Speaker mode, onhook event is * sent to each call_id in active state. */ if (fcb->call_id == ccb->cnf_call_id) { diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/fsmdef.c b/media/webrtc/signaling/src/sipcc/core/gsm/fsmdef.c index 17ccf2d1cb94..248f7e5db389 100755 --- a/media/webrtc/signaling/src/sipcc/core/gsm/fsmdef.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/fsmdef.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include @@ -800,19 +765,19 @@ fsmdef_check_if_chaperone_call_exist (void) } -void fsmdef_get_rtp_stat (fsmdef_dcb_t *dcb , cc_kfact_t *kfactor) +void fsmdef_get_rtp_stat (fsmdef_dcb_t *dcb , cc_kfact_t *kfactor) { static const char fname[] ="fsmdef_get_rtp_stat"; - + int call_stats_flag; fsmdef_media_t *media; - media = gsmsdp_find_audio_media(dcb); + media = gsmsdp_find_audio_media(dcb); if (!media) { GSM_ERR_MSG(GSM_F_PREFIX"dcb media pointer invalid\n", fname); return; } - + memset(kfactor, 0, sizeof(cc_kfact_t)); config_get_value(CFGID_CALL_STATS, &call_stats_flag, sizeof(call_stats_flag)); @@ -837,7 +802,7 @@ void fsmdef_get_rtp_stat (fsmdef_dcb_t *dcb , cc_kfact_t *kfactor) * @pre (dcb not_eq NULL) */ static void -fsmdef_update_media_hold_status (fsmdef_dcb_t *dcb, fsmdef_media_t *media, +fsmdef_update_media_hold_status (fsmdef_dcb_t *dcb, fsmdef_media_t *media, boolean set) { fsmdef_media_t *start_media, *end_media; @@ -880,7 +845,7 @@ fsmdef_all_media_are_local_hold (fsmdef_dcb_t *dcb) fsmdef_media_t *media; /* * Check the local hold status of each media to see if the - * media is already locally held or not. + * media is already locally held or not. */ GSMSDP_FOR_ALL_MEDIA(media, dcb) { if (!GSMSDP_MEDIA_ENABLED(media)) { @@ -916,10 +881,10 @@ fsmdef_num_media_in_local_hold (fsmdef_dcb_t *dcb) continue; } if (FSM_CHK_FLAGS(media->hold, FSM_HOLD_LCL)) { - num_local_hold++; + num_local_hold++; } } - return (num_local_hold); + return (num_local_hold); } /** @@ -993,7 +958,7 @@ fsmdef_init_dcb (fsmdef_dcb_t *dcb, callid_t call_id, dcb->caller_id.called_name = strlib_empty(); dcb->caller_id.called_number = strlib_empty(); dcb->caller_id.orig_rpid_number = strlib_empty(); - + dcb->inbound = FALSE; break; @@ -1011,7 +976,7 @@ fsmdef_init_dcb (fsmdef_dcb_t *dcb, callid_t call_id, dcb->caller_id.orig_called_name = strlib_empty(); dcb->caller_id.orig_called_number = strlib_empty(); dcb->caller_id.orig_rpid_number = strlib_empty(); - + sip_config_get_display_name(line, name, sizeof(name)); dcb->caller_id.called_name = strlib_update(dcb->caller_id.called_name, name); @@ -1128,7 +1093,7 @@ fsmdef_init_dcb (fsmdef_dcb_t *dcb, callid_t call_id, } /* clear all bit flags */ - dcb->flags = 0; + dcb->flags = 0; dcb->onhook_received = FALSE; dcb->cur_video_avail = SDP_DIRECTION_INACTIVE; @@ -1142,7 +1107,7 @@ fsmdef_init_dcb (fsmdef_dcb_t *dcb, callid_t call_id, } gsmsdp_init_media_list(dcb); - + dcb->join_call_id = CC_NO_CALL_ID; dcb->callref = 0; @@ -1173,7 +1138,7 @@ fsmdef_free_dcb (fsmdef_dcb_t *dcb) strlib_free(dcb->caller_id.orig_called_name); strlib_free(dcb->caller_id.orig_called_number); strlib_free(dcb->caller_id.orig_rpid_number); - + /* Cancel any existing error onhook timer */ if (dcb->err_onhook_tmr) { (void) cprCancelTimer(dcb->err_onhook_tmr); @@ -1210,7 +1175,7 @@ fsmdef_free_dcb (fsmdef_dcb_t *dcb) * Cache random numbers for SRTP keys */ gsmsdp_cache_crypto_keys(); - + } void @@ -1361,8 +1326,8 @@ fsmdef_get_active_call_cnt (callid_t callId) * return the dcbs and count of calls that are ringing and * are in error state not including the given call_id * - * @param pointer to dcbs array - * @param call_id that should be ignored from search + * @param pointer to dcbs array + * @param call_id that should be ignored from search * * @return int number of ringing or error state calls * @@ -1415,9 +1380,9 @@ void fsmdef_call_cc_state_dialing (fsmdef_dcb_t *dcb, boolean suppress) } else { data.play_dt = FALSE; } - + data.suppress_stutter = suppress; - + cc_call_state(dcb->call_id, dcb->line, CC_STATE_DIALING, (cc_state_data_t *)(&data)); } @@ -1500,9 +1465,9 @@ boolean fsmdef_are_join_calls_on_same_line (line_t line) * * Handles media capability update feature event from platform when * media stream capability changes. - * + * * @param[in]msg - pointer to the cc_feature_t. - * + * * @return None. * * @pre (msg not_eq NULL) @@ -1517,17 +1482,17 @@ fsmdef_update_media_cap_feature_event (cc_feature_t *msg) FSM_DEBUG_SM(DEB_L_C_F_PREFIX"\n", DEB_L_C_F_PREFIX_ARGS(FSM, msg->line, msg->call_id, fname)); /* - * Find the connected call to send the media capability update - * event to. There can be more than one call chains in + * Find the connected call to send the media capability update + * event to. There can be more than one call chains in * connected state for an example, a call that participates in * local conference, barged, monitored. All calls that - * are active are sent the update event. Each call leg will handle + * are active are sent the update event. Each call leg will handle * the event. - * + * */ FSM_FOR_ALL_CBS(dcb, fsmdef_dcbs, FSMDEF_MAX_DCBS) { if (dcb->call_id != CC_NO_CALL_ID) { - fcb = dcb->fcb; + fcb = dcb->fcb; if ((fcb != NULL) && (fcb->state == FSMDEF_S_RESUME_PENDING || fcb->state == FSMDEF_S_CONNECTED)) { cc_int_feature(CC_SRC_GSM, CC_SRC_GSM, dcb->call_id, @@ -1615,11 +1580,11 @@ fsmdef_find_and_hold_connected_call (callid_t call_id, boolean *wait, /* * Function post a event to end the call which are in ringing - * reorder or busy and connecting state. This would indicate call function to + * reorder or busy and connecting state. This would indicate call function to * wait on the existing event. * - * @param call_id that should be ignored from search - * @param pointer to boolean to indicate if the caller has to wait + * @param call_id that should be ignored from search + * @param pointer to boolean to indicate if the caller has to wait * * @return none * @@ -1654,8 +1619,8 @@ fsmdef_find_and_handle_ring_connecting_releasing_calls (callid_t call_id, boolea } else if (act_dcb->fcb->state == FSMDEF_S_CONNECTING) { /* If the call is in connecting state, then wait till SIP - * response to get the call in connected state. - * The call can be put on hold only when call is connected. + * response to get the call in connected state. + * The call can be put on hold only when call is connected. */ *wait = TRUE; } @@ -1787,7 +1752,7 @@ fsmdef_get_cause (boolean data_valid, cc_feature_data_t *data) * * Otherwise, it cleans up dcb and releases fcb and * return SM_RC_CLEANUP to the caller. - * + * * If the SM_RC_CLEANUP is returned, the caller should * terminate any access or perform any operation * afterward. @@ -1987,7 +1952,7 @@ fsmdef_compare_caller_id (cc_caller_id_t *dest_caller_id, src_caller_id->last_redirect_number)) { return (TRUE); } - + if (fsmdef_compare_caller_id_string(dest_caller_id->orig_rpid_number, src_caller_id->orig_rpid_number)) { return (TRUE); @@ -2072,16 +2037,16 @@ fsmdef_update_callinfo (fsm_fcb_t *fcb, cc_feature_t *msg) */ fsmdef_update_callinfo_security_status(dcb, &feat_data->call_info); - /* - * Update call policy - */ - if (feat_data->call_info.feature_flag & CC_POLICY) { - if (dcb->policy != feat_data->call_info.policy) { - dcb->policy = feat_data->call_info.policy; - dcb->ui_update_required = TRUE; - } + /* + * Update call policy + */ + if (feat_data->call_info.feature_flag & CC_POLICY) { + if (dcb->policy != feat_data->call_info.policy) { + dcb->policy = feat_data->call_info.policy; + dcb->ui_update_required = TRUE; + } } - + /* * Save orientation so that UI call update can be done at * any time that UI needs to be updated. @@ -2110,7 +2075,7 @@ fsmdef_update_callinfo (fsm_fcb_t *fcb, cc_feature_t *msg) /* * Only perform a UI update if something changed. */ - if (dcb->ui_update_required == TRUE + if (dcb->ui_update_required == TRUE || dcb->spoof_ringout_requested == TRUE) { action_data.update_ui.action = CC_UPDATE_CALLER_INFO; @@ -2144,23 +2109,23 @@ fsmdef_update_callinfo (fsm_fcb_t *fcb, cc_feature_t *msg) /** * Function: fsmdef_set_feature_timer - * + * * Description: This function is called to set (start) timer for a * given timer. The context of the timer is set so that upon * expiration the corresponding context (dcb) can be obtained. * - * Parameters: - * dcb - pointer to the fsmdef_dcb_t. The caller must ensure + * Parameters: + * dcb - pointer to the fsmdef_dcb_t. The caller must ensure * dcb is not NULL. * timer - pointer to cprTimer_t. The caller must ensure that - * timer is not NULL. + * timer is not NULL. * duration - the time duration for the timer to be set. * - * Returns: + * Returns: * N/A. */ static void -fsmdef_set_feature_timer (fsmdef_dcb_t *dcb, cprTimer_t *timer, +fsmdef_set_feature_timer (fsmdef_dcb_t *dcb, cprTimer_t *timer, uint32_t duration) { static const char fname[] = "fsmdef_set_feature_timer"; @@ -2271,29 +2236,29 @@ fsmdef_ev_default_feature_ack (sm_event_t *event) dcb->selected = FALSE; g_numofselected_calls--; FSM_DEBUG_SM(DEB_L_C_F_PREFIX"call is unselected and number of selected \ - calls on the phone is %d\n", + calls on the phone is %d\n", DEB_L_C_F_PREFIX_ARGS(FSM, dcb->line, msg->call_id, fname), g_numofselected_calls); - + } else { dcb->selected = TRUE; - if ((g_b2bjoin_pending == FALSE) && + if ((g_b2bjoin_pending == FALSE) && (dcb->active_feature == CC_FEATURE_B2B_JOIN)) { g_b2bjoin_pending = TRUE; g_b2bjoin_callid = dcb->call_id; } g_numofselected_calls++; FSM_DEBUG_SM(DEB_L_C_F_PREFIX"call is selected and number of selected \ - calls on the phone is %d\n", + calls on the phone is %d\n", DEB_L_C_F_PREFIX_ARGS(FSM, dcb->line, dcb->call_id, fname), - g_numofselected_calls); + g_numofselected_calls); } ui_call_selected(dcb->line, lsm_get_ui_id(dcb->call_id), (dcb->selected)?CC_DIALOG_LOCKED:CC_DIALOG_UNLOCKED); } else if (dcb->active_feature != ftr_id) { // check if we are getting feature_ack for the active feature FSM_DEBUG_SM(DEB_L_C_F_PREFIX"feature_ack rcvd for %s but %s is active\n", - DEB_L_C_F_PREFIX_ARGS(FSM, dcb->line, dcb->call_id, fname), + DEB_L_C_F_PREFIX_ARGS(FSM, dcb->line, dcb->call_id, fname), cc_feature_name(ftr_id), cc_feature_name(dcb->active_feature)); } @@ -2331,7 +2296,7 @@ fsmdef_sm_ignore_src (fsm_fcb_t *fcb, int fname, cc_srcs_t src_id) * * Timer is started immediately after the call error. This function is called * when there is a timeout event generated by the timer . - * + * * @param[in] data The gsm ID (callid_t) of the call onhook timeout * has occured. * @@ -2369,7 +2334,7 @@ fsmdef_error_onhook_timeout (void *data) /** * Function: fsmdef_feature_timer_timeout * - * Description: This function is called when receives time out + * Description: This function is called when receives time out * notification. The function then converts the timer event * into the CCAPI event suitable for GSM's call state machine. * @@ -2380,7 +2345,7 @@ fsmdef_error_onhook_timeout (void *data) * * Returns: * NULL or - * pointer to the cc_feature_t. + * pointer to the cc_feature_t. */ void * fsmdef_feature_timer_timeout (cc_features_t feature_id, void *data) @@ -2405,7 +2370,7 @@ fsmdef_feature_timer_timeout (cc_features_t feature_id, void *data) FSM_DEBUG_SM(get_debug_string(FSMDEF_DBG_INVALID_DCB), fname); return (NULL); } - + if (dcb->inband_received && feature_id == CC_FEATURE_RINGBACK_DELAY_TIMER_EXP) { /* Double check if inbound ringback indication is received*/ FSM_DEBUG_SM(get_debug_string(FSMDEF_DBG1), 0, 0, fname, "inband received!"); @@ -2485,7 +2450,7 @@ fsmdef_ev_idle_setup (sm_event_t *event) } FSM_DEBUG_SM(DEB_L_C_F_PREFIX"called_number= %s calling_number= %s\n", - DEB_L_C_F_PREFIX_ARGS(FSM, msg->line, msg->call_id, fname), + DEB_L_C_F_PREFIX_ARGS(FSM, msg->line, msg->call_id, fname), msg->caller_id.called_number, msg->caller_id.calling_number); //idle = lsm_is_phone_idle(); @@ -2527,7 +2492,7 @@ fsmdef_ev_idle_setup (sm_event_t *event) * avoid updating UI when call info is received in "ACK" which * shoule be "from" for typicall incoming call. */ - dcb->orientation = CC_ORIENTATION_FROM; + dcb->orientation = CC_ORIENTATION_FROM; switch (cause) { case CC_CAUSE_OK: @@ -2634,14 +2599,14 @@ fsmdef_ev_idle_setup (sm_event_t *event) data = &msg->call_info.data.call_info_feat_data; if (data->feature_flag & CC_CALL_INSTANCE) { - if (data->caller_id.call_instance_id != 0 && - data->caller_id.call_instance_id != + if (data->caller_id.call_instance_id != 0 && + data->caller_id.call_instance_id != dcb->caller_id.call_instance_id) { if (dcb->caller_id.call_instance_id != 0) { - fsmutil_free_ci_id(dcb->caller_id.call_instance_id, + fsmutil_free_ci_id(dcb->caller_id.call_instance_id, dcb->line); } - dcb->caller_id.call_instance_id = + dcb->caller_id.call_instance_id = data->caller_id.call_instance_id; fsmutil_set_ci_id(dcb->caller_id.call_instance_id, dcb->line); } @@ -2650,7 +2615,7 @@ fsmdef_ev_idle_setup (sm_event_t *event) if (data->feature_flag & CC_SECURITY) { FSM_SET_SECURITY_STATUS(dcb, data->security); } - + if (data->feature_flag & CC_POLICY) { FSM_SET_POLICY(dcb, data->policy); } @@ -2728,7 +2693,7 @@ fsmdef_ev_idle_setup (sm_event_t *event) (msg->call_info.data.call_info_feat_data.dusting == TRUE)) { lsm_set_lcb_dusting_call(call_id); } - + cc_call_state(dcb->call_id, dcb->line, CC_STATE_ALERTING, FSMDEF_CC_CALLER_ID); /* @@ -2813,7 +2778,7 @@ fsmdef_dialstring (fsm_fcb_t *fcb, const char *dialstring, /* Force clean up call without sending release */ return (fsmdef_release(fcb, cause, FALSE)); } - + /* * Since we are sending setup to UI we will also have to send * release to it to for sip stack to clean up the call @@ -2886,8 +2851,8 @@ fsmdef_ev_dialstring (sm_event_t *event) /** * fsmdef_ev_createoffer * - * Generates Offer SDP - * + * Generates Offer SDP + * */ static sm_rcs_t fsmdef_ev_createoffer (sm_event_t *event) { @@ -2906,18 +2871,18 @@ fsmdef_ev_createoffer (sm_event_t *event) { short vcm_res; FSM_DEBUG_SM(DEB_F_PREFIX"Entered.\n", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__)); - + config_get_value(CFGID_SDPMODE, &sdpmode, sizeof(sdpmode)); if (!sdpmode) { /* Force clean up call without sending release */ return (fsmdef_release(fcb, cause, FALSE)); } - + if (dcb == NULL) { FSM_DEBUG_SM(DEB_F_PREFIX"dcb is NULL.\n", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__)); return SM_RC_CLEANUP; } - + vcmGetIceParams(dcb->peerconnection, &ufrag, &ice_pwd); if (!ufrag || !ice_pwd) { ui_create_offer(evCreateOfferError, line, call_id, dcb->caller_id.call_instance_id, NULL); @@ -2952,15 +2917,15 @@ fsmdef_ev_createoffer (sm_event_t *event) { if (cause != CC_CAUSE_OK) { ui_create_offer(evCreateOfferError, line, call_id, dcb->caller_id.call_instance_id, NULL); FSM_DEBUG_SM(get_debug_string(FSM_DBG_SDP_BUILD_ERR)); - return (fsmdef_release(fcb, cause, FALSE)); + return (fsmdef_release(fcb, cause, FALSE)); } - + cause = gsmsdp_encode_sdp_and_update_version(dcb, &msg_body); if (cause != CC_CAUSE_OK) { ui_create_offer(evCreateOfferError, line, call_id, dcb->caller_id.call_instance_id, NULL); FSM_DEBUG_SM(get_debug_string(FSM_DBG_SDP_BUILD_ERR)); return (fsmdef_release(fcb, cause, FALSE)); - } + } /* Pass offer SDP back to UI */ ui_create_offer(evCreateOffer, line, call_id, dcb->caller_id.call_instance_id, msg_body.parts[0].body); @@ -2973,7 +2938,7 @@ fsmdef_ev_createoffer (sm_event_t *event) { * fsmdef_ev_createanswer * * Generates Answer SDP - * + * */ static sm_rcs_t fsmdef_ev_createanswer (sm_event_t *event) { @@ -2984,11 +2949,11 @@ fsmdef_ev_createanswer (sm_event_t *event) { cc_causes_t cause = CC_CAUSE_NORMAL; cc_msgbody_info_t msg_body; line_t line = msg->line; - callid_t call_id = msg->call_id; + callid_t call_id = msg->call_id; line_t free_line; int sdpmode = 0; const char *called_number = "1234"; - cc_causes_t lsm_rc; + cc_causes_t lsm_rc; cc_msgbody_t *part; uint32_t body_length; char *ufrag = NULL; @@ -2996,11 +2961,11 @@ fsmdef_ev_createanswer (sm_event_t *event) { short vcm_res; FSM_DEBUG_SM(DEB_F_PREFIX"Entered.\n", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__)); - + config_get_value(CFGID_SDPMODE, &sdpmode, sizeof(sdpmode)); if (!sdpmode) { return (fsmdef_release(fcb, cause, FALSE)); - } + } if (dcb == NULL) { FSM_DEBUG_SM(DEB_F_PREFIX"dcb is NULL.\n", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__)); @@ -3027,7 +2992,7 @@ fsmdef_ev_createanswer (sm_event_t *event) { sstrncpy(dcb->ice_pwd, ice_pwd, strlen(ice_pwd) + 1); free(ice_pwd); - + vcm_res = vcmGetDtlsIdentity(dcb->peerconnection, dcb->digest_alg, FSMDEF_MAX_DIGEST_ALG_LEN, dcb->digest, FSMDEF_MAX_DIGEST_LEN); @@ -3045,8 +3010,8 @@ fsmdef_ev_createanswer (sm_event_t *event) { if (cause != CC_CAUSE_OK) { ui_create_answer(evCreateAnswerError, line, call_id, dcb->caller_id.call_instance_id, NULL); FSM_DEBUG_SM(get_debug_string(FSM_DBG_SDP_BUILD_ERR)); - // Force clean up call without sending release - return (fsmdef_release(fcb, cause, FALSE)); + // Force clean up call without sending release + return (fsmdef_release(fcb, cause, FALSE)); } /* TODO(ekr@rtfm.com): The second true is because we are acting as if we are @@ -3058,14 +3023,14 @@ fsmdef_ev_createanswer (sm_event_t *event) { ui_create_answer(evCreateAnswerError, line, call_id, dcb->caller_id.call_instance_id, NULL); return (fsmdef_release(fcb, cause, FALSE)); } - + cause = gsmsdp_encode_sdp_and_update_version(dcb, &msg_body); if (cause != CC_CAUSE_OK) { ui_create_answer(evCreateAnswerError, line, call_id, dcb->caller_id.call_instance_id, NULL); FSM_DEBUG_SM(get_debug_string(FSM_DBG_SDP_BUILD_ERR)); - return (fsmdef_release(fcb, cause, FALSE)); + return (fsmdef_release(fcb, cause, FALSE)); } - + /* Pass SDP back to UI */ ui_create_answer(evCreateAnswer, line, call_id, dcb->caller_id.call_instance_id, msg_body.parts[0].body); @@ -3077,22 +3042,22 @@ fsmdef_ev_createanswer (sm_event_t *event) { * SetLocalDescription * */ -static sm_rcs_t +static sm_rcs_t fsmdef_ev_setlocaldesc(sm_event_t *event) { fsm_fcb_t *fcb = (fsm_fcb_t *) event->data; fsmdef_dcb_t *dcb = fcb->dcb; - cc_feature_t *msg = (cc_feature_t *) event->msg; + cc_feature_t *msg = (cc_feature_t *) event->msg; cc_causes_t cause = CC_CAUSE_NORMAL; cc_msgbody_info_t msg_body; int action = msg->action; string_t sdp = msg->sdp; int sdpmode = 0; callid_t call_id = msg->call_id; - line_t line = msg->line; - cc_causes_t lsm_rc; + line_t line = msg->line; + cc_causes_t lsm_rc; FSM_DEBUG_SM(DEB_F_PREFIX"Entered.\n", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__)); - + config_get_value(CFGID_SDPMODE, &sdpmode, sizeof(sdpmode)); if (!sdpmode) { ui_set_local_description(evSetLocalDescError, line, call_id, dcb->caller_id.call_instance_id, NULL, PC_SETLOCALDESCERROR); @@ -3103,15 +3068,15 @@ fsmdef_ev_setlocaldesc(sm_event_t *event) { FSM_DEBUG_SM(DEB_F_PREFIX"dcb is NULL.\n", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__)); return SM_RC_CLEANUP; } - + if (JSEP_OFFER == action) { cause = gsmsdp_encode_sdp(dcb->sdp, &msg_body); if (cause != CC_CAUSE_OK) { FSM_DEBUG_SM(get_debug_string(FSM_DBG_SDP_BUILD_ERR)); ui_set_local_description(evSetLocalDescError, line, call_id, dcb->caller_id.call_instance_id, NULL, PC_SETLOCALDESCERROR); - return (SM_RC_END); + return (SM_RC_END); } - + /* compare and fail if different: * anant: Why? The JS should be able to modify the SDP. Commenting out for now (same for answer) if (strcmp(msg_body.parts[0].body, sdp) != 0) { @@ -3131,7 +3096,7 @@ fsmdef_ev_setlocaldesc(sm_event_t *event) { ui_set_local_description(evSetLocalDescError, line, call_id, dcb->caller_id.call_instance_id, NULL, PC_SETLOCALDESCERROR); return (SM_RC_END); } - + /* compare and fail if different if (strcmp(msg_body.parts[0].body, sdp) != 0) { ui_set_local_description(evSetLocalDescError, line, call_id, dcb->caller_id.call_instance_id, NULL, PC_SDPCHANGED); @@ -3140,7 +3105,7 @@ fsmdef_ev_setlocaldesc(sm_event_t *event) { FSM_SET_FLAGS(dcb->msgs_sent, FSMDEF_MSG_CONNECTED); - + cc_call_state(dcb->call_id, dcb->line, CC_STATE_ANSWERED, FSMDEF_CC_CALLER_ID); @@ -3171,21 +3136,21 @@ fsmdef_ev_setlocaldesc(sm_event_t *event) { * to handle media capability changes, needs discussion * fsmdef_transition_to_connected(fcb); */ - fsm_change_state(fcb, __LINE__, FSMDEF_S_CONNECTED); + fsm_change_state(fcb, __LINE__, FSMDEF_S_CONNECTED); } - + ui_set_local_description(evSetLocalDesc, line, call_id, dcb->caller_id.call_instance_id, NULL, PC_OK); return (SM_RC_END); } -/** +/** * SetRemoteDescription * */ -static sm_rcs_t +static sm_rcs_t fsmdef_ev_setremotedesc(sm_event_t *event) { fsm_fcb_t *fcb = (fsm_fcb_t *) event->data; fsmdef_dcb_t *dcb = fcb->dcb; @@ -3194,7 +3159,7 @@ fsmdef_ev_setremotedesc(sm_event_t *event) { int action = msg->action; int sdpmode = 0; callid_t call_id = msg->call_id; - line_t line = msg->line; + line_t line = msg->line; cc_causes_t lsm_rc; cc_msgbody_t *part; uint32_t body_length; @@ -3214,7 +3179,7 @@ fsmdef_ev_setremotedesc(sm_event_t *event) { } cc_initialize_msg_body_parts_info(&msg_body); - + msg_body.num_parts = 1; msg_body.content_type = cc_content_type_SDP; part = &msg_body.parts[0]; @@ -3257,7 +3222,7 @@ fsmdef_ev_setremotedesc(sm_event_t *event) { fsm_change_state(fcb, __LINE__, FSMDEF_S_INCOMING_ALERTING); } else if (JSEP_ANSWER == action) { - + cause = gsmsdp_negotiate_answer_sdp(fcb, &msg_body); if (cause != CC_CAUSE_OK) { ui_set_remote_description(evSetRemoteDescError, line, call_id, dcb->caller_id.call_instance_id, NULL, PC_SETREMOTEDESCERROR); @@ -3284,14 +3249,14 @@ fsmdef_ev_setremotedesc(sm_event_t *event) { fsm_change_state(fcb, __LINE__, FSMDEF_S_CONNECTED); } - + ui_set_remote_description(evSetRemoteDesc, line, call_id, dcb->caller_id.call_instance_id, NULL, PC_OK); - + return (SM_RC_END); } -static sm_rcs_t +static sm_rcs_t fsmdef_ev_localdesc(sm_event_t *event) { fsm_fcb_t *fcb = (fsm_fcb_t *) event->data; fsmdef_dcb_t *dcb = fcb->dcb; @@ -3308,17 +3273,17 @@ fsmdef_ev_localdesc(sm_event_t *event) { if (!sdpmode) { return (SM_RC_END); } - + if (dcb == NULL) { FSM_DEBUG_SM(DEB_F_PREFIX"dcb is NULL.\n", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__)); return SM_RC_CLEANUP; } - + return (SM_RC_END); } -static sm_rcs_t +static sm_rcs_t fsmdef_ev_remotedesc(sm_event_t *event) { fsm_fcb_t *fcb = (fsm_fcb_t *) event->data; fsmdef_dcb_t *dcb = fcb->dcb; @@ -3346,7 +3311,7 @@ fsmdef_ev_remotedesc(sm_event_t *event) { } -static sm_rcs_t +static sm_rcs_t fsmdef_ev_setpeerconnection(sm_event_t *event) { fsm_fcb_t *fcb = (fsm_fcb_t *) event->data; fsmdef_dcb_t *dcb = fcb->dcb; @@ -3361,14 +3326,14 @@ fsmdef_ev_setpeerconnection(sm_event_t *event) { config_get_value(CFGID_SDPMODE, &sdpmode, sizeof(sdpmode)); if (!sdpmode) { return (SM_RC_END); - } - + } + if (!msg) return SM_RC_END; if (!msg->data_valid) return SM_RC_END; - + if (dcb == NULL) { dcb = fsmdef_get_new_dcb(call_id); if (dcb == NULL) { @@ -3577,7 +3542,7 @@ fsmdef_ev_idle_feature (sm_event_t *event) // handle cfwd event for ccm and non-ccm cases // process feature event only if no other active feature - if ((dcb->active_feature == CC_FEATURE_NONE) && + if ((dcb->active_feature == CC_FEATURE_NONE) && (fsmdef_get_connected_call() == NULL)) { dcb->active_feature = ftr_id; (void) fsmdef_process_cfwd_softkey_event(event); @@ -3830,7 +3795,7 @@ fsmdef_offhook (fsm_fcb_t *fcb, cc_msgs_t msg_id, callid_t call_id, fsmdef_find_and_hold_connected_call(call_id, &wait, CC_SRC_GSM); fsmdef_find_and_handle_ring_connecting_releasing_calls(call_id, &wait2); - + fsmdef_clear_preserved_calls(&wait3); /* @@ -4000,10 +3965,10 @@ fsmdef_ev_session_audit (sm_event_t *event) FSM_DEBUG_SM(get_debug_string(FSMDEF_DBG_CLR_SPOOF_APPLD), dcb->call_id, dcb->line, fname); - if ((fcb->state != FSMDEF_S_HOLDING) && + if ((fcb->state != FSMDEF_S_HOLDING) && (fcb->state != FSMDEF_S_HOLD_PENDING)) { - /* - * If is at least one media entry that is not in loally held + /* + * If is at least one media entry that is not in loally held * then go to connected state. */ dcb->spoof_ringout_applied = FALSE; @@ -4020,7 +3985,7 @@ fsmdef_ev_collectinginfo_release (sm_event_t *event) { fsm_fcb_t *fcb = (fsm_fcb_t *) event->data; fsmdef_dcb_t *dcb = fcb->dcb; - + FSM_DEBUG_SM(DEB_F_PREFIX"Entered.\n", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__)); fsmdef_set_call_info_cc_call_state(dcb, CC_STATE_CALL_FAILED, CC_CAUSE_INVALID_NUMBER); @@ -4048,7 +4013,7 @@ fsmdef_ev_collectinginfo_release (sm_event_t *event) "Error Onhook", cpr_errno); return (SM_RC_CLEANUP); } - + return (SM_RC_END); } @@ -4065,7 +4030,7 @@ fsmdef_ev_collectinginfo_feature (sm_event_t *event) sm_rcs_t sm_rc = SM_RC_END; cc_causes_t cause; cc_feature_data_t *feature_data = &(msg->data); - + FSM_DEBUG_SM(DEB_F_PREFIX"Entered.\n", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__)); fsm_sm_ftr(ftr_id, src_id); @@ -4075,7 +4040,7 @@ fsmdef_ev_collectinginfo_feature (sm_event_t *event) dcb->video_pref = feature_data->caps.support_direction; break; case CC_FEATURE_END_CALL: - cause = fsmdef_get_cause(msg->data_valid, &(msg->data)); + cause = fsmdef_get_cause(msg->data_valid, &(msg->data)); if (fcb->state == FSMDEF_S_KPML_COLLECT_INFO) { /* Clean up and send release */ return (fsmdef_release(fcb, cause, TRUE)); @@ -4083,7 +4048,7 @@ fsmdef_ev_collectinginfo_feature (sm_event_t *event) else { /* Clean up without sending release */ return (fsmdef_release(fcb, cause, FALSE)); - } + } case CC_FEATURE_NUMBER: case CC_FEATURE_URL: @@ -4098,7 +4063,7 @@ fsmdef_ev_collectinginfo_feature (sm_event_t *event) break; case CC_FEATURE_CALLINFO: - fsmdef_update_callinfo(fcb, msg); + fsmdef_update_callinfo(fcb, msg); /* * lsm_set_lcb_prevent_ringing() will check if there is a RINGIN call * with the same GCID. If so, it will set a flag to prevent ringing. @@ -4157,7 +4122,7 @@ fsmdef_ev_collectinginfo_feature (sm_event_t *event) static sm_rcs_t fsmdef_ev_digit_begin (sm_event_t *event) { - static const char fname[] = "fsmdef_ev_digit_begin"; + static const char fname[] = "fsmdef_ev_digit_begin"; fsm_fcb_t *fcb = (fsm_fcb_t *) event->data; fsmdef_dcb_t *dcb = fcb->dcb; cc_digit_begin_t *msg = (cc_digit_begin_t *) event->msg; @@ -4300,13 +4265,13 @@ fsmdef_ev_callsent_release (sm_event_t *event) FSM_DEBUG_SM(DEB_F_PREFIX"Entered.\n", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__)); /* if UI_STATE of BUSY in 183 Call-Info is causing the release, - do not modify dcb->send_release */ + do not modify dcb->send_release */ if (cause != CC_CAUSE_UI_STATE_BUSY) { dcb->send_release = FALSE; } else { // CSCti63677 - if ((fcb->state == FSMDEF_S_OUTGOING_ALERTING) && - (dcb->inband_received == TRUE) && + if ((fcb->state == FSMDEF_S_OUTGOING_ALERTING) && + (dcb->inband_received == TRUE) && (dcb->placed_call_update_required)) { lsm_update_placed_callinfo(dcb); @@ -4353,7 +4318,7 @@ fsmdef_ev_callsent_release (sm_event_t *event) if (cause != CC_CAUSE_UI_STATE_BUSY) { cc_int_release_complete(CC_SRC_GSM, CC_SRC_SIP, dcb->call_id, dcb->line, cause, NULL); - } + } /* see if the SIP stack has aborted this call early for some reason * If SIP brought this down, we are still offhook on the UI, so * when we get the release_complete from the 200 for the BYE, we @@ -4393,18 +4358,18 @@ fsmdef_ev_callsent_release (sm_event_t *event) default: sm_rc = fsmdef_release(fcb, cause, dcb->send_release); if (sm_rc == SM_RC_CLEANUP) { - /* + /* * FSM release indicates clean up, do not continue * on since fcb and dcb have been freed or re-initialized. */ - return (sm_rc); + return (sm_rc); } } /* switch (cause) */ - /*UI_STATE of BUSY in 183 is causing the release, so + /*UI_STATE of BUSY in 183 is causing the release, so *don't change state. This is needed to support *callback feature. Since the callee is busy, we need - *update call UI status to "Busy" from "Ringout" to + *update call UI status to "Busy" from "Ringout" to *reflect this change. */ if (cause != CC_CAUSE_UI_STATE_BUSY) { @@ -4464,7 +4429,7 @@ fsmdef_ev_callsent_feature (sm_event_t *event) lsm_remove_lcb_prevent_ringing(dcb->call_id); /* * Since user press the end call, no need to wait to play the busy tone. - * So, clear the early_error_release and clean the fcb/dcb. + * So, clear the early_error_release and clean the fcb/dcb. */ dcb->early_error_release = FALSE; cause = fsmdef_get_cause(msg->data_valid, &(msg->data)); @@ -4495,7 +4460,7 @@ fsmdef_ev_callsent_feature (sm_event_t *event) case CC_FEATURE_CALLINFO: - fsmdef_update_calltype(fcb, msg); + fsmdef_update_calltype(fcb, msg); fsmdef_update_callinfo(fcb, msg); /* * lsm_set_lcb_prevent_ringing() will check if there is a RINGIN call @@ -4728,7 +4693,7 @@ fsmdef_handle_inalerting_offhook_answer (sm_event_t *event) if (cause != CC_CAUSE_OK) { FSM_DEBUG_SM(get_debug_string(FSM_DBG_SDP_BUILD_ERR)); return (fsmdef_release(fcb, cause, dcb->send_release)); - } + } /* For CCM, call_type indicate if the call is forwarded or not * for forwarded call display will be shown as "Forward", only @@ -4742,10 +4707,10 @@ fsmdef_handle_inalerting_offhook_answer (sm_event_t *event) if (!fsmdef_check_retain_fwd_info_state()) { dcb->call_type = FSMDEF_CALL_TYPE_INCOMING; /* - * Force us to update the UI so that any possible callinfo received + * Force us to update the UI so that any possible callinfo received * prior to the call is answered takes effect. */ - dcb->ui_update_required = TRUE; + dcb->ui_update_required = TRUE; } } @@ -4878,7 +4843,7 @@ fsmdef_transition_to_connected (fsm_fcb_t *fcb) FSM_DEBUG_SM(DEB_F_PREFIX"Entered.\n", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__)); if (dcb->req_pending_tmr) { - /* cancel any request pending timer, just in case */ + /* cancel any request pending timer, just in case */ (void) cprCancelTimer(dcb->req_pending_tmr); } @@ -4891,7 +4856,7 @@ fsmdef_transition_to_connected (fsm_fcb_t *fcb) return (sm_rc); } - + feature_data.resume.call_info.type = CC_FEAT_NONE; feature_data.resume.call_info.data.hold_resume_reason = CC_REASON_NONE; feature_data.resume.msg_body.num_parts = 0; @@ -4939,7 +4904,7 @@ fsmdef_ev_connected (sm_event_t *event) cause = gsmsdp_negotiate_answer_sdp(fcb, &msg->msg_body); if (cause != CC_CAUSE_OK) { - + cc_call_state(fcb->dcb->call_id, fcb->dcb->line, CC_STATE_UNKNOWN, NULL); return (fsmdef_release(fcb, cause, dcb->send_release)); @@ -5047,7 +5012,7 @@ fsmdef_ev_connected_ack (sm_event_t *event) * out to the remote end. The local SDP is updated by the way. * * @param[in]fcb - pointer to fsm_fcb_t - * + * * @return SM_RC_END or failrue. * * @pre (fcb not_eq NULL) @@ -5063,7 +5028,7 @@ fsm_hold_local_only (fsm_fcb_t *fcb) /* * Check local hold status, and allow request if the media is not - * locally held. + * locally held. */ if (fsmdef_all_media_are_local_hold(dcb)) { /* @@ -5096,13 +5061,13 @@ fsm_hold_local_only (fsm_fcb_t *fcb) cc_call_state(dcb->call_id, dcb->line, CC_STATE_HOLD, &state_data); /* set all the media to local hold */ - fsmdef_update_media_hold_status(dcb, NULL, TRUE); + fsmdef_update_media_hold_status(dcb, NULL, TRUE); fsm_change_state(fcb, __LINE__, FSMDEF_S_HOLDING); sipsdp_src_dest_free(CCSIP_DEST_SDP_BIT | CCSIP_SRC_SDP_BIT, &dcb->sdp); - + return (SM_RC_END); } @@ -5133,7 +5098,7 @@ fsm_hold_local (fsm_fcb_t *fcb, cc_feature_data_t *data_p, /* * Check local hold status, and allow request if the media is not - * locally held or the caller indicates that to resend the hold + * locally held or the caller indicates that to resend the hold * request (such as in glare resolution). */ if (!resend && fsmdef_all_media_are_local_hold(dcb)) { @@ -5162,12 +5127,12 @@ fsm_hold_local (fsm_fcb_t *fcb, cc_feature_data_t *data_p, dcb->call_id, dcb->line, fname); dcb->spoof_ringout_applied = FALSE; - - fsmdef_get_rtp_stat(dcb, &(data_p->hold.kfactor)); - /* put the call on hold before building the SDP as DSP - * will then be able to give us a full set of codecs - * CUCM doesn't like to see a change in codecs on the fly + fsmdef_get_rtp_stat(dcb, &(data_p->hold.kfactor)); + + /* put the call on hold before building the SDP as DSP + * will then be able to give us a full set of codecs + * CUCM doesn't like to see a change in codecs on the fly * ( i.e. without going to inactive state ) */ cc_call_state(dcb->call_id, dcb->line, CC_STATE_HOLD, &state_data); @@ -5192,7 +5157,7 @@ fsm_hold_local (fsm_fcb_t *fcb, cc_feature_data_t *data_p, } /* set all the media to local hold */ - fsmdef_update_media_hold_status(dcb, NULL, TRUE); + fsmdef_update_media_hold_status(dcb, NULL, TRUE); cc_int_feature(CC_SRC_GSM, CC_SRC_SIP, dcb->call_id, dcb->line, CC_FEATURE_HOLD, data_p); @@ -5201,7 +5166,7 @@ fsm_hold_local (fsm_fcb_t *fcb, cc_feature_data_t *data_p, sipsdp_src_dest_free(CCSIP_DEST_SDP_BIT | CCSIP_SRC_SDP_BIT, &dcb->sdp); - + return (SM_RC_END); } @@ -5223,7 +5188,7 @@ fsm_connected_media_pend_local_hold (fsm_fcb_t *fcb, cc_feature_data_t *data_p) FSM_DEBUG_SM(DEB_F_PREFIX"Entered.\n", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__)); - /* + /* * Check local hold status, and allow request if the media is not * locally held. */ @@ -5254,7 +5219,7 @@ fsm_connected_media_pend_local_hold (fsm_fcb_t *fcb, cc_feature_data_t *data_p) dcb->hold_reason = data_p->hold.call_info.data.hold_resume_reason; /* * reset feature hold pending flag in case that there are - * multiple hold feature received while waiting for + * multiple hold feature received while waiting for * glare resolution to resolve. */ FSM_RESET_FLAGS(dcb->flags, FSMDEF_F_HOLD_REQ_PENDING); @@ -5314,17 +5279,17 @@ fsmdef_remote_media (fsm_fcb_t *fcb, cc_feature_t *msg) * Case 1. * * negotiate offer without SDP will reset all local media entries - * to have all codecs included. This is to re-advertise the + * to have all codecs included. This is to re-advertise the * capabilities again. */ (void) gsmsdp_negotiate_offer_sdp(fcb, NULL, FALSE); - /* + /* * Update the media direction based on whether each media * stream is locally held or not before sending out the * offer SDP. */ - fsmdef_set_per_media_local_hold_sdp(dcb); + fsmdef_set_per_media_local_hold_sdp(dcb); (void)cc_call_action(dcb->call_id, dcb->line, CC_ACTION_STOP_MEDIA, NULL); (void)cc_call_action(dcb->call_id, dcb->line, CC_ACTION_START_RCV, @@ -5355,7 +5320,7 @@ fsmdef_remote_media (fsm_fcb_t *fcb, cc_feature_t *msg) * This is the answer to our previous offer, no need to * to ack to SIP this one. */ - send_ack = FALSE; + send_ack = FALSE; } else { /* This is a new offer */ @@ -5368,7 +5333,7 @@ fsmdef_remote_media (fsm_fcb_t *fcb, cc_feature_t *msg) if ((media) && (media->direction != SDP_DIRECTION_INACTIVE)) { fsmdef_get_rtp_stat(dcb, &(feature_data.resume.kfactor)); } - + cause = gsmsdp_negotiate_offer_sdp(fcb, &data->resume.msg_body, FALSE); if (cause != CC_CAUSE_OK) { @@ -5510,7 +5475,7 @@ fsmdef_ev_connected_feature (sm_event_t *event) } else { fsmdef_b2bjoin_invoke(dcb, data); } - return (SM_RC_END); + return (SM_RC_END); case CC_FEATURE_DIRTRXFR: case CC_FEATURE_UNDEFINED: @@ -5526,10 +5491,10 @@ fsmdef_ev_connected_feature (sm_event_t *event) /* FALL THRU */ case CC_FEATURE_UPD_MEDIA_CAP: /* - * Media capability update request, check to see if + * Media capability update request, check to see if * there is any change in media capability and transition * the pending state or stay in the connected state. - */ + */ sm_rc = fsmdef_transition_to_connected(fcb); return (sm_rc); @@ -5552,7 +5517,7 @@ fsmdef_ev_connected_feature (sm_event_t *event) case CC_FEATURE_MEDIA: /* * remote send media update which can be resume or - * or just media changes. + * or just media changes. */ sm_rc = fsmdef_remote_media(fcb, msg); return (sm_rc); @@ -5589,7 +5554,7 @@ fsmdef_ev_connected_feature (sm_event_t *event) } /* - * For chaperone call, we will update call state here, to update + * For chaperone call, we will update call state here, to update * the related key's status. */ if(dcb->policy == CC_POLICY_CHAPERONE){ @@ -5689,7 +5654,7 @@ fsmdef_ev_connected_media_pend_feature (sm_event_t *event) case CC_FEATURE_REQ_PEND_TIMER_EXP: /* - * Glare resolution timer expires. + * Glare resolution timer expires. */ if (FSM_CHK_FLAGS(dcb->flags, FSMDEF_F_HOLD_REQ_PENDING)) { /* There is a hold feature pending, send out hold instead */ @@ -5701,14 +5666,14 @@ fsmdef_ev_connected_media_pend_feature (sm_event_t *event) feature_data.hold.call_info.data.call_info_feat_data.protect = FALSE; FSM_RESET_FLAGS(dcb->flags, FSMDEF_F_HOLD_REQ_PENDING); return (fsm_hold_local(fcb, &feature_data, FALSE)); - } + } /* * Check the possible media capbility changes. */ (void)gsmsdp_update_local_sdp_media_capability(dcb, FALSE, FALSE); feature_data.resume.call_info.type = CC_FEAT_NONE; - feature_data.resume.call_info.data.hold_resume_reason = + feature_data.resume.call_info.data.hold_resume_reason = CC_REASON_NONE; feature_data.resume.msg_body.num_parts = 0; feature_data.resume.call_info.data.call_info_feat_data.swap = FALSE; @@ -5716,12 +5681,12 @@ fsmdef_ev_connected_media_pend_feature (sm_event_t *event) /* Encode SDP */ cause = gsmsdp_encode_sdp_and_update_version(dcb, &feature_data.resume.msg_body); - + if (cause != CC_CAUSE_OK) { FSM_DEBUG_SM(get_debug_string(FSM_DBG_SDP_BUILD_ERR)); return(fsmdef_release(fcb, cause, dcb->send_release)); } - + /* Send feature request to SIP */ cc_int_feature(CC_SRC_GSM, CC_SRC_SIP, dcb->call_id, dcb->line, CC_FEATURE_MEDIA, &feature_data); @@ -5747,17 +5712,17 @@ fsmdef_ev_connected_media_pend_feature (sm_event_t *event) /* * Unhandled features are handled by the normal connected feature */ - return (fsmdef_ev_connected_feature(event)); + return (fsmdef_ev_connected_feature(event)); } /** * - * Function to handles connected media update pending state feature ack + * Function to handles connected media update pending state feature ack * events. * * @param sm_event_t event * - * @return SM_RC_END or SM_RC_CLEANUP + * @return SM_RC_END or SM_RC_CLEANUP * * @pre (fcb->dcb not_eq NULL) * @pre (event->data not_eq NULL) @@ -5773,7 +5738,7 @@ fsmdef_ev_connected_media_pend_feature_ack (sm_event_t *event) cc_features_t ftr_id = msg->feature_id; cc_srcs_t src_id = msg->src_id; cc_feature_data_t feature_data; - sm_rcs_t sm_rc = SM_RC_END; + sm_rcs_t sm_rc = SM_RC_END; cc_msgbody_info_t *msg_body; cc_causes_t cause; @@ -5794,13 +5759,13 @@ fsmdef_ev_connected_media_pend_feature_ack (sm_event_t *event) */ fsmdef_set_req_pending_timer(dcb); if (FSM_CHK_FLAGS(dcb->flags, FSMDEF_F_HOLD_REQ_PENDING)) { - /* + /* * Feature hold is pending, abort the media capability - * update and retry with hold instead. + * update and retry with hold instead. */ FSM_RESET_FLAGS(dcb->flags, FSMDEF_F_HOLD_REQ_PENDING); fsm_change_state(fcb, __LINE__, FSMDEF_S_HOLD_PENDING); - } + } return (SM_RC_END); } @@ -5840,7 +5805,7 @@ fsmdef_ev_connected_media_pend_feature_ack (sm_event_t *event) * currently playing spoof ringout, transition the LSM from * the far end alerting to the connected state. */ - if ((!dcb->spoof_ringout_requested) && + if ((!dcb->spoof_ringout_requested) && (dcb->spoof_ringout_applied)) { FSM_DEBUG_SM(get_debug_string(FSMDEF_DBG_CLR_SPOOF_APPLD), dcb->call_id, dcb->line, fname); @@ -5858,21 +5823,21 @@ fsmdef_ev_connected_media_pend_feature_ack (sm_event_t *event) * while we were in the middle of the previous transaction. */ sm_rc = fsmdef_transition_to_connected(fcb); - if (g_dock_undock_event != MEDIA_INTERFACE_UPDATE_NOT_REQUIRED) { + if (g_dock_undock_event != MEDIA_INTERFACE_UPDATE_NOT_REQUIRED) { if (is_gsmsdp_media_ip_updated_to_latest(dcb) == TRUE) { ui_update_media_interface_change(dcb->line, dcb->call_id, MEDIA_INTERFACE_UPDATE_SUCCESSFUL); } else { DEF_DEBUG("We must have received another MEDIA_INTERFACE_UPDATE events " - " while current MEDIA_INTERFACE_UPDATE event is in procoess. Sending re-invite again"); + " while current MEDIA_INTERFACE_UPDATE event is in procoess. Sending re-invite again"); escalateDeescalate(); } } } return (sm_rc); - default: + default: break; - } + } break; default: @@ -5932,7 +5897,7 @@ fsmdef_ev_onhook (sm_event_t *event) sm_rcs_t sm_rc; cc_action_data_t data; int sdpmode = 0; - + FSM_DEBUG_SM(DEB_F_PREFIX"Entered.\n", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__)); /* currently this flag is only set by conference case. It signals @@ -5955,15 +5920,15 @@ fsmdef_ev_onhook (sm_event_t *event) /* * If the user presses the ENDCALL softkey for an - * incoming call set the release cause to Busy. + * incoming call set the release cause to Busy. */ if (fcb->state == FSMDEF_S_INCOMING_ALERTING) { sm_rc = fsmdef_release(fcb, CC_CAUSE_BUSY, dcb->send_release); - } else { - dcb->early_error_release = FALSE; + } else { + dcb->early_error_release = FALSE; sm_rc = fsmdef_release(fcb, CC_CAUSE_NORMAL, dcb->send_release); } - + if (sm_rc == SM_RC_CLEANUP) { /* This dcb has been cleaned up, do nothing more */ return (sm_rc); @@ -5986,7 +5951,7 @@ fsmdef_ev_release (sm_event_t *event) fsm_fcb_t *fcb = (fsm_fcb_t *) event->data; cc_release_t *msg = (cc_release_t *) event->msg; fsmdef_dcb_t *dcb = fcb->dcb; - + FSM_DEBUG_SM(DEB_F_PREFIX"Entered.\n", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__)); dcb->send_release = FALSE; @@ -5996,7 +5961,7 @@ fsmdef_ev_release (sm_event_t *event) if (msg->cause == CC_CAUSE_REMOTE_DISCONN_REQ_PLAYTONE) { fsmdef_set_call_info_cc_call_state(dcb, CC_STATE_CALL_FAILED, CC_CAUSE_REMOTE_DISCONN_REQ_PLAYTONE); - + /* what to return for return code */ return(SM_RC_SUCCESS); } else { @@ -6011,7 +5976,7 @@ fsmdef_ev_releasing_release (sm_event_t *event) fsm_fcb_t *fcb = (fsm_fcb_t *) event->data; cc_release_t *msg = (cc_release_t *) event->msg; fsmdef_dcb_t *dcb = fcb->dcb; - + FSM_DEBUG_SM(DEB_F_PREFIX"Entered.\n", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__)); /* see if the SIP stack has aborted this call early for some reason @@ -6168,7 +6133,7 @@ fsmdef_ev_hold_pending_feature (sm_event_t *event) feature_data.hold.call_info.data.call_info_feat_data.swap = FALSE; feature_data.hold.call_info.data.call_info_feat_data.protect = FALSE; sm_rc = fsm_hold_local(fcb, &feature_data, TRUE); - break; + return sm_rc; case CC_FEATURE_END_CALL: sm_rc = fsmdef_release_call(fcb, msg); @@ -6240,20 +6205,20 @@ fsmdef_ev_hold_pending_feature_ack (sm_event_t *event) FSM_DEBUG_SM(DEB_F_PREFIX"Entered.\n", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__)); fsm_sm_ftr(ftr_id, src_id); - + switch (src_id) { case (CC_SRC_SIP): switch (ftr_id) { case CC_FEATURE_RESUME: /* - * This is feature ack for resume. We received resume + * This is feature ack for resume. We received resume * feature ack because the hold request was received while * we are waiting to resume i.e. was in the - * resume pending state and resume request has been sent out. + * resume pending state and resume request has been sent out. * * If the resume ack indicates glare, then ignore sending the * resume and transition to holding (we were in hold and - * unable to send RESUME). Otherwise send hold out right away + * unable to send RESUME). Otherwise send hold out right away * if there is no other error. */ fsm_sm_ftr(ftr_id, src_id); @@ -6298,7 +6263,7 @@ fsmdef_ev_hold_pending_feature_ack (sm_event_t *event) feature_data.hold.call_info.data.call_info_feat_data.swap = FALSE; feature_data.hold.call_info.data.call_info_feat_data.protect = FALSE; fsm_hold_local(fcb, &feature_data, FALSE); - break; + break; default: fsmdef_sm_ignore_ftr(fcb, __LINE__, ftr_id); @@ -6360,7 +6325,7 @@ fsmdef_ev_holding_onhook (sm_event_t *event) /** * * fsmdef_reversion_timeout - Triggers LSM for doing Reversion alerts. - * + * * @param fsmdef_dcb_t dcb for this call * * @return none @@ -6380,7 +6345,7 @@ void fsmdef_reversion_timeout(callid_t call_id) } // check that we are in HOLDING state before proceeding - if ((dcb->fcb->state != FSMDEF_S_HOLDING) && + if ((dcb->fcb->state != FSMDEF_S_HOLDING) && (dcb->fcb->state != FSMDEF_S_HOLD_PENDING)) { return; } @@ -6396,15 +6361,15 @@ void fsmdef_reversion_timeout(callid_t call_id) } cc_call_state(dcb->call_id, dcb->line, CC_STATE_HOLD_REVERT, NULL); - + } /** * * fsmdef_resume - Performs Resume Operation. - * - * @param sm_event_t event + * + * @param sm_event_t event * * @return sm_rcs_t SM_RC_END - indicating the event has been consumed * @@ -6440,9 +6405,9 @@ fsmdef_resume (sm_event_t *event) cc_int_feature_ack(CC_SRC_GSM, CC_SRC_GSM, dcb->call_id, dcb->line, CC_FEATURE_RESUME, NULL, CC_CAUSE_NORMAL); - FSM_DEBUG_SM(get_debug_string(FSMDEF_DBG1), call_id, dcb->line, + FSM_DEBUG_SM(get_debug_string(FSMDEF_DBG1), call_id, dcb->line, fname, "resume media not in hold state\n"); - return; + return; } (void) cprCancelTimer(dcb->revertTimer); @@ -6520,7 +6485,7 @@ fsmdef_resume (sm_event_t *event) dcb->call_id, dcb->line, fname); dcb->spoof_ringout_applied = FALSE; - /* Start receiving but not transmit, before sending resume */ + /* Start receiving but not transmit, before sending resume */ (void)cc_call_action(dcb->call_id, dcb->line, CC_ACTION_START_RCV, NULL); } @@ -6528,7 +6493,7 @@ fsmdef_resume (sm_event_t *event) if (!req_pending_tmr_running) { cc_int_feature(CC_SRC_GSM, CC_SRC_SIP, dcb->call_id, dcb->line, CC_FEATURE_RESUME, &feature_data); - } + } /* * We lock the UI until we learn the result of the resume request @@ -6537,7 +6502,7 @@ fsmdef_resume (sm_event_t *event) /* Wait for feature ack */ fsm_change_state(fcb, __LINE__, FSMDEF_S_RESUME_PENDING); - + return ; } @@ -6545,8 +6510,8 @@ fsmdef_resume (sm_event_t *event) /** * * fsmdef_ev_holding_offhook - Handles offhook in for holding state. - * - * @param sm_event_t event + * + * @param sm_event_t event * * @return sm_rcs_t SM_RC_END - indicating the event has been consumed * @@ -6567,7 +6532,7 @@ fsmdef_ev_holding_offhook (sm_event_t *event) } return SM_RC_END; - + } static sm_rcs_t @@ -6581,7 +6546,7 @@ fsmdef_ev_holding_feature (sm_event_t *event) cc_feature_data_t *data = &(msg->data); cc_feature_data_t feature_data; sm_rcs_t sm_rc; - + FSM_DEBUG_SM(DEB_F_PREFIX"Entered.\n", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__)); fsm_sm_ftr(ftr_id, src_id); @@ -6659,7 +6624,7 @@ fsmdef_ev_holding_feature (sm_event_t *event) } else { fsmdef_b2bjoin_invoke(dcb, data); } - return (SM_RC_END); + return (SM_RC_END); case CC_FEATURE_DIRTRXFR: case CC_FEATURE_UNDEFINED: @@ -6767,7 +6732,7 @@ fsmdef_ev_holding_feature_ack (sm_event_t *event) default: fsm_sm_ignore_ftr(fcb, __LINE__, ftr_id); break; - } + } /* call default feature ack handler to take common/default actions */ (void) fsmdef_ev_default_feature_ack(event); @@ -6800,12 +6765,12 @@ fsmdef_ev_resume_pending_feature (sm_event_t *event) case CC_FEATURE_UPD_SESSION_MEDIA_CAP: dcb->video_pref = data->caps.support_direction; break; - + case CC_FEATURE_END_CALL: fim_unlock_ui(call_id); sm_rc = fsmdef_release_call(fcb, msg); - return (sm_rc); - + return (sm_rc); + case CC_FEATURE_HOLD: /* * The UI should be locked but the hold event from UI here @@ -6819,16 +6784,16 @@ fsmdef_ev_resume_pending_feature (sm_event_t *event) * There are 2 choices here. If we are in this state and has * not sent a resume out to the network, then simply * transition to holding state. If resume has already - * been sent and we are here waiting for resume pending ack, - * then we can not send out hold immediately. In the later - * case, go to hold pending state and wait for resume - * feature ack to send hold out. - * + * been sent and we are here waiting for resume pending ack, + * then we can not send out hold immediately. In the later + * case, go to hold pending state and wait for resume + * feature ack to send hold out. + * * In either case, UI can be unlocked since we are now * about to hold again. */ fim_unlock_ui(dcb->call_id); - if (dcb->req_pending_tmr && + if (dcb->req_pending_tmr && cprIsTimerRunning(dcb->req_pending_tmr)) { /* * Request timer is running, that means we are waiting @@ -6840,21 +6805,21 @@ fsmdef_ev_resume_pending_feature (sm_event_t *event) FSM_DEBUG_SM(get_debug_string(FSMDEF_DBG1), dcb->call_id, dcb->line, fname, - "Received Hold while waiting to send resume\n"); + "Received Hold while waiting to send resume\n"); /* Go back to holding without sending any thing out */ (void)fsm_hold_local_only(fcb); - } else { - /* + } else { + /* * We have sent resume to the network and wait for * for the feature ack. The glare condition can - * occur but we can only assume that resume was sent out + * occur but we can only assume that resume was sent out * at this point. We can not send out any more request - * until the result is known. + * until the result is known. */ if (msg->data_valid) { - dcb->hold_reason = - data->hold.call_info.data.hold_resume_reason; + dcb->hold_reason = + data->hold.call_info.data.hold_resume_reason; } else { dcb->hold_reason = CC_REASON_NONE; } @@ -6868,7 +6833,7 @@ fsmdef_ev_resume_pending_feature (sm_event_t *event) default: fsmdef_sm_ignore_ftr(fcb, __LINE__, ftr_id); - break; + break; } break; @@ -6981,13 +6946,13 @@ fsmdef_ev_resume_pending_feature (sm_event_t *event) * feature ack event handler in resume pending state. * * @param[in] event Pointer to sm_event_t structure for feature ack event. - * - * @return Value of type sm_rcs_t to state machine - * + * + * @return Value of type sm_rcs_t to state machine + * * @pre (event not_eqs NULL) and * (event->data not_eqs NULL) and * ((fsm_fcb_t *)(event->data)->dcb not_eqs NULL) - */ + */ static sm_rcs_t fsmdef_ev_resume_pending_feature_ack (sm_event_t *event) { @@ -7006,7 +6971,7 @@ fsmdef_ev_resume_pending_feature_ack (sm_event_t *event) switch (src_id) { case (CC_SRC_SIP): - switch (ftr_id) { + switch (ftr_id) { case CC_FEATURE_HOLD: /* * This can occur because SIP stack has not sent HOLD out yet @@ -7018,7 +6983,7 @@ fsmdef_ev_resume_pending_feature_ack (sm_event_t *event) if (msg->cause == CC_CAUSE_REQUEST_PENDING) { cc_call_state(dcb->call_id, dcb->line, CC_STATE_CONNECTED, FSMDEF_CC_CALLER_ID); - fsm_change_state(fcb, __LINE__, FSMDEF_S_CONNECTED); + fsm_change_state(fcb, __LINE__, FSMDEF_S_CONNECTED); return (SM_RC_END); } if ((msg->cause != CC_CAUSE_NORMAL) && @@ -7051,11 +7016,11 @@ fsmdef_ev_resume_pending_feature_ack (sm_event_t *event) (dcb->hold_reason == CC_REASON_MONITOR_UPDATE)) { FSM_DEBUG_SM(get_debug_string(FSMDEF_DBG1), dcb->call_id, dcb->line, fname, - "msg->cause == CC_CAUSE_SERV_ERR_UNAVAIL, unable to monitor update\n"); + "msg->cause == CC_CAUSE_SERV_ERR_UNAVAIL, unable to monitor update\n"); return (fsmdef_transition_to_connected(fcb)); } - if ((msg->cause != CC_CAUSE_NORMAL) && + if ((msg->cause != CC_CAUSE_NORMAL) && (msg->cause != CC_CAUSE_OK)) { cc_call_state(dcb->call_id, dcb->line, CC_STATE_UNKNOWN, NULL); @@ -7083,7 +7048,7 @@ fsmdef_ev_resume_pending_feature_ack (sm_event_t *event) * transaction. */ return (fsmdef_transition_to_connected(fcb)); - + default: fsmdef_sm_ignore_ftr(fcb, __LINE__, ftr_id); break; @@ -7308,9 +7273,9 @@ fsmdef_auto_answer_timeout (void *data) GSM_ERR_MSG(get_debug_string(FSMDEF_DBG1), 0, 0, fname, "invalid data"); return; } - + /* Retrieve dcb from call id */ - dcb = fsmdef_get_dcb_by_call_id(call_id); + dcb = fsmdef_get_dcb_by_call_id(call_id); if (dcb == NULL) { /* * The only way this should happen is for the @@ -7319,7 +7284,7 @@ fsmdef_auto_answer_timeout (void *data) */ FSM_DEBUG_SM(DEB_F_PREFIX"AutoAnswer timer expired but no dcb was found.\n", DEB_F_PREFIX_ARGS(FSM, fname)); return; - } + } /* * The device-based config parameter autoAnswerIdleAlternate @@ -7427,11 +7392,11 @@ static void fsmdef_b2bjoin_invoke (fsmdef_dcb_t *dcb, cc_feature_data_t *join_data) { cc_feature_data_t feature_data; - int join_across_lines; - cc_uint32_t major_ver; - + int join_across_lines; + cc_uint32_t major_ver; + FSM_DEBUG_SM(DEB_F_PREFIX"Entered.\n", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__)); - + // Disable Join if the CUCM doesn't support it platGetSISProtocolVer(&major_ver, NULL, NULL, NULL); @@ -7443,47 +7408,47 @@ fsmdef_b2bjoin_invoke (fsmdef_dcb_t *dcb, cc_feature_data_t *join_data) return; } - config_get_value(CFGID_JOIN_ACROSS_LINES, + config_get_value(CFGID_JOIN_ACROSS_LINES, &join_across_lines, sizeof(join_across_lines)); /* * Invoke B2BJoin feature towards SIP. It will send a REFER to CCM */ if (join_data) { cc_int_feature(CC_SRC_GSM, CC_SRC_SIP, dcb->call_id, - dcb->line, CC_FEATURE_B2B_JOIN, join_data); + dcb->line, CC_FEATURE_B2B_JOIN, join_data); } else { - if ((g_b2bjoin_pending == FALSE) && (dcb->fcb->state == FSMDEF_S_HOLDING) - && ((fsmdef_get_connected_call() != NULL) || + if ((g_b2bjoin_pending == FALSE) && (dcb->fcb->state == FSMDEF_S_HOLDING) + && ((fsmdef_get_connected_call() != NULL) || (fsmdef_get_alertingout_call() != NULL))) { - /* Single Button Join case - * If Join is pressed on a held call while there is + /* Single Button Join case + * If Join is pressed on a held call while there is * an active(connected or alerting) call, that completes the Join */ feature_data.b2bjoin.b2bjoin_callid = dcb->call_id; - feature_data.b2bjoin.b2bjoin_joincallid = dcb->call_id; + feature_data.b2bjoin.b2bjoin_joincallid = dcb->call_id; cc_int_feature(CC_SRC_GSM, CC_SRC_SIP, dcb->call_id, - dcb->line, CC_FEATURE_B2B_JOIN, &feature_data); - return; + dcb->line, CC_FEATURE_B2B_JOIN, &feature_data); + return; } - if ((g_numofselected_calls == 0) || + if ((g_numofselected_calls == 0) || ((g_b2bjoin_pending == FALSE) && (join_across_lines == JOIN_ACROSS_LINES_DISABLED) && (fsmdef_are_there_selected_calls_onotherline(dcb->line) == TRUE))) { dcb->active_feature = CC_FEATURE_B2B_JOIN; feature_data.select.select = TRUE; fsmdef_select_invoke(dcb,&feature_data); - fsm_display_use_line_or_join_to_complete(); + fsm_display_use_line_or_join_to_complete(); return; - } - if (g_b2bjoin_pending) { - if (join_across_lines == JOIN_ACROSS_LINES_DISABLED) { + } + if (g_b2bjoin_pending) { + if (join_across_lines == JOIN_ACROSS_LINES_DISABLED) { if (fsmdef_are_join_calls_on_same_line(dcb->line) == FALSE) { - + fsm_display_use_line_or_join_to_complete(); g_b2bjoin_pending = FALSE; g_b2bjoin_callid = CC_NO_CALL_ID; - return; + return; } } if (dcb->call_id== g_b2bjoin_callid) { @@ -7505,12 +7470,12 @@ fsmdef_b2bjoin_invoke (fsmdef_dcb_t *dcb, cc_feature_data_t *join_data) cc_int_feature(CC_SRC_GSM, CC_SRC_SIP, dcb->call_id, dcb->line, CC_FEATURE_B2B_JOIN, &feature_data); - + } else { if ((g_numofselected_calls == 1) && (dcb->selected)) { - /* - * If this is only one selected call, pressing - * Join on it will start a new join operation + /* + * If this is only one selected call, pressing + * Join on it will start a new join operation */ g_b2bjoin_pending = TRUE; g_b2bjoin_callid = dcb->call_id; @@ -7518,18 +7483,18 @@ fsmdef_b2bjoin_invoke (fsmdef_dcb_t *dcb, cc_feature_data_t *join_data) return; } feature_data.b2bjoin.b2bjoin_callid = dcb->call_id; - feature_data.b2bjoin.b2bjoin_joincallid = dcb->call_id; + feature_data.b2bjoin.b2bjoin_joincallid = dcb->call_id; cc_int_feature(CC_SRC_GSM, CC_SRC_SIP, dcb->call_id, - dcb->line, CC_FEATURE_B2B_JOIN, &feature_data); + dcb->line, CC_FEATURE_B2B_JOIN, &feature_data); } } g_b2bjoin_pending = FALSE; - g_b2bjoin_callid = CC_NO_CALL_ID; + g_b2bjoin_callid = CC_NO_CALL_ID; } /* * fsmdef_select_invoke - * + * * * Description: * This function implements the join feature invocation. @@ -7573,10 +7538,10 @@ fsmdef_select_invoke (fsmdef_dcb_t *dcb, cc_feature_data_t *select_data) /* * handle_join_pending - * + * * * Description: - * This function checks if the join_pending flag + * This function checks if the join_pending flag * needs to be cleared.due to the invocation of other features * * Parameters: @@ -7663,7 +7628,7 @@ fsmdef_process_cfwd_softkey_event (sm_event_t *event) { dcb->active_feature = CC_FEATURE_NONE; return (SM_RC_END); - } + } // go offhook and then move to dialing state to collect digits @@ -7717,7 +7682,7 @@ fsmdef_process_cfwd_softkey_event (sm_event_t *event) * * @param[in] fcb The pointer to the fsm_fcb_t structure of this * call chain. - * + * * @pre (fcb not_eq NULL) * * @return sm_rsc_t indicates whether the execution of @@ -7742,7 +7707,7 @@ fsmdef_cfwd_clear_ccm (fsm_fcb_t *fcb) if (cause != CC_CAUSE_OK) { FSM_DEBUG_SM(get_debug_string(FSM_DBG_SDP_BUILD_ERR)); return (fsmdef_release(fcb, cause, dcb->send_release)); - } + } /* Build SDP for sending out */ cause = gsmsdp_encode_sdp_and_update_version(dcb, &msg_body); @@ -7816,7 +7781,7 @@ fsmdef_append_dialstring_to_feature_uri (fsmdef_dcb_t *dcb, } } else { FSM_DEBUG_SM(DEB_F_PREFIX"Configured Feature/Service URI Not Found For Feature[%d]\n", DEB_F_PREFIX_ARGS(FSM, "fsmdef_append_dialstring_to_feature_uri"), (int)dcb->active_feature); - + if (dialstring && dialstring[0]) { dcb->caller_id.called_number = strlib_update(dcb->caller_id.called_number, dialstring); @@ -7859,7 +7824,7 @@ fsmdef_is_feature_uri_configured (cc_features_t ftr_id) if (service_uri[0] != NUL) { return TRUE; } - + FSM_DEBUG_SM(DEB_F_PREFIX"Configured Feature/Service URI Not Found For Feature[%d]\n", DEB_F_PREFIX_ARGS(FSM, "fsmdef_is_feature_uri_configured"), (int)ftr_id); return FALSE; } @@ -7947,7 +7912,7 @@ fsmdef_check_if_ok_to_hold_call (line_t line, callid_t call_id) dcb = fsmdef_get_dcb_by_call_id(call_id); if (dcb == NULL) { - + return (FALSE); } @@ -8016,9 +7981,9 @@ fsmdef_check_if_ok_to_run_feature (line_t line, callid_t call_id) return (FALSE); } - if ((dcb->line != line) || - ((dcb->fcb != NULL) && - (dcb->fcb->state != FSMDEF_S_CONNECTED) && + if ((dcb->line != line) || + ((dcb->fcb != NULL) && + (dcb->fcb->state != FSMDEF_S_CONNECTED) && (dcb->fcb->state != FSMDEF_S_CONNECTED_MEDIA_PEND))) { return (FALSE); } @@ -8049,8 +8014,8 @@ fsmdef_check_if_ok_to_monitor_update_call (line_t line, callid_t call_id) return (FALSE); } - if ((dcb->line != line) || - ((dcb->fcb != NULL) && + if ((dcb->line != line) || + ((dcb->fcb != NULL) && (dcb->fcb->state != FSMDEF_S_CONNECTED))) { return (FALSE); } @@ -8077,7 +8042,7 @@ fsmdef_set_call_info_cc_call_state (fsmdef_dcb_t *dcb, cc_states_t state, cc_cau cc_state_data_t temp_data; char tmp_str[CALL_BUBBLE_STR_MAX_LEN]; int rc = CPR_FAILURE; - + tmp_str[0] = '\0'; switch (dcb->active_feature) { @@ -8359,15 +8324,15 @@ fsmdef_extract_join_target (sm_event_t *event) // set the session leg of this dcb to monitor dcb->session = MONITOR; } - FSM_DEBUG_SM(DEB_L_C_F_PREFIX" dcb-session type is = %s \n", + FSM_DEBUG_SM(DEB_L_C_F_PREFIX" dcb-session type is = %s \n", DEB_L_C_F_PREFIX_ARGS(FSM, dcb->line, dcb->call_id, fname), - dcb->session == WHISPER_COACHING ? "WHISPER_COACHING" : + dcb->session == WHISPER_COACHING ? "WHISPER_COACHING" : dcb->session == MONITOR ? "MONITOR" : "PRIMARY"); cc_int_feature(CC_SRC_GSM, CC_SRC_GSM, join_dcb->call_id, line, CC_FEATURE_JOIN, &data); } else { - FSM_DEBUG_SM(DEB_L_C_F_PREFIX"Unable to find join target dcb\n", + FSM_DEBUG_SM(DEB_L_C_F_PREFIX"Unable to find join target dcb\n", DEB_L_C_F_PREFIX_ARGS(FSM, dcb->line, dcb->call_id, fname)); return (TRUE); } @@ -8423,7 +8388,7 @@ fsmdef_notify_hook_event (fsm_fcb_t *fcb, cc_msgs_t msg, char *global_call_id, if (msg == CC_MSG_OFFHOOK) { cc_int_offhook(CC_SRC_GSM, CC_SRC_SIP, prim_call_id, consult_reason, - fcb->dcb->call_id, fcb->dcb->line, + fcb->dcb->call_id, fcb->dcb->line, global_call_id, monitor_mode,cfwdall_mode); } else if (msg == CC_MSG_ONHOOK) { cc_int_onhook(CC_SRC_GSM, CC_SRC_SIP, prim_call_id, @@ -8576,7 +8541,7 @@ fsmdef_init (void) } if (dcb == fsmdef_dcbs) { g_disable_mass_reg_debug_print = TRUE; - } + } } g_disable_mass_reg_debug_print = FALSE; @@ -8606,10 +8571,10 @@ fsmdef_shutdown (void) (void)cprDestroyTimer(dcb->ringback_delay_tmr); } if (dcb->autoAnswerTimer) { - (void)cprDestroyTimer(dcb->autoAnswerTimer); + (void)cprDestroyTimer(dcb->autoAnswerTimer); } if (dcb->revertTimer) { - (void)cprDestroyTimer(dcb->revertTimer); + (void)cprDestroyTimer(dcb->revertTimer); } /* clean media list */ diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/fsmxfr.c b/media/webrtc/signaling/src/sipcc/core/gsm/fsmxfr.c index ef86bc447e11..d0d387fd299f 100755 --- a/media/webrtc/signaling/src/sipcc/core/gsm/fsmxfr.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/fsmxfr.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdlib.h" @@ -158,7 +123,7 @@ fsmxfr_get_new_xfr_id (void) /** * - * Sets/rest transfer complete flag in the DCB so it can be used in + * Sets/rest transfer complete flag in the DCB so it can be used in * UI to indicate if the call is ended because of xfer or endcall. * * @cns_call_id consult call id @@ -172,10 +137,10 @@ void fsmxfr_mark_dcb_for_xfr_complete(callid_t cns_call_id, callid_t xfr_call_id boolean set_flag) { fsm_fcb_t *cns_fcb, *xfr_fcb; - - cns_fcb = fsm_get_fcb_by_call_id_and_type(cns_call_id, + + cns_fcb = fsm_get_fcb_by_call_id_and_type(cns_call_id, FSM_TYPE_DEF); - xfr_fcb = fsm_get_fcb_by_call_id_and_type(xfr_call_id, + xfr_fcb = fsm_get_fcb_by_call_id_and_type(xfr_call_id, FSM_TYPE_DEF); if (set_flag) { if (cns_fcb && cns_fcb->dcb) { @@ -200,7 +165,7 @@ void fsmxfr_mark_dcb_for_xfr_complete(callid_t cns_call_id, callid_t xfr_call_id * * @param none * - * @return fsm_fcb_t if there is a active trasnfer pending + * @return fsm_fcb_t if there is a active trasnfer pending * else NULL * * @pre (none) @@ -214,7 +179,7 @@ fsm_fcb_t *fsmxfr_get_active_xfer(void) FSM_FOR_ALL_CBS(xcb, fsmxfr_xcbs, FSMXFR_MAX_XCBS) { fcb = fsm_get_fcb_by_call_id_and_type(xcb->xfr_call_id, - FSM_TYPE_XFR); + FSM_TYPE_XFR); if (fcb && fcb->state == FSMXFR_S_ACTIVE) { return(fcb); } @@ -346,7 +311,7 @@ fsmxfr_get_xcb_by_call_id (callid_t call_id) /** * * Cancel tranfer operation by sending cancel event to SIP stack. - * This routine is used in roundtable phone. + * This routine is used in roundtable phone. * * @param line, call_id, target_call_id, cause (implicit or explicit) * @@ -355,7 +320,7 @@ fsmxfr_get_xcb_by_call_id (callid_t call_id) * @pre (none) */ void -fsmxfr_feature_cancel (fsmxfr_xcb_t *xcb, line_t line, callid_t call_id, +fsmxfr_feature_cancel (fsmxfr_xcb_t *xcb, line_t line, callid_t call_id, callid_t target_call_id, cc_rcc_skey_evt_type_e cause) { @@ -363,7 +328,7 @@ fsmxfr_feature_cancel (fsmxfr_xcb_t *xcb, line_t line, callid_t call_id, cc_feature_data_t data; fsm_fcb_t *fcb_def; - DEF_DEBUG(DEB_F_PREFIX"Sending cancel call_id = %d, t_id=%d, cause = %d\n", + DEF_DEBUG(DEB_F_PREFIX"Sending cancel call_id = %d, t_id=%d, cause = %d\n", DEB_F_PREFIX_ARGS(GSM, fname), call_id, target_call_id, cause); fcb_def = fsm_get_fcb_by_call_id_and_type(call_id, FSM_TYPE_DEF); @@ -371,7 +336,7 @@ fsmxfr_feature_cancel (fsmxfr_xcb_t *xcb, line_t line, callid_t call_id, if ((cause == CC_SK_EVT_TYPE_EXPLI) && (fcb_def != NULL) && ((fcb_def->dcb->selected == FALSE) && ((fcb_def->state == FSMDEF_S_OUTGOING_ALERTING) || - ((fcb_def->state == FSMDEF_S_CONNECTED) && + ((fcb_def->state == FSMDEF_S_CONNECTED) && (fcb_def->dcb->spoof_ringout_requested == TRUE) && (fcb_def->dcb->spoof_ringout_applied == TRUE))))) { @@ -384,7 +349,7 @@ fsmxfr_feature_cancel (fsmxfr_xcb_t *xcb, line_t line, callid_t call_id, if ((cause == CC_SK_EVT_TYPE_EXPLI) && (fcb_def != NULL) && ((fcb_def->dcb->selected == FALSE) && ((fcb_def->state == FSMDEF_S_OUTGOING_ALERTING) || - ((fcb_def->state == FSMDEF_S_CONNECTED) && + ((fcb_def->state == FSMDEF_S_CONNECTED) && (fcb_def->dcb->spoof_ringout_requested == TRUE) && (fcb_def->dcb->spoof_ringout_applied == TRUE))))) { @@ -421,7 +386,7 @@ fsmxfr_update_xfr_context (fsmxfr_xcb_t *xcb, callid_t old_call_id, } /* - * Function to get line number of other call associated in + * Function to get line number of other call associated in * transfer. * * @param xcb and call_id. @@ -903,7 +868,7 @@ fsmxfr_ev_idle_feature (sm_event_t *event) switch (ftr_id) { case CC_FEATURE_DIRTRXFR: - /* If there is a active xfer pending + /* If there is a active xfer pending * then link this transfer to active transfer */ other_fcb = fsmxfr_get_active_xfer(); @@ -912,13 +877,13 @@ fsmxfr_ev_idle_feature (sm_event_t *event) GSM_DEBUG_ERROR(GSM_F_PREFIX"Cannot find the active xfer\n", fname); return (SM_RC_END); } - /* End existing consult call and then link another + /* End existing consult call and then link another * call with the trasfer */ cc_int_feature(CC_SRC_GSM, CC_SRC_GSM, other_fcb->xcb->cns_call_id, other_fcb->xcb->cns_line, CC_FEATURE_END_CALL, NULL); other_fcb->xcb->cns_call_id = call_id; - + cc_int_feature(CC_SRC_GSM, CC_SRC_GSM, other_fcb->xcb->xfr_call_id, other_fcb->xcb->xfr_line, CC_FEATURE_DIRTRXFR, NULL); @@ -936,7 +901,7 @@ fsmxfr_ev_idle_feature (sm_event_t *event) return(SM_RC_CONT); } - /* Make sure atleast one call has been selected, connected and this call + /* Make sure atleast one call has been selected, connected and this call * is not in the focus */ if ((fsmutil_get_num_selected_calls() > 1) && (dcb->selected == FALSE)) { @@ -970,7 +935,7 @@ fsmxfr_ev_idle_feature (sm_event_t *event) */ cc_int_feature(CC_SRC_GSM, CC_SRC_GSM, dcb->call_id, dcb->line, CC_FEATURE_DIRTRXFR, NULL); - + fsm_change_state(fcb, __LINE__, FSMXFR_S_ACTIVE); return(SM_RC_END); @@ -984,7 +949,7 @@ fsmxfr_ev_idle_feature (sm_event_t *event) * call and link that to another call. */ if ((cause != CC_CAUSE_XFER_CNF) && - (ftr_data && msg->data_valid) && + (ftr_data && msg->data_valid) && (ftr_data->xfer.target_call_id != CC_NO_CALL_ID) && ((cns_fcb = fsm_get_fcb_by_call_id_and_type(ftr_data->xfer.target_call_id, FSM_TYPE_XFR)) != NULL)) { @@ -997,7 +962,7 @@ fsmxfr_ev_idle_feature (sm_event_t *event) if (xcb == NULL) { return(SM_RC_END); } - + fcb->xcb = xcb; cns_fcb->xcb = xcb; xcb->type = FSMXFR_TYPE_DIR_XFR; @@ -1524,7 +1489,7 @@ fsmxfr_ev_active_proceeding (sm_event_t *event) * or is currently connected, otherwise just let this call be setup * normally so that it will ring. */ - + if (other_fcb && (other_fcb->old_state == FSMDEF_S_CONNECTED || other_fcb->old_state == FSMDEF_S_CONNECTED_MEDIA_PEND || other_fcb->old_state == FSMDEF_S_RESUME_PENDING || @@ -1564,7 +1529,7 @@ fsmxfr_ev_active_connected_ack (sm_event_t *event) /* * Remove this call from the transfer. */ - fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, + fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, xcb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); fsmxfr_cleanup(fcb, __LINE__, FALSE); @@ -1651,11 +1616,11 @@ fsmxfr_ev_active_release (sm_event_t *event) fsmxfr_init_xcb(xcb); fcb->xcb->active = FALSE; fcb->xcb->xcb2 = NULL; - fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, + fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, xcb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); fsmxfr_cleanup(fcb, __LINE__, FALSE); } else if (xcb->active == TRUE) { - fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, + fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, xcb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); fsmxfr_cleanup(fcb, __LINE__, FALSE); fcb->xcb->active = FALSE; @@ -1666,7 +1631,7 @@ fsmxfr_ev_active_release (sm_event_t *event) * the cleanup function works properly. */ fsmxfr_update_xfr_context(xcb, new_call_id, CC_NO_CALL_ID); - fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, + fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, xcb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); fsmxfr_cleanup(fcb, __LINE__, TRUE); } @@ -1755,7 +1720,7 @@ static char *fsmxfr_get_dialed_num (fsmdef_dcb_t *dcb) tmp_called_number = lsm_get_gdialed_digits(); - DEF_DEBUG(DEB_F_PREFIX"called_dialed_num = %s\n", + DEF_DEBUG(DEB_F_PREFIX"called_dialed_num = %s\n", DEB_F_PREFIX_ARGS(GSM, fname), tmp_called_number); /* Get dialed number to put in the refer-to header. If there @@ -1764,12 +1729,12 @@ static char *fsmxfr_get_dialed_num (fsmdef_dcb_t *dcb) if (tmp_called_number == NULL || (*tmp_called_number) == NUL) { if (dcb->caller_id.called_number[0] != NUL) { - DEF_DEBUG(DEB_F_PREFIX"called_dcb_num = %s\n", + DEF_DEBUG(DEB_F_PREFIX"called_dcb_num = %s\n", DEB_F_PREFIX_ARGS(GSM, fname), (char *)dcb->caller_id.called_number); return((char *)dcb->caller_id.called_number); - + } else { - DEF_DEBUG(DEB_F_PREFIX"calling_dcb_num = %s\n", + DEF_DEBUG(DEB_F_PREFIX"calling_dcb_num = %s\n", DEB_F_PREFIX_ARGS(GSM, fname), (char *)dcb->caller_id.calling_number); return((char *)dcb->caller_id.calling_number); } @@ -1802,7 +1767,7 @@ fsmxfr_initiate_xfr (sm_event_t *event) cc_feature_data_t data; fsmxfr_xcb_t *xcb = fcb->xcb; char *called_num = NULL; - + /* * Place the consultation call on hold. */ @@ -1865,7 +1830,7 @@ fsmxfr_initiate_xfr (sm_event_t *event) * Can't transfer the call without a dialstring, so * just cleanup the transfer. */ - fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, + fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, xcb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); fsmxfr_cleanup(fcb, __LINE__, TRUE); if (xcb->cnf_xfr) { @@ -1963,10 +1928,10 @@ fsmxfr_ev_active_feature (sm_event_t *event) * call_id in the data then terminate the existing consulatative * call and link that to another call. */ - DEF_DEBUG(DEB_F_PREFIX"ACTIVE XFER call_id = %d, cns_id = %d, t_id=%d\n", - DEB_F_PREFIX_ARGS(GSM, fname), xcb->xfr_call_id, + DEF_DEBUG(DEB_F_PREFIX"ACTIVE XFER call_id = %d, cns_id = %d, t_id=%d\n", + DEB_F_PREFIX_ARGS(GSM, fname), xcb->xfr_call_id, feat_data->xfer.target_call_id, xcb->cns_call_id); - + if (feat_data && msg->data_valid && (xcb->cns_call_id != feat_data->xfer.target_call_id)) { @@ -1974,8 +1939,8 @@ fsmxfr_ev_active_feature (sm_event_t *event) FSM_TYPE_DEF); if (cns_fcb != NULL) { - DEF_DEBUG(DEB_F_PREFIX"INVOKE ACTIVE XFER call_id = %d, t_id=%d\n", - DEB_F_PREFIX_ARGS(GSM, fname), xcb->xfr_call_id, + DEF_DEBUG(DEB_F_PREFIX"INVOKE ACTIVE XFER call_id = %d, t_id=%d\n", + DEB_F_PREFIX_ARGS(GSM, fname), xcb->xfr_call_id, feat_data->xfer.target_call_id); cc_int_feature(CC_SRC_GSM, CC_SRC_GSM, xcb->xfr_call_id, xcb->xfr_line, CC_FEATURE_DIRTRXFR, NULL); @@ -1997,7 +1962,7 @@ fsmxfr_ev_active_feature (sm_event_t *event) fsmxfr_initiate_xfr(event); lsm_set_hold_ringback_status(xcb->cns_call_id, FALSE); break; - + default: fsm_sm_ignore_ftr(fcb, __LINE__, ftr_id); break; @@ -2037,7 +2002,7 @@ fsmxfr_ev_active_feature (sm_event_t *event) { feat_data->hold.call_info.data.call_info_feat_data.protect = TRUE; } else { - DEF_DEBUG(DEB_F_PREFIX"Invoke hold call_id = %d t_call_id=%d\n", + DEF_DEBUG(DEB_F_PREFIX"Invoke hold call_id = %d t_call_id=%d\n", DEB_F_PREFIX_ARGS(GSM, fname), xcb->xfr_call_id, xcb->cns_call_id); //Actual hold to this call, so break the feature layer. ui_terminate_feature(xcb->xfr_line, xcb->xfr_call_id, xcb->cns_call_id); @@ -2077,7 +2042,7 @@ fsmxfr_ev_active_feature (sm_event_t *event) * Can't transfer the call without a dialstring, so * just cleanup the transfer. */ - fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, + fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, xcb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); fsmxfr_cleanup(fcb, __LINE__, TRUE); } @@ -2095,7 +2060,7 @@ fsmxfr_ev_active_feature (sm_event_t *event) } else if ((xcb->type == FSMXFR_TYPE_XFR) && (msg->data.endcall.cause == CC_CAUSE_NO_USER_RESP)) { - DEF_DEBUG(DEB_F_PREFIX"Xfer type =%d\n", + DEF_DEBUG(DEB_F_PREFIX"Xfer type =%d\n", DEB_F_PREFIX_ARGS(GSM, fname), xcb->type); if ((platGetPhraseText(STR_INDEX_TRANSFERRING, @@ -2105,7 +2070,7 @@ fsmxfr_ev_active_feature (sm_event_t *event) } if (xcb->xfer_comp_req == FALSE) { - fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, + fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, xcb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); } else { // Mark it as transfer complete. @@ -2120,7 +2085,7 @@ fsmxfr_ev_active_feature (sm_event_t *event) * do not send cancel in that case */ if (xcb->xfer_comp_req == FALSE) { - fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, + fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, xcb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); } fsmxfr_cleanup(fcb, __LINE__, TRUE); @@ -2144,7 +2109,7 @@ fsmxfr_ev_active_feature (sm_event_t *event) case CC_SRC_SIP: switch (ftr_id) { case CC_FEATURE_CALL_PRESERVATION: - DEF_DEBUG(DEB_F_PREFIX"Preservation call_id = %d t_call_id=%d\n", + DEF_DEBUG(DEB_F_PREFIX"Preservation call_id = %d t_call_id=%d\n", DEB_F_PREFIX_ARGS(GSM, fname), xcb->xfr_call_id, xcb->cns_call_id); ui_terminate_feature(xcb->xfr_line, xcb->xfr_call_id, xcb->cns_call_id); fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, @@ -2275,7 +2240,7 @@ fsmxfr_ev_active_feature (sm_event_t *event) * Release the transfer call. */ /* Set the dcb flag to indicate transfer is complete, so that - * it won't display endcall in this case + * it won't display endcall in this case */ fsmxfr_mark_dcb_for_xfr_complete(xcb->cns_call_id, xcb->xfr_call_id, TRUE); @@ -2411,17 +2376,17 @@ fsmxfr_ev_active_feature (sm_event_t *event) dcb->line, xcb->xfr_call_id); fsmxfr_mark_dcb_for_xfr_complete(xcb->cns_call_id, xcb->xfr_call_id, FALSE); - fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, + fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, xcb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); /* - * Resume the consultation call. + * Resume the consultation call. * if xcb->cns_call_id == 0, then cns call is already ended. */ if (xcb->cns_call_id != CC_NO_CALL_ID) { lsm_ui_display_status(platform_get_phrase_index_str(TRANSFER_FAILED), dcb->line, xcb->cns_call_id); cns_dcb = fsm_get_dcb (xcb->cns_call_id); - cc_int_feature(CC_SRC_GSM, CC_SRC_GSM, + cc_int_feature(CC_SRC_GSM, CC_SRC_GSM, xcb->cns_call_id, cns_dcb->line, CC_FEATURE_RESUME, NULL); } @@ -2537,7 +2502,7 @@ fsmxfr_ev_active_feature_ack (sm_event_t *event) //cc_int_feature(CC_SRC_GSM, CC_SRC_GSM, dcb->call_id, //dcb->line, CC_FEATURE_END_CALL, &data); } else { - fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, + fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, xcb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); fsmxfr_cleanup(fcb, __LINE__, TRUE); } @@ -2629,7 +2594,7 @@ fsmxfr_ev_active_feature_ack (sm_event_t *event) * Can't transfer the call without a dialstring, so * just cleanup the transfer. */ - fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, + fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, xcb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); fsmxfr_cleanup(fcb, __LINE__, TRUE); } @@ -2676,7 +2641,7 @@ fsmxfr_ev_active_feature_ack (sm_event_t *event) * Can't transfer the call without a dialstring, so * just cleanup the transfer. */ - fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, + fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, xcb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); fsmxfr_cleanup(fcb, __LINE__, TRUE); } @@ -2692,7 +2657,7 @@ fsmxfr_ev_active_feature_ack (sm_event_t *event) xcb->xfr_line, xcb->xfr_call_id); lsm_ui_display_status(platform_get_phrase_index_str(TRANSFER_FAILED), xcb->cns_line, xcb->cns_call_id); - fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, + fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, xcb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); fsmxfr_cleanup(fcb, __LINE__, TRUE); } else { @@ -2779,9 +2744,9 @@ fsmxfr_ev_active_onhook (sm_event_t *event) xfr_dcb->line, CC_FEATURE_NOTIFY, &data); if (cns_fcb && cns_fcb->state != FSMDEF_S_HOLDING && cns_fcb->state != FSMDEF_S_HOLD_PENDING) { - fsmxfr_feature_cancel(xcb, xfr_dcb->line, + fsmxfr_feature_cancel(xcb, xfr_dcb->line, xcb->xfr_call_id, xcb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); - + fsmxfr_cleanup(fcb, __LINE__, TRUE); } /* @@ -2803,17 +2768,17 @@ fsmxfr_ev_active_onhook (sm_event_t *event) cns_fcb->state == FSMDEF_S_HOLD_PENDING)) { /* ignore the onhook event for the held consultation call */ } if (msg->active_list == CC_REASON_ACTIVECALL_LIST) { - /* Active call list has been requested also - * existing consult call is canceled + /* Active call list has been requested also + * existing consult call is canceled * But transfer state machine will remain * intact as feature layer is still running.*/ xcb->cns_call_id = CC_NO_CALL_ID; xcb->cns_line = CC_NO_LINE; }else { - fsmxfr_feature_cancel(xcb, xcb->xfr_line, + fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, xcb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); - + fsmxfr_cleanup(fcb, __LINE__, TRUE); } return (SM_RC_CONT); @@ -2829,15 +2794,15 @@ fsmxfr_ev_active_onhook (sm_event_t *event) (cns_fcb->state == FSMDEF_S_CONNECTED))) { fsmxfr_initiate_xfr(event); return (SM_RC_END); - } else if (onhook_xfer && xfr_fcb && + } else if (onhook_xfer && xfr_fcb && ((xfr_fcb->state == FSMDEF_S_OUTGOING_ALERTING)|| (xfr_fcb->state == FSMDEF_S_CONNECTED))) { fsmxfr_initiate_xfr(event); return (SM_RC_END); } else { - fsmxfr_feature_cancel(xcb, xcb->xfr_line, + fsmxfr_feature_cancel(xcb, xcb->xfr_line, xcb->xfr_call_id, xcb->cns_call_id, CC_SK_EVT_TYPE_IMPLI); - + fsmxfr_cleanup(fcb, __LINE__, TRUE); return (SM_RC_CONT); } @@ -2871,7 +2836,7 @@ fsmxfr_ev_active_dialstring (sm_event_t *event) return (SM_RC_END); } - FSM_DEBUG_SM(DEB_L_C_F_PREFIX"dialstring= %s\n", + FSM_DEBUG_SM(DEB_L_C_F_PREFIX"dialstring= %s\n", DEB_L_C_F_PREFIX_ARGS(FSM, msg->line, call_id, fname), dialstring); /* @@ -2928,7 +2893,7 @@ fsmxfr_ev_active_dialstring (sm_event_t *event) data.endcall.cause = CC_CAUSE_NORMAL; cc_int_feature(CC_SRC_GSM, CC_SRC_GSM, call_id, line, CC_FEATURE_END_CALL, &data); - + /* * Send an event to the transferer call leg so it can send the called diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/gsm.c b/media/webrtc/signaling/src/sipcc/core/gsm/gsm.c index 31a25de2e12a..561aefb79678 100755 --- a/media/webrtc/signaling/src/sipcc/core/gsm/gsm.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/gsm.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_memory.h" @@ -67,7 +32,7 @@ static void sub_process_feature_msg(uint32_t cmd, void *msg); static void sub_process_feature_notify(ccsip_sub_not_data_t *msg, callid_t call_id, callid_t other_call_id); static void sub_process_b2bcnf_msg(uint32_t cmd, void *msg); -void fsmb2bcnf_get_sub_call_id_from_ccb(fsmcnf_ccb_t *ccb, callid_t *cnf_call_id, +void fsmb2bcnf_get_sub_call_id_from_ccb(fsmcnf_ccb_t *ccb, callid_t *cnf_call_id, callid_t *cns_call_id); cprMsgQueue_t gsm_msg_queue; void destroy_gsm_thread(void); @@ -85,7 +50,7 @@ static media_timer_callback_fp* media_timer_callback = NULL; /** * Add media falsh one time timer call back. It's for ROUNDTABLE only. */ -void +void gsm_set_media_callback(media_timer_callback_fp* callback) { media_timer_callback = callback; } @@ -144,7 +109,7 @@ gsm_process_msg (uint32_t cmd, void *msg) case GSM_SIP: if (gsm_initialized) { - if (event_id == CC_MSG_FEATURE && + if (event_id == CC_MSG_FEATURE && (((cc_feature_t *) msg)->feature_id == CC_FEATURE_CAC_RESP_PASS)) { fsm_cac_process_bw_avail_resp (); @@ -153,7 +118,7 @@ gsm_process_msg (uint32_t cmd, void *msg) release_msg = TRUE; GSM_DEBUG(DEB_F_PREFIX"CAC Message Processed: 0x%x\n", DEB_F_PREFIX_ARGS(GSM, fname), cmd); - } else if (event_id == CC_MSG_FEATURE && + } else if (event_id == CC_MSG_FEATURE && (((cc_feature_t *) msg)->feature_id == CC_FEATURE_CAC_RESP_FAIL)) { fsm_cac_process_bw_failed_resp (); @@ -255,7 +220,7 @@ gsm_process_timer_expiration (void *msg) break; } - /* + /* * If there is a timer message to be processed by state machine, * hands it to GSM state machine here. */ @@ -409,9 +374,9 @@ GSMTask (void *arg) if (release_msg == TRUE) { cpr_free(msg); } - - /* Check if there are pending messages for dcsm - * if it in the right state perform its operation + + /* Check if there are pending messages for dcsm + * if it in the right state perform its operation */ dcsm_process_jobs(); } @@ -443,13 +408,13 @@ static void sub_process_b2bcnf_sub_resp (ccsip_sub_not_data_t *msg) cause = CC_CAUSE_OK; - GSM_DEBUG(DEB_F_PREFIX"B2BCNF subs response = OK\n", - DEB_F_PREFIX_ARGS(GSM,fname)); + GSM_DEBUG(DEB_F_PREFIX"B2BCNF subs response = OK\n", + DEB_F_PREFIX_ARGS(GSM,fname)); } else { - GSM_DEBUG(DEB_F_PREFIX"B2BCNF subs response = ERROR\n", - DEB_F_PREFIX_ARGS(GSM,fname)); + GSM_DEBUG(DEB_F_PREFIX"B2BCNF subs response = ERROR\n", + DEB_F_PREFIX_ARGS(GSM,fname)); cause = CC_CAUSE_ERROR; } @@ -477,14 +442,14 @@ static void sub_process_b2bcnf_msg (uint32_t cmd, void *msg) &call_id, &other_call_id); switch (cmd) { case SUB_MSG_B2BCNF_SUBSCRIBE_RESP: - GSM_DEBUG(DEB_F_PREFIX"B2BCNF subs response\n", - DEB_F_PREFIX_ARGS(GSM,fname)); + GSM_DEBUG(DEB_F_PREFIX"B2BCNF subs response\n", + DEB_F_PREFIX_ARGS(GSM,fname)); sub_process_b2bcnf_sub_resp((ccsip_sub_not_data_t *)msg); break; case SUB_MSG_B2BCNF_NOTIFY: - GSM_DEBUG(DEB_F_PREFIX"B2BCNF subs notify\n", - DEB_F_PREFIX_ARGS(GSM,fname)); + GSM_DEBUG(DEB_F_PREFIX"B2BCNF subs notify\n", + DEB_F_PREFIX_ARGS(GSM,fname)); sub_process_feature_notify((ccsip_sub_not_data_t *)msg, call_id, other_call_id); break; case SUB_MSG_B2BCNF_TERMINATE: @@ -492,8 +457,8 @@ static void sub_process_b2bcnf_msg (uint32_t cmd, void *msg) * This is posted by SIP stack if it is shutting down or rolling over. * if so, notify b2bcnf to cleanup state machine. */ - GSM_DEBUG(DEB_F_PREFIX"B2BCNF subs terminate\n", - DEB_F_PREFIX_ARGS(GSM,fname)); + GSM_DEBUG(DEB_F_PREFIX"B2BCNF subs terminate\n", + DEB_F_PREFIX_ARGS(GSM,fname)); data.notify.subscription = CC_SUBSCRIPTIONS_REMOTECC; data.notify.method = CC_RCC_METHOD_REFER; @@ -505,8 +470,8 @@ static void sub_process_b2bcnf_msg (uint32_t cmd, void *msg) break; default: - GSM_DEBUG(DEB_F_PREFIX"B2BCNF subs unknown event\n", - DEB_F_PREFIX_ARGS(GSM,fname)); + GSM_DEBUG(DEB_F_PREFIX"B2BCNF subs unknown event\n", + DEB_F_PREFIX_ARGS(GSM,fname)); break; } } @@ -586,12 +551,12 @@ static void sub_process_feature_notify (ccsip_sub_not_data_t *msg, callid_t call * challenges to terminating SUBSCRIBE sent. */ (void)sub_int_subscribe_term(msg->sub_id, FALSE, msg->request_id, CC_SUBSCRIPTIONS_REMOTECC); - + } ev_data = msg->u.notify_ind_data.eventData; msg->u.notify_ind_data.eventData = NULL; if (ev_data == NULL) { - GSM_ERR_MSG(DEB_F_PREFIX"No body in the NOTIFY message\n", + GSM_ERR_MSG(DEB_F_PREFIX"No body in the NOTIFY message\n", DEB_F_PREFIX_ARGS(GSM, fname)); /* * if (no content & subscription state is TERMINATED @@ -625,16 +590,16 @@ gsm_is_idle (void) return (FALSE); } -/* +/* * Function: destroy_gsm_thread - * Description: shutdown gsm and kill gsm thread + * Description: shutdown gsm and kill gsm thread * Parameters: none * Returns: none */ void destroy_gsm_thread() { static const char fname[] = "destroy_gsm_thread"; - DEF_DEBUG(DEB_F_PREFIX"Unloading GSM and destroying GSM thread\n", + DEF_DEBUG(DEB_F_PREFIX"Unloading GSM and destroying GSM thread\n", DEB_F_PREFIX_ARGS(SIP_CC_INIT, fname)); gsm_shutdown(); dp_shutdown(); diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c b/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c index 1e9233221050..6e0f43a5e2d1 100644 --- a/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_in.h" #include "cpr_rand.h" @@ -68,15 +33,15 @@ #define GET_CODEC_TYPE(a) ((uint8_t)((a) & 0XFF)) #define GSMSDP_SET_MEDIA_DIABLE(media) \ - (media->src_port = 0) + (media->src_port = 0) #define CAST_DEFAULT_BITRATE 320000 /* * The maximum number of media lines per call. This puts the upper limit * on * the maximum number of media lines per call to resource hogging. - * The value of 8 is intended up to 2 audio and 2 video streams with + * The value of 8 is intended up to 2 audio and 2 video streams with * each stream can offer IPV4 and IPV6 alternate network address type - * in ANAT group (RFC-4091). + * in ANAT group (RFC-4091). */ #define GSMSDP_MAX_MLINES_PER_CALL (8) @@ -91,15 +56,15 @@ * media structures are allocated from heap and they will be freed back * from heap after thehy are not used. The only time where the heap * is used when phone reaches the maximum call capacity and each one - * of the call is using more than one media lines. + * of the call is using more than one media lines. */ #define GSMSDP_PERM_MEDIA_ELEMS (LSM_MAX_CALLS) /* - * The permanent free media structure elements use static array. + * The permanent free media structure elements use static array. * It is to ensure a low overhead for this a typical single audio call. - */ -static fsmdef_media_t gsmsdp_free_media_chunk[GSMSDP_PERM_MEDIA_ELEMS]; + */ +static fsmdef_media_t gsmsdp_free_media_chunk[GSMSDP_PERM_MEDIA_ELEMS]; static sll_lite_list_t gsmsdp_free_media_list; typedef enum { @@ -124,10 +89,10 @@ extern cc_media_cap_table_t g_media_table; extern vcm_media_payload_type_t vcmRtpToMediaPayload (int32_t ptype, int32_t dynamic_ptype_value, uint16_t mode); -extern boolean g_disable_mass_reg_debug_print; +extern boolean g_disable_mass_reg_debug_print; /** * A wraper function to return the media capability supported by - * the platform and session. This is a convient place if policy + * the platform and session. This is a convient place if policy * to get the capability table as it applies to the session * updates the media_cap_tbl ptr in dcb * @@ -142,36 +107,36 @@ static const cc_media_cap_table_t *gsmsdp_get_media_capability (fsmdef_dcb_t *dc int sdpmode = 0; if (g_disable_mass_reg_debug_print == FALSE) { - GSM_DEBUG(DEB_F_PREFIX"dcb video pref %x\n", + GSM_DEBUG(DEB_F_PREFIX"dcb video pref %x\n", DEB_F_PREFIX_ARGS(GSM, fname), dcb_p->video_pref); } - + config_get_value(CFGID_SDPMODE, &sdpmode, sizeof(sdpmode)); - + if ( dcb_p->media_cap_tbl == NULL ) { dcb_p->media_cap_tbl = (cc_media_cap_table_t*) cpr_malloc(sizeof(cc_media_cap_table_t)); if ( dcb_p->media_cap_tbl == NULL ) { - GSM_ERR_MSG(GSM_L_C_F_PREFIX"media table malloc failed.\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"media table malloc failed.\n", dcb_p->line, dcb_p->call_id, fname); return NULL; } - } - + } + *(dcb_p->media_cap_tbl) = g_media_table; if ( dcb_p->video_pref == SDP_DIRECTION_INACTIVE) { // do not enable video dcb_p->media_cap_tbl->cap[CC_VIDEO_1].enabled = FALSE; - } + } if ( dcb_p->video_pref == SDP_DIRECTION_RECVONLY ) { if ( dcb_p->media_cap_tbl->cap[CC_VIDEO_1].support_direction == SDP_DIRECTION_SENDRECV ) { dcb_p->media_cap_tbl->cap[CC_VIDEO_1].support_direction = dcb_p->video_pref; } - + if ( dcb_p->media_cap_tbl->cap[CC_VIDEO_1].support_direction == SDP_DIRECTION_SENDONLY ) { dcb_p->media_cap_tbl->cap[CC_VIDEO_1].support_direction = SDP_DIRECTION_INACTIVE; - DEF_DEBUG(GSM_L_C_F_PREFIX"video capability disabled to SDP_DIRECTION_INACTIVE from sendonly\n", + DEF_DEBUG(GSM_L_C_F_PREFIX"video capability disabled to SDP_DIRECTION_INACTIVE from sendonly\n", dcb_p->line, dcb_p->call_id, fname); } } else if ( dcb_p->video_pref == SDP_DIRECTION_SENDONLY ) { @@ -181,10 +146,10 @@ static const cc_media_cap_table_t *gsmsdp_get_media_capability (fsmdef_dcb_t *dc if ( dcb_p->media_cap_tbl->cap[CC_VIDEO_1].support_direction == SDP_DIRECTION_RECVONLY ) { dcb_p->media_cap_tbl->cap[CC_VIDEO_1].support_direction = SDP_DIRECTION_INACTIVE; - DEF_DEBUG(GSM_L_C_F_PREFIX"video capability disabled to SDP_DIRECTION_INACTIVE from recvonly\n", + DEF_DEBUG(GSM_L_C_F_PREFIX"video capability disabled to SDP_DIRECTION_INACTIVE from recvonly\n", dcb_p->line, dcb_p->call_id, fname); } - } // else if requested is SENDRECV just go by capability + } // else if requested is SENDRECV just go by capability /* * Turn off two default streams, this is temporary @@ -231,13 +196,13 @@ static const cc_media_remote_stream_table_t *gsmsdp_get_media_stream_table (fsmd /** * The function creates a free media structure elements list. The * free list is global for all calls. The function must be called once - * during GSM initializtion. + * during GSM initializtion. * * @param None. * * @return TRUE - free media structure list is created * successfully. - * FALSE - failed to create free media structure + * FALSE - failed to create free media structure * list. */ boolean @@ -256,7 +221,7 @@ gsmsdp_create_free_media_list (void) */ media = &gsmsdp_free_media_chunk[0]; /* first element */ for (i = 0; i < GSMSDP_PERM_MEDIA_ELEMS; i++) { - (void)sll_lite_link_head(&gsmsdp_free_media_list, + (void)sll_lite_link_head(&gsmsdp_free_media_list, (sll_lite_node_t *)media); media = media + 1; /* next element */ } @@ -273,12 +238,12 @@ gsmsdp_create_free_media_list (void) * * @return None. */ -void +void gsmsdp_destroy_free_media_list (void) { /* * Although the free chunk is not allocated but, - * NULL out the free list header to indicate that the + * NULL out the free list header to indicate that the * there is not thing from the free chunk. */ (void)sll_lite_init(&gsmsdp_free_media_list); @@ -286,14 +251,14 @@ gsmsdp_destroy_free_media_list (void) /** * The function allocates a media structure. The function - * attempts to obtain a free media structure from the free media + * attempts to obtain a free media structure from the free media * structure list first. If free list is empty then the media structure * is allocated from a memory pool. * * @param None. * * @return pointer to the fsmdef_media_t if successful or - * NULL when there is no free media structure + * NULL when there is no free media structure * is available. */ static fsmdef_media_t * @@ -307,18 +272,18 @@ gsmsdp_alloc_media (void) if (media == NULL) { /* no free element from cache, allocate it from the pool */ media = cpr_malloc(sizeof(fsmdef_media_t)); - GSM_DEBUG(DEB_F_PREFIX"get from dynamic pool, media %x\n", + GSM_DEBUG(DEB_F_PREFIX"get from dynamic pool, media %x\n", DEB_F_PREFIX_ARGS(GSM, fname), media); } return (media); } -/** +/** * The function frees a media structure back to the free list or * heap. If the media structure is from the free list then it * is put back to the free list otherwise it will be freed * back to the dynamic pool. - * + * * @param[in]media - pointer to fsmdef_media_t to free back to * free list. * @@ -350,12 +315,12 @@ gsmsdp_free_media (fsmdef_media_t *media) if ((media >= &gsmsdp_free_media_chunk[0]) && (media <= &gsmsdp_free_media_chunk[GSMSDP_PERM_MEDIA_ELEMS-1])) { /* the element is part of free chunk, put it back to the list */ - (void)sll_lite_link_head(&gsmsdp_free_media_list, + (void)sll_lite_link_head(&gsmsdp_free_media_list, (sll_lite_node_t *)media); } else { /* this element is from the dynamic pool, free it back */ cpr_free(media); - GSM_DEBUG(DEB_F_PREFIX"free media 0x%x to dynamic pool\n", + GSM_DEBUG(DEB_F_PREFIX"free media 0x%x to dynamic pool\n", DEB_F_PREFIX_ARGS(GSM, fname), media); } } @@ -426,7 +391,7 @@ gsmsdp_init_media (fsmdef_media_t *media) /** * * Returns a pointer to a new the fsmdef_media_t for a given dcb. - * The default media parameters will be intialized for the known or + * The default media parameters will be intialized for the known or * supported media types. The new media is also added to the media list * in the dcb. * @@ -449,9 +414,9 @@ gsmsdp_get_new_media (fsmdef_dcb_t *dcb_p, sdp_media_e media_type, /* check to ensue we do not handle too many media lines */ if (GSMSDP_MEDIA_COUNT(dcb_p) >= GSMSDP_MAX_MLINES_PER_CALL) { - GSM_ERR_MSG(GSM_L_C_F_PREFIX"exceeding media lines per call\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"exceeding media lines per call\n", dcb_p->line, dcb_p->call_id, fname); - return (NULL); + return (NULL); } /* allocate new media entry */ @@ -473,26 +438,26 @@ gsmsdp_get_new_media (fsmdef_dcb_t *dcb_p, sdp_media_e media_type, (sll_lite_node_t *)media); if (sll_lite_ret != SLL_LITE_RET_SUCCESS) { /* fails to put the new media entry on to the list */ - GSM_ERR_MSG(GSM_L_C_F_PREFIX"error %d when add media to list\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"error %d when add media to list\n", dcb_p->line, dcb_p->call_id, fname, sll_lite_ret); gsmsdp_free_media(media); media = NULL; - } - } + } + } return (media); } /** * The function removes the media entry from the list of a given call and * then deallocates the media entry. - * + * * @param[in]dcb - pointer to fsmdef_def_t for the dcb whose * media to be removed from. * @param[in]media - pointer to fsmdef_media_t for the media * entry to be removed. * * @return none - * + * * @pre (dcb not_eq NULL) */ static void gsmsdp_remove_media (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) @@ -501,7 +466,7 @@ static void gsmsdp_remove_media (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) cc_action_data_t data; if (media == NULL) { - GSM_ERR_MSG(GSM_L_C_F_PREFIX"removing NULL media\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"removing NULL media\n", dcb_p->line, dcb_p->call_id, fname); return; } @@ -513,7 +478,7 @@ static void gsmsdp_remove_media (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) &data); } /* remove this media off the list */ - (void)sll_lite_remove(&dcb_p->media_list, (sll_lite_node_t *)media); + (void)sll_lite_remove(&dcb_p->media_list, (sll_lite_node_t *)media); /* Release the port */ vcmRxReleasePort(media->cap_index, dcb_p->group_id, media->refid, @@ -521,7 +486,7 @@ static void gsmsdp_remove_media (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) /* free media structure */ gsmsdp_free_media(media); -} +} /** * The function performs cleaning media list of a given call. It walks @@ -529,19 +494,19 @@ static void gsmsdp_remove_media (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) * * @param[in]dcb - pointer to fsmdef_def_t for the dcb whose * media list to be cleaned. - * - * @return none - * + * + * @return none + * * @pre (dcb not_eq NULL) */ void gsmsdp_clean_media_list (fsmdef_dcb_t *dcb_p) { - fsmdef_media_t *media = NULL; - + fsmdef_media_t *media = NULL; + while (TRUE) { /* unlink head and free the media */ media = (fsmdef_media_t *)sll_lite_unlink_head(&dcb_p->media_list); - if (media != NULL) { + if (media != NULL) { gsmsdp_free_media(media); } else { break; @@ -569,11 +534,11 @@ void gsmsdp_init_media_list (fsmdef_dcb_t *dcb_p) /* do the actual media element list initialization */ (void)sll_lite_init(&dcb_p->media_list); - + media_cap_tbl = gsmsdp_get_media_capability(dcb_p); if (media_cap_tbl == NULL) { - GSM_ERR_MSG(GSM_L_C_F_PREFIX"no media capbility available\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"no media capbility available\n", dcb_p->line, dcb_p->call_id, fname); } @@ -608,30 +573,30 @@ gsmsdp_find_media_by_level (fsmdef_dcb_t *dcb_p, uint16_t level) */ GSMSDP_FOR_ALL_MEDIA(media, dcb_p) { if (media->level == level) { - /* found a match */ + /* found a match */ return (media); } } return (NULL); } -/** +/** * * Returns a pointer to the fsmdef_media_t in the dcb for the - * correspoinding reference ID. + * correspoinding reference ID. * * @param[in]dcb_p - pointer to the fsmdef_dcb_t * @param[in]refid - media reference ID to look for. - * + * * @return pointer to the fsmdef_media_t of the corresponding * media entry in the dcb. * @pre (dcb not_eq NULL) */ -fsmdef_media_t * +fsmdef_media_t * gsmsdp_find_media_by_refid (fsmdef_dcb_t *dcb_p, media_refid_t refid) { fsmdef_media_t *media = NULL; - + /* * search the all entries that has a valid media and matches * the reference ID. @@ -652,7 +617,7 @@ gsmsdp_find_media_by_refid (fsmdef_dcb_t *dcb_p, media_refid_t refid) * * @param[in]dcb_p - pointer to the fsmdef_dcb_t * @param[in]cap_index - capability table index. - * + * * @return pointer to the fsmdef_media_t of the corresponding * media entry in the dcb. * @pre (dcb not_eq NULL) @@ -661,14 +626,14 @@ static fsmdef_media_t * gsmsdp_find_media_by_cap_index (fsmdef_dcb_t *dcb_p, uint8_t cap_index) { fsmdef_media_t *media = NULL; - + /* * search the all entries that has a valid media and matches * the reference ID. */ GSMSDP_FOR_ALL_MEDIA(media, dcb_p) { if (media->cap_index == cap_index) { - /* found a match */ + /* found a match */ return (media); } } @@ -697,7 +662,7 @@ fsmdef_media_t *gsmsdp_find_audio_media (fsmdef_dcb_t *dcb_p) */ GSMSDP_FOR_ALL_MEDIA(media, dcb_p) { if (media->type == SDP_MEDIA_AUDIO) { - /* found a match */ + /* found a match */ return (media); } } @@ -705,18 +670,18 @@ fsmdef_media_t *gsmsdp_find_audio_media (fsmdef_dcb_t *dcb_p) } /** - * - * The function finds an unused media line given type. - * - * @param[in]sdp - void pointer of thd SDP libray handle. - * @param[in]media_type - media type of the unused line. - * + * + * The function finds an unused media line given type. + * + * @param[in]sdp - void pointer of thd SDP libray handle. + * @param[in]media_type - media type of the unused line. + * * @return level (line) of the unused one if found or - * 0 if there is no unused one found. + * 0 if there is no unused one found. */ -static uint16_t +static uint16_t gsmsdp_find_unused_media_line_with_type (void *sdp, sdp_media_e media_type) -{ +{ uint16_t num_m_lines, level; int32_t port; @@ -733,7 +698,7 @@ gsmsdp_find_unused_media_line_with_type (void *sdp, sdp_media_e media_type) } /* no unused media line of the given type found */ return (0); -} +} /** * @@ -771,16 +736,16 @@ gsmsdp_get_media_cap_entry_by_index (uint8_t cap_index, fsmdef_dcb_t *dcb_p) * * @param[in]dcb_p - pointer to the fsmdef_dcb_t * @param[in]media - current media level. - * + * * @return pointer to the fsmdef_media_t of the corresponding * media entry in the dcb. * @pre (dcb not_eq NULL) */ -fsmdef_media_t * +fsmdef_media_t * gsmsdp_find_anat_pair (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) { fsmdef_media_t *searched_media = NULL; - + /* * search the all entries that has a the same capability index * but at a different level. The only time that this is true is @@ -799,14 +764,14 @@ gsmsdp_find_anat_pair (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) /** * * The function queries platform to see if the platform is capable - * of handle mixing additional media or not. - * + * of handle mixing additional media or not. + * * P2: This may go away when integrate with the platform. * * @param[in]dcb_p - pointer to the fsmdef_dcb_t structure. * @param[in]media_type - media type to be mixed. * - * @return TRUE the media can be mixed. + * @return TRUE the media can be mixed. * FALSE the media can not be mixed * * @pre (dcb_p not_eq NULL) @@ -826,7 +791,7 @@ gsmsdp_platform_addition_mix (fsmdef_dcb_t *dcb_p, sdp_media_e media_type) * @param[in]dcb_p - pointer to the fsmdef_dcb_t * @param[in]offer - boolean indicates this is procssing an offered * SDP - * @param[in]initial_offer - boolean indicates this is processin an + * @param[in]initial_offer - boolean indicates this is processin an * initial offered SDP. * * @return none. @@ -852,7 +817,7 @@ gsmsdp_update_local_time_stamp (fsmdef_dcb_t *dcb_p, boolean offer, * Per RFC3264, time description of answer must equal that * of the offer. */ - (void) sdp_set_time_start(local_sdp_p, + (void) sdp_set_time_start(local_sdp_p, sdp_get_time_start(remote_sdp_p)); (void) sdp_set_time_stop(local_sdp_p, sdp_get_time_stop(remote_sdp_p)); } else if (offer) { @@ -895,7 +860,7 @@ gsmsdp_get_local_source_v4_address (fsmdef_media_t *media) { int nat_enable = 0; char curr_media_ip[MAX_IPADDR_STR_LEN]; - cpr_ip_addr_t addr; + cpr_ip_addr_t addr; const char fname[] = "gsmsdp_get_local_source_v4_address"; /* @@ -1052,8 +1017,8 @@ gsmsdp_set_video_media_attributes (uint32_t media_type, void *cc_sdp_p, uint16_t (void) sdp_attr_set_rtpmap_clockrate(sdp_p, level, 0, a_inst, RTPMAP_VIDEO_CLOCKRATE); break; - case RTP_H264_P0: - case RTP_H264_P1: + case RTP_H264_P0: + case RTP_H264_P1: (void) sdp_attr_set_rtpmap_encname(sdp_p, level, 0, a_inst, SIPSDP_ATTR_ENCNAME_H264); (void) sdp_attr_set_rtpmap_clockrate(sdp_p, level, 0, a_inst, @@ -1072,7 +1037,7 @@ gsmsdp_set_video_media_attributes (uint32_t media_type, void *cc_sdp_p, uint16_t break; - default: + default: break; } } @@ -1117,12 +1082,12 @@ gsmsdp_set_media_attributes (uint32_t media_type, void *sdp_p, uint16_t level, - switch (media_type) { + switch (media_type) { case RTP_PCMU: // type 0 case RTP_PCMA: // type 8 case RTP_G729: // type 18 case RTP_G722: // type 9 - case RTP_ILBC: + case RTP_ILBC: case RTP_L16: case RTP_ISAC: case RTP_OPUS: @@ -1142,13 +1107,13 @@ gsmsdp_set_media_attributes (uint32_t media_type, void *sdp_p, uint16_t level, (void) sdp_attr_set_rtpmap_encname(sdp_p, level, 0, a_inst, SIPSDP_ATTR_ENCNAME_PCMU); (void) sdp_attr_set_rtpmap_clockrate(sdp_p, level, 0, a_inst, - RTPMAP_CLOCKRATE); + RTPMAP_CLOCKRATE); break; case RTP_PCMA: (void) sdp_attr_set_rtpmap_encname(sdp_p, level, 0, a_inst, SIPSDP_ATTR_ENCNAME_PCMA); (void) sdp_attr_set_rtpmap_clockrate(sdp_p, level, 0, a_inst, - RTPMAP_CLOCKRATE); + RTPMAP_CLOCKRATE); break; case RTP_G729: { @@ -1166,21 +1131,21 @@ gsmsdp_set_media_attributes (uint32_t media_type, void *sdp_p, uint16_t level, RTPMAP_CLOCKRATE); } break; - + case RTP_G722: (void) sdp_attr_set_rtpmap_encname(sdp_p, level, 0, a_inst, SIPSDP_ATTR_ENCNAME_G722); (void) sdp_attr_set_rtpmap_clockrate(sdp_p, level, 0, a_inst, - RTPMAP_CLOCKRATE); + RTPMAP_CLOCKRATE); break; case RTP_L16: (void) sdp_attr_set_rtpmap_encname(sdp_p, level, 0, a_inst, SIPSDP_ATTR_ENCNAME_L16_256K); - + (void) sdp_attr_set_rtpmap_clockrate(sdp_p, level, 0, a_inst, - RTPMAP_L16_CLOCKRATE); - break; + RTPMAP_L16_CLOCKRATE); + break; case RTP_ILBC: (void) sdp_attr_set_rtpmap_encname(sdp_p, level, 0, a_inst, @@ -1262,7 +1227,7 @@ gsmsdp_set_media_attributes (uint32_t media_type, void *sdp_p, uint16_t level, } break; - } + } break; case RTP_AVT: @@ -1435,7 +1400,7 @@ gsmsdp_set_sdp_direction (fsmdef_media_t *media, (void) sdp_add_new_attr(sdp_p, media->level, 0, sdp_attr, &a_instance); } else { /* Just in case that there is no level defined, add to the session */ - (void) sdp_add_new_attr(sdp_p, SDP_SESSION_LEVEL, 0, sdp_attr, + (void) sdp_add_new_attr(sdp_p, SDP_SESSION_LEVEL, 0, sdp_attr, &a_instance); } } @@ -1583,7 +1548,7 @@ gsmsdp_set_rtcp_mux_attribute (sdp_attr_e sdp_attr, uint16_t level, void *sdp_p, * fingerprint_len - string len of fingerprint */ static void -gsmsdp_set_dtls_fingerprint_attribute (sdp_attr_e sdp_attr, uint16_t level, void *sdp_p, +gsmsdp_set_dtls_fingerprint_attribute (sdp_attr_e sdp_attr, uint16_t level, void *sdp_p, char *hash_func,char *fingerprint) { uint16_t a_instance = 0; @@ -1623,7 +1588,7 @@ gsmsdp_set_dtls_fingerprint_attribute (sdp_attr_e sdp_attr, uint16_t level, void * removed. */ static void -gsmsdp_remove_sdp_direction (fsmdef_media_t *media, +gsmsdp_remove_sdp_direction (fsmdef_media_t *media, sdp_direction_e direction, void *sdp_p) { sdp_attr_e sdp_attr = SDP_ATTR_SENDRECV; @@ -1646,8 +1611,8 @@ gsmsdp_remove_sdp_direction (fsmdef_media_t *media, * direction - The media direction to set into the local SDP. */ void -gsmsdp_set_local_sdp_direction (fsmdef_dcb_t *dcb_p, - fsmdef_media_t *media, +gsmsdp_set_local_sdp_direction (fsmdef_dcb_t *dcb_p, + fsmdef_media_t *media, sdp_direction_e direction) { /* @@ -1657,7 +1622,7 @@ gsmsdp_set_local_sdp_direction (fsmdef_dcb_t *dcb_p, */ if (media->direction_set) { media->previous_sdp.direction = media->direction; - gsmsdp_remove_sdp_direction(media, media->direction, + gsmsdp_remove_sdp_direction(media, media->direction, dcb_p->sdp ? dcb_p->sdp->src_sdp: NULL ); media->direction_set = FALSE; } @@ -1755,7 +1720,7 @@ gsmsdp_get_remote_sdp_direction (fsmdef_dcb_t *dcb_p, uint16_t level, * To support legacy way of signaling remote hold, we will interpret * c=0.0.0.0 to be a=inactive */ - if (dest_addr->type == CPR_IP_ADDR_IPV4 && + if (dest_addr->type == CPR_IP_ADDR_IPV4 && dest_addr->u.ip4 == 0) { direction = SDP_DIRECTION_INACTIVE; @@ -1781,10 +1746,10 @@ gsmsdp_get_remote_sdp_direction (fsmdef_dcb_t *dcb_p, uint16_t level, static void gsmsdp_feature_overide_direction (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) { - /* + /* * Disable video if this is a BARGE with video */ - if ( CC_IS_VIDEO(media->cap_index) && + if ( CC_IS_VIDEO(media->cap_index) && dcb_p->join_call_id != CC_NO_CALL_ID ){ media->support_direction = SDP_DIRECTION_INACTIVE; } @@ -1817,8 +1782,8 @@ gsmsdp_feature_overide_direction (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) * disabled sendrecv sendonly sendonly * disabled sendrecv recvonly recvonly * disabled sendrecv inactive inactive - * disabled sendonly sendrecv recvonly - * disabled sendonly sendonly inactive + * disabled sendonly sendrecv recvonly + * disabled sendonly sendonly inactive * disabled sendonly recvonly recvonly * disabled sendonly inactive inactive * disabled recvonly sendrecv sendonly @@ -1840,11 +1805,11 @@ gsmsdp_negotiate_local_sdp_direction (fsmdef_dcb_t *dcb_p, sdp_direction_e direction = SDP_DIRECTION_SENDRECV; sdp_direction_e remote_direction = gsmsdp_get_remote_sdp_direction(dcb_p, media->level, &media->dest_addr); - + if (remote_direction == SDP_DIRECTION_SENDRECV) { if (local_hold) { if ((media->support_direction == SDP_DIRECTION_SENDRECV) || - (media->support_direction == SDP_DIRECTION_SENDONLY)) { + (media->support_direction == SDP_DIRECTION_SENDONLY)) { direction = SDP_DIRECTION_SENDONLY; } else { direction = SDP_DIRECTION_INACTIVE; @@ -1966,7 +1931,7 @@ gsmsdp_add_default_audio_formats_to_local_sdp (fsmdef_dcb_t *dcb_p, if (sdp_add_media_payload_type(local_sdp_p, level, (uint16_t)local_media_types[type_cnt], SDP_PAYLOAD_NUMERIC) != SDP_SUCCESS) { - GSM_ERR_MSG(GSM_L_C_F_PREFIX"Adding media payload type failed\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"Adding media payload type failed\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname)); } @@ -1981,7 +1946,7 @@ gsmsdp_add_default_audio_formats_to_local_sdp (fsmdef_dcb_t *dcb_p, if (sdp_add_media_payload_type(local_sdp_p, level, local_avt_payload_type, SDP_PAYLOAD_NUMERIC) != SDP_SUCCESS) { - GSM_ERR_MSG(GSM_L_C_F_PREFIX"Adding AVT payload type failed\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"Adding AVT payload type failed\n", dcb_p->line, dcb_p->call_id, fname); } @@ -2075,7 +2040,7 @@ gsmsdp_add_default_video_formats_to_local_sdp (fsmdef_dcb_t *dcb_p, if (sdp_add_media_payload_type(local_sdp_p, level, (uint16_t)video_media_types[type_cnt], SDP_PAYLOAD_NUMERIC) != SDP_SUCCESS) { - GSM_ERR_MSG(GSM_L_C_F_PREFIX"SDP ERROR(1)\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"SDP ERROR(1)\n", line, call_id, fname); } @@ -2105,20 +2070,20 @@ static void gsmsdp_set_mid_attr (void *src_sdp_p, uint16_t level) */ (void) sdp_add_new_attr(src_sdp_p, level, 0, SDP_ATTR_MID, &inst_num); - (void) sdp_attr_set_simple_u32(src_sdp_p, SDP_ATTR_MID, level, 0, + (void) sdp_attr_set_simple_u32(src_sdp_p, SDP_ATTR_MID, level, 0, inst_num, level); } } /** * This function sets the anat attr to the session level - * and labels the relevant media streams + * and labels the relevant media streams * - * @param[in]media - The media line that we are operating on. + * @param[in]media - The media line that we are operating on. * @param[in]dcb_p - Pointer to the DCB whose local SDP is to be updated. * * @return - None - * + * */ static void gsmsdp_set_anat_attr (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) { @@ -2130,11 +2095,11 @@ static void gsmsdp_set_anat_attr (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) u32 group_id_1, group_id_2; uint16_t i; fsmdef_media_t *group_media; - + if (dest_sdp_p == NULL) { /* If this is our initial offer */ - if (media->addr_type == SDP_AT_IP4) { + if (media->addr_type == SDP_AT_IP4) { group_media = gsmsdp_find_anat_pair(dcb_p, media); if (group_media != NULL) { /* @@ -2142,20 +2107,20 @@ static void gsmsdp_set_anat_attr (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) */ (void) sdp_add_new_attr(src_sdp_p, SDP_SESSION_LEVEL, 0, SDP_ATTR_GROUP, &inst_num); - (void) sdp_set_group_attr(src_sdp_p, SDP_SESSION_LEVEL, 0, inst_num, SDP_GROUP_ATTR_ANAT); + (void) sdp_set_group_attr(src_sdp_p, SDP_SESSION_LEVEL, 0, inst_num, SDP_GROUP_ATTR_ANAT); (void) sdp_set_group_num_id(src_sdp_p, SDP_SESSION_LEVEL, 0, inst_num, 2); (void) sdp_set_group_id(src_sdp_p, SDP_SESSION_LEVEL, 0, inst_num, group_media->level); - (void) sdp_set_group_id(src_sdp_p, SDP_SESSION_LEVEL, 0, inst_num, media->level); + (void) sdp_set_group_id(src_sdp_p, SDP_SESSION_LEVEL, 0, inst_num, media->level); } } } else { /* This is an answer, check if the offer rcvd had anat grouping */ (void) sdp_attr_num_instances(dest_sdp_p, SDP_SESSION_LEVEL, 0, SDP_ATTR_GROUP, &num_group_lines); - + for (i = 1; i <= num_group_lines; i++) { - if (sdp_get_group_attr(dest_sdp_p, SDP_SESSION_LEVEL, 0, i) == SDP_GROUP_ATTR_ANAT) { + if (sdp_get_group_attr(dest_sdp_p, SDP_SESSION_LEVEL, 0, i) == SDP_GROUP_ATTR_ANAT) { num_anat_lines++; } } @@ -2163,23 +2128,23 @@ static void gsmsdp_set_anat_attr (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) for (i = 1; i <= num_anat_lines; i++) { group_id_1 = sdp_get_group_id(dest_sdp_p, SDP_SESSION_LEVEL, 0, i, 1); group_id_2 = sdp_get_group_id(dest_sdp_p, SDP_SESSION_LEVEL, 0, i, 2); - - if ((media->level == group_id_1) || (media->level == group_id_2)) { - + + if ((media->level == group_id_1) || (media->level == group_id_2)) { + group_media = gsmsdp_find_anat_pair(dcb_p, media); - if (group_media != NULL) { + if (group_media != NULL) { if (sdp_get_group_attr(src_sdp_p, SDP_SESSION_LEVEL, 0, i) != SDP_GROUP_ATTR_ANAT) { /* * add a=group line */ (void) sdp_add_new_attr(src_sdp_p, SDP_SESSION_LEVEL, 0, SDP_ATTR_GROUP, &inst_num); (void) sdp_set_group_attr(src_sdp_p, SDP_SESSION_LEVEL, 0, inst_num, SDP_GROUP_ATTR_ANAT); - - } + + } (void) sdp_set_group_num_id(src_sdp_p, SDP_SESSION_LEVEL, 0, i, 2); (void) sdp_set_group_id(src_sdp_p, SDP_SESSION_LEVEL, 0, i, group_media->level); (void) sdp_set_group_id(src_sdp_p, SDP_SESSION_LEVEL, 0, i, media->level); - + } else { /* * add a=group line @@ -2190,10 +2155,10 @@ static void gsmsdp_set_anat_attr (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) (void) sdp_set_group_num_id(src_sdp_p, SDP_SESSION_LEVEL, 0, inst_num, 1); (void) sdp_set_group_id(src_sdp_p, SDP_SESSION_LEVEL, 0, inst_num, media->level); } - + } } - } + } gsmsdp_set_mid_attr (src_sdp_p, media->level); } @@ -2230,7 +2195,7 @@ gsmsdp_update_local_sdp_media (fsmdef_dcb_t *dcb_p, cc_sdp_t *cc_sdp_p, sdp_result_e result; int dynamic_payload_type; uint16_t level; - void *sdp_p; + void *sdp_p; if (!dcb_p || !media) { GSM_ERR_MSG(get_debug_string(FSMDEF_DBG_INVALID_DCB), fname); @@ -2240,18 +2205,18 @@ gsmsdp_update_local_sdp_media (fsmdef_dcb_t *dcb_p, cc_sdp_t *cc_sdp_p, port = media->src_port; sdp_p = cc_sdp_p ? (void *) cc_sdp_p->src_sdp : NULL; - + if (sdp_p == NULL) { gsmsdp_init_local_sdp(&(dcb_p->sdp)); cc_sdp_p = dcb_p->sdp; if ((cc_sdp_p == NULL) || (cc_sdp_p->src_sdp == NULL)) { - GSM_ERR_MSG(GSM_L_C_F_PREFIX"sdp is NULL and init failed \n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"sdp is NULL and init failed \n", dcb_p->line, dcb_p->call_id, fname); return; } - sdp_p = (void *) cc_sdp_p->src_sdp; + sdp_p = (void *) cc_sdp_p->src_sdp; } else { /* @@ -2264,7 +2229,7 @@ gsmsdp_update_local_sdp_media (fsmdef_dcb_t *dcb_p, cc_sdp_t *cc_sdp_p, result = sdp_insert_media_line(sdp_p, level); if (result != SDP_SUCCESS) { - GSM_ERR_MSG(GSM_L_C_F_PREFIX"Inserting media line to Sdp failed\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"Inserting media line to Sdp failed\n", dcb_p->line, dcb_p->call_id, fname); return; } @@ -2297,7 +2262,7 @@ gsmsdp_update_local_sdp_media (fsmdef_dcb_t *dcb_p, cc_sdp_t *cc_sdp_p, break; default: GSM_ERR_MSG(GSM_L_C_F_PREFIX"SDP ERROR media %d for level %d is not" - " supported\n", + " supported\n", dcb_p->line, dcb_p->call_id, fname, media->level); break; } @@ -2317,7 +2282,7 @@ gsmsdp_update_local_sdp_media (fsmdef_dcb_t *dcb_p, cc_sdp_t *cc_sdp_p, (uint16_t)dynamic_payload_type, SDP_PAYLOAD_NUMERIC); if (result != SDP_SUCCESS) { - GSM_ERR_MSG(GSM_L_C_F_PREFIX"Adding dynamic payload type failed\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"Adding dynamic payload type failed\n", dcb_p->line, dcb_p->call_id, fname); } switch (media->type) { @@ -2347,7 +2312,7 @@ gsmsdp_update_local_sdp_media (fsmdef_dcb_t *dcb_p, cc_sdp_t *cc_sdp_p, (uint16_t)media->avt_payload_type, SDP_PAYLOAD_NUMERIC); if (result != SDP_SUCCESS) { - GSM_ERR_MSG(GSM_L_C_F_PREFIX"Adding AVT payload type failed\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"Adding AVT payload type failed\n", dcb_p->line, dcb_p->call_id, fname); } gsmsdp_set_media_attributes(RTP_AVT, sdp_p, level, @@ -2377,7 +2342,7 @@ gsmsdp_update_local_sdp_media (fsmdef_dcb_t *dcb_p, cc_sdp_t *cc_sdp_p, * FALSE - update the local SDP failed. */ static boolean -gsmsdp_update_local_sdp (fsmdef_dcb_t *dcb_p, boolean offer, +gsmsdp_update_local_sdp (fsmdef_dcb_t *dcb_p, boolean offer, boolean initial_offer, fsmdef_media_t *media) { @@ -2387,7 +2352,7 @@ gsmsdp_update_local_sdp (fsmdef_dcb_t *dcb_p, boolean offer, boolean local_hold = (boolean)FSM_CHK_FLAGS(media->hold, FSM_HOLD_LCL); if (media->src_port == 0) { - GSM_DEBUG(DEB_L_C_F_PREFIX"allocate receive port for media line\n", + GSM_DEBUG(DEB_L_C_F_PREFIX"allocate receive port for media line\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname)); /* * Source port has not been allocated, this could mean we @@ -2410,7 +2375,7 @@ gsmsdp_update_local_sdp (fsmdef_dcb_t *dcb_p, boolean offer, media->src_port = data.open_rcv.port; media->rcv_chan = FALSE; /* mark no RX chan yet */ } else { - GSM_ERR_MSG(GSM_L_C_F_PREFIX"allocate rx port failed\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"allocate rx port failed\n", dcb_p->line, dcb_p->call_id, fname); return (FALSE); } @@ -2425,7 +2390,7 @@ gsmsdp_update_local_sdp (fsmdef_dcb_t *dcb_p, boolean offer, * Update Transmit SRTP transmit key if this SRTP session. */ if (media->transport == SDP_TRANSPORT_RTPSAVP) { - gsmsdp_update_crypto_transmit_key(dcb_p, media, offer, + gsmsdp_update_crypto_transmit_key(dcb_p, media, offer, initial_offer, direction); } @@ -2461,7 +2426,7 @@ gsmsdp_update_local_sdp (fsmdef_dcb_t *dcb_p, boolean offer, * * dcb_p - Pointer to the DCB whose local SDP is to be updated. * portnum - Remote port. - * media - Pointer to fsmdef_media_t for the media entry of the SDP. + * media - Pointer to fsmdef_media_t for the media entry of the SDP. * offer - boolean indicating an offer SDP if true. * initial_offer - boolean indicating an initial offer SDP if true. * @@ -2494,7 +2459,7 @@ gsmsdp_update_local_sdp_for_multicast (fsmdef_dcb_t *dcb_p, * Update Transmit SRTP transmit key any way to clean up the * tx condition that we may have offered prior. */ - gsmsdp_update_crypto_transmit_key(dcb_p, media, offer, initial_offer, + gsmsdp_update_crypto_transmit_key(dcb_p, media, offer, initial_offer, direction); gsmsdp_update_local_sdp_media(dcb_p, dcb_p->sdp, FALSE, @@ -2505,7 +2470,7 @@ gsmsdp_update_local_sdp_for_multicast (fsmdef_dcb_t *dcb_p, */ if ((direction == SDP_DIRECTION_RECVONLY) || (direction == SDP_DIRECTION_INACTIVE)) { if ((media->support_direction == SDP_DIRECTION_SENDRECV) || - (media->support_direction == SDP_DIRECTION_RECVONLY)) { + (media->support_direction == SDP_DIRECTION_RECVONLY)) { /* * Echo same direction back in our local SDP but set the direction * in DCB to recvonly so that LSM operations on rcv port work @@ -2619,7 +2584,7 @@ gsmsdp_get_remote_avt_payload_type (uint16_t level, void *sdp_p) * <= 0: negotiation failed */ static int -gsmsdp_negotiate_codec (fsmdef_dcb_t *dcb_p, cc_sdp_t *sdp_p, +gsmsdp_negotiate_codec (fsmdef_dcb_t *dcb_p, cc_sdp_t *sdp_p, fsmdef_media_t *media, boolean offer, boolean initial_offer) { static const char fname[] = "gsmsdp_negotiate_codec"; @@ -2647,14 +2612,14 @@ gsmsdp_negotiate_codec (fsmdef_dcb_t *dcb_p, cc_sdp_t *sdp_p, boolean stereo; boolean useinbandfec; boolean cbr; - boolean found_codec = FALSE; - int32_t num_match_payloads = 0; - int payload = RTP_NONE; + boolean found_codec = FALSE; + int32_t num_match_payloads = 0; + int payload = RTP_NONE; int remote_dynamic_payload_type_value = RTP_NONE; int local_dynamic_payload_type_value = RTP_NONE; int32_t payload_types_count = 0; // count for allocating right amout // of memory for media->paylaods - + if (!dcb_p || !sdp_p || !media) { return (RTP_NONE); } @@ -2695,7 +2660,7 @@ gsmsdp_negotiate_codec (fsmdef_dcb_t *dcb_p, cc_sdp_t *sdp_p, num_local_types = sip_config_video_supported_codecs_get( (rtp_ptype *)local_media_types, CC_MAX_MEDIA_TYPES, offer); } else { - GSM_DEBUG(DEB_L_C_F_PREFIX"unsupported media type %d\n", + GSM_DEBUG(DEB_L_C_F_PREFIX"unsupported media type %d\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), media->type); return (RTP_NONE); } @@ -2757,7 +2722,7 @@ gsmsdp_negotiate_codec (fsmdef_dcb_t *dcb_p, cc_sdp_t *sdp_p, * so this will ensure that we will match the preferred codec with the * remote list first, before matching other codecs. */ - pref_codec = sip_config_preferred_codec(); + pref_codec = sip_config_preferred_codec(); if (pref_codec != RTP_NONE) { /* * If a preferred codec was configured and the platform @@ -2767,7 +2732,7 @@ gsmsdp_negotiate_codec (fsmdef_dcb_t *dcb_p, cc_sdp_t *sdp_p, */ if (local_media_types[0] != pref_codec) { /* - * preferred codec is configured but it is not avaible + * preferred codec is configured but it is not avaible * currently, treat it as there is no codec available. */ pref_codec = RTP_NONE; @@ -2796,11 +2761,11 @@ gsmsdp_negotiate_codec (fsmdef_dcb_t *dcb_p, cc_sdp_t *sdp_p, media->previous_sdp.local_payload_type = media->local_dynamic_payload_type_value; /* - * Setup payload info structure list to store matched payload details in the SDP. + * Setup payload info structure list to store matched payload details in the SDP. */ media->num_payloads = 0; if(num_master_types <= num_slave_types ) { - payload_types_count = num_master_types; + payload_types_count = num_master_types; } else { payload_types_count = num_slave_types; } @@ -2808,9 +2773,9 @@ gsmsdp_negotiate_codec (fsmdef_dcb_t *dcb_p, cc_sdp_t *sdp_p, media->payloads = (vcm_media_payload_type_t*) cpr_malloc(payload_types_count * sizeof(vcm_media_payload_type_t)); if (!(media->payloads)) { - GSM_ERR_MSG(GSM_L_C_F_PREFIX"Memory Allocation failed for payloads\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"Memory Allocation failed for payloads\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname)); - return RTP_NONE; + return RTP_NONE; } for (i = 0; i < num_master_types; i++) { @@ -2818,7 +2783,7 @@ gsmsdp_negotiate_codec (fsmdef_dcb_t *dcb_p, cc_sdp_t *sdp_p, if (GET_CODEC_TYPE(master_list_p[i]) == GET_CODEC_TYPE(slave_list_p[j])) { payload = GET_CODEC_TYPE(slave_list_p[j]); if (offer == TRUE) { // if remote SDP is an offer - /* we answer with same dynamic payload type value for a given dynamic payload type */ + /* we answer with same dynamic payload type value for a given dynamic payload type */ if (master_list_p == remote_media_types) { remote_dynamic_payload_type_value = GET_DYN_PAYLOAD_TYPE_VALUE(master_list_p[i]); local_dynamic_payload_type_value = GET_DYN_PAYLOAD_TYPE_VALUE(master_list_p[i]); @@ -2840,7 +2805,7 @@ gsmsdp_negotiate_codec (fsmdef_dcb_t *dcb_p, cc_sdp_t *sdp_p, remote_dynamic_payload_type_value = GET_DYN_PAYLOAD_TYPE_VALUE(slave_list_p[j]); } } - + if (media->type == SDP_MEDIA_AUDIO) { ptime = sdp_attr_get_simple_u32(sdp_p->dest_sdp, SDP_ATTR_PTIME, level, 0, 1); @@ -2878,7 +2843,7 @@ gsmsdp_negotiate_codec (fsmdef_dcb_t *dcb_p, cc_sdp_t *sdp_p, GSM_DEBUG(DEB_L_C_F_PREFIX"codec= %d\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), payload); - + } else if (media->type == SDP_MEDIA_VIDEO) { if ( media-> video != NULL ) { vcmFreeMediaPtr(media->video); @@ -2887,26 +2852,26 @@ gsmsdp_negotiate_codec (fsmdef_dcb_t *dcb_p, cc_sdp_t *sdp_p, if ( vcmCheckAttribs(media->payload, sdp_p, level, &media->video) == FALSE ) { - GSM_DEBUG(DEB_L_C_F_PREFIX"codec= %d ignored - attribs not accepted\n", - DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, + GSM_DEBUG(DEB_L_C_F_PREFIX"codec= %d ignored - attribs not accepted\n", + DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), media->payload); explicit_reject = TRUE; continue; // keep looking } - // cache the negotiated profile_level and bandwidth + // cache the negotiated profile_level and bandwidth media->previous_sdp.tias_bw = media->tias_bw; media->tias_bw = ccsdpGetBandwidthValue(sdp_p,level, 1); - if ( (attr_label = + if ( (attr_label = ccsdpAttrGetFmtpProfileLevelId(sdp_p,level,0,1)) != NULL ) { media->previous_sdp.profile_level = media->profile_level; sscanf(attr_label,"%x", &media->profile_level); } GSM_DEBUG(DEB_L_C_F_PREFIX"codec= %d\n", - DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, + DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), media->payload); - + } found_codec = TRUE; if(media->num_payloads >= payload_types_count) { @@ -2919,29 +2884,29 @@ gsmsdp_negotiate_codec (fsmdef_dcb_t *dcb_p, cc_sdp_t *sdp_p, media->num_payloads++; if(offer) { //return on the first match - return payload; + return payload; } } } } - // we should be ok to return a valid payload here. The calling function doesn't care - //unless it is RTP_NONE + // we should be ok to return a valid payload here. The calling function doesn't care + //unless it is RTP_NONE if(found_codec) { return (payload); } /* - * CSCsv84705 - we could not negotiate a common codec because the local list is empty. This condition could happen + * CSCsv84705 - we could not negotiate a common codec because the local list is empty. This condition could happen * when using g729 in locally mixed conference in which another call to vcm_get_codec_list() would return 0 or no codec. * So if this is a not an init offer, we should just go ahead and use the last negotiated codec if the remote list - * matches with currently used. - */ + * matches with currently used. + */ if (!initial_offer && explicit_reject == FALSE) { for (i = 0; i < num_types; i++) { if (media->payload == GET_CODEC_TYPE(remote_media_types[i])) { /* - * CSCta40560 - DSP runs out of bandwidth as the current API's do not consider the request is for - * the same call. Need to update dynamic payload types for dynamic PT codecs. Would need to possibly + * CSCta40560 - DSP runs out of bandwidth as the current API's do not consider the request is for + * the same call. Need to update dynamic payload types for dynamic PT codecs. Would need to possibly * add other video codecs as support is added here. */ if ( (media->payload == RTP_H264_P1 || media->payload == RTP_H264_P0) && offer == TRUE ) { @@ -3063,7 +3028,7 @@ gsmsdp_add_unsupported_stream_to_local_sdp (cc_sdp_t *sdp_p, * at the media level can become complex. For this reason, the * unsupported media line will have "c=" with 0.0.0.0 address instead. */ - gsmsdp_set_connection_address(sdp_p->src_sdp, level, "0.0.0.0"); + gsmsdp_set_connection_address(sdp_p->src_sdp, level, "0.0.0.0"); } /* @@ -3119,7 +3084,7 @@ gsmsdp_get_remote_media_address (fsmdef_dcb_t *dcb_p, *dest_addr = ip_addr_invalid; stat = FALSE; GSM_ERR_MSG(GSM_L_C_F_PREFIX"DNS remote address error %d" - " with media at %d\n", dcb_p->line, dcb_p->call_id, + " with media at %d\n", dcb_p->line, dcb_p->call_id, fname, dns_err_code, level); } } @@ -3127,7 +3092,7 @@ gsmsdp_get_remote_media_address (fsmdef_dcb_t *dcb_p, /* * No address the media level or the session level. */ - GSM_ERR_MSG(GSM_L_C_F_PREFIX"No remote address from SDP with at %d\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"No remote address from SDP with at %d\n", dcb_p->line, dcb_p->call_id, fname, level); } /* @@ -3169,7 +3134,7 @@ gsmsdp_is_multicast_address (cpr_ip_addr_t theIpAddress) (theIpAddress.u.ip4 <= MULTICAST_END_ADDRESS)) { return (TRUE); } - } else { + } else { //todo IPv6: Check IPv6 multicast address here. } @@ -3207,15 +3172,15 @@ gsmsdp_find_anat_media_line (fsmdef_dcb_t *dcb_p, cc_sdp_t *sdp_p, uint16_t leve */ (void) sdp_attr_num_instances(sdp_p->dest_sdp, SDP_SESSION_LEVEL, 0, SDP_ATTR_GROUP, &num_group_lines); - + for (i = 1; i <= num_group_lines; i++) { - if (sdp_get_group_attr(sdp_p->dest_sdp, SDP_SESSION_LEVEL, 0, i) == SDP_GROUP_ATTR_ANAT) { + if (sdp_get_group_attr(sdp_p->dest_sdp, SDP_SESSION_LEVEL, 0, i) == SDP_GROUP_ATTR_ANAT) { num_anat_lines++; } } for (i = 1; i <= num_anat_lines; i++) { - + dst_mid = sdp_attr_get_simple_u32(sdp_p->dest_sdp, SDP_ATTR_MID, level, 0, 1); group_id_1 = sdp_get_group_id(sdp_p->dest_sdp, SDP_SESSION_LEVEL, 0, i, 1); group_id_2 = sdp_get_group_id(sdp_p->dest_sdp, SDP_SESSION_LEVEL, 0, i, 2); @@ -3223,20 +3188,20 @@ gsmsdp_find_anat_media_line (fsmdef_dcb_t *dcb_p, cc_sdp_t *sdp_p, uint16_t leve if (dst_mid == group_id_1) { GSMSDP_FOR_ALL_MEDIA(anat_media, dcb_p) { group_mid = sdp_attr_get_simple_u32(sdp_p->src_sdp, - SDP_ATTR_MID, (uint16_t) group_id_2, 0, 1); + SDP_ATTR_MID, (uint16_t) group_id_2, 0, 1); if (group_mid == group_id_2) { - /* found a match */ + /* found a match */ return (anat_media); } } } else if (dst_mid == group_id_2) { GSMSDP_FOR_ALL_MEDIA(anat_media, dcb_p) { group_mid = sdp_attr_get_simple_u32(sdp_p->src_sdp, - SDP_ATTR_MID, (uint16_t) group_id_1, 0, 1); + SDP_ATTR_MID, (uint16_t) group_id_1, 0, 1); if (group_mid == group_id_1) { - /* found a match */ + /* found a match */ return (anat_media); - } + } } } } @@ -3271,15 +3236,15 @@ gsmsdp_validate_anat (cc_sdp_t *sdp_p) */ (void) sdp_attr_num_instances(sdp_p->dest_sdp, SDP_SESSION_LEVEL, 0, SDP_ATTR_GROUP, &num_group_lines); - + for (i = 1; i <= num_group_lines; i++) { - if (sdp_get_group_attr(sdp_p->dest_sdp, SDP_SESSION_LEVEL, 0, i) == SDP_GROUP_ATTR_ANAT) { + if (sdp_get_group_attr(sdp_p->dest_sdp, SDP_SESSION_LEVEL, 0, i) == SDP_GROUP_ATTR_ANAT) { num_anat_lines++; } } for (i = 1; i <= num_anat_lines; i++) { - num_group_id = sdp_get_group_num_id (sdp_p->dest_sdp, SDP_SESSION_LEVEL, 0, i); + num_group_id = sdp_get_group_num_id (sdp_p->dest_sdp, SDP_SESSION_LEVEL, 0, i); if ((num_group_id <=0) || (num_group_id > 2)) { /* This anat line has zero or more than two grouping, this is invalid */ return (FALSE); @@ -3291,21 +3256,21 @@ gsmsdp_validate_anat (cc_sdp_t *sdp_p) media_type_gid2 = sdp_get_media_type(sdp_p->dest_sdp, (u16) group_id_2); if (media_type_gid1 != media_type_gid2) { /* Group id types do not match */ - return (FALSE); + return (FALSE); } if (group_id_1 != sdp_attr_get_simple_u32(sdp_p->dest_sdp, SDP_ATTR_MID, (u16) group_id_1, 0, 1)) { /* Group id does not match the mid at the corresponding line */ - return (FALSE); + return (FALSE); } if (group_id_2 != sdp_attr_get_simple_u32(sdp_p->dest_sdp, SDP_ATTR_MID, (u16) group_id_2, 0, 1)) { - return (FALSE); - } + return (FALSE); + } } } return (TRUE); } - + /** * * The function validates if all the destination @@ -3334,16 +3299,16 @@ gsmsdp_validate_mid (cc_sdp_t *sdp_p, uint16_t level) */ (void) sdp_attr_num_instances(sdp_p->dest_sdp, SDP_SESSION_LEVEL, 0, SDP_ATTR_GROUP, &num_group_lines); - + for (i = 1; i <= num_group_lines; i++) { - if (sdp_get_group_attr(sdp_p->dest_sdp, SDP_SESSION_LEVEL, 0, i) == SDP_GROUP_ATTR_ANAT) { + if (sdp_get_group_attr(sdp_p->dest_sdp, SDP_SESSION_LEVEL, 0, i) == SDP_GROUP_ATTR_ANAT) { num_anat_lines++; } } if (num_anat_lines > 0) { - dst_mid = sdp_attr_get_simple_u32(sdp_p->dest_sdp, SDP_ATTR_MID, level, 0, 1); + dst_mid = sdp_attr_get_simple_u32(sdp_p->dest_sdp, SDP_ATTR_MID, level, 0, 1); if (dst_mid == 0) { return (FALSE); } @@ -3353,11 +3318,11 @@ gsmsdp_validate_mid (cc_sdp_t *sdp_p, uint16_t level) return (FALSE); } } - + } return (TRUE); } - + /** * * The function negotiates the type of the media lines @@ -3379,12 +3344,12 @@ gsmsdp_negotiate_addr_type (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) cpr_ip_type media_addr_type; cpr_ip_mode_e ip_mode; fsmdef_media_t *group_media; - + media_addr_type = media->dest_addr.type; - if ((media_addr_type != CPR_IP_ADDR_IPV4) && + if ((media_addr_type != CPR_IP_ADDR_IPV4) && (media_addr_type != CPR_IP_ADDR_IPV6)) { /* Unknown/unsupported address type */ - GSM_ERR_MSG(GSM_L_C_F_PREFIX"address type is not IPv4 or IPv6\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"address type is not IPv4 or IPv6\n", dcb_p->line, dcb_p->call_id, fname); return (FALSE); } @@ -3404,9 +3369,9 @@ gsmsdp_negotiate_addr_type (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) * checking the FSM_MEDIA_F_SUPPORT_SECURITY. */ if (!FSM_CHK_FLAGS(media->flags, FSM_MEDIA_F_SUPPORT_SECURITY)) { - if (media_addr_type != CPR_IP_ADDR_IPV4) { + if (media_addr_type != CPR_IP_ADDR_IPV4) { /* off board device we do not allow other address type but IPV4 */ - GSM_DEBUG(DEB_L_C_F_PREFIX"offboard device does not support IPV6\n", + GSM_DEBUG(DEB_L_C_F_PREFIX"offboard device does not support IPV6\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname)); return (FALSE); } @@ -3418,7 +3383,7 @@ gsmsdp_negotiate_addr_type (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) */ if ((ip_mode == CPR_IP_MODE_DUAL) || (ip_mode == CPR_IP_MODE_IPV4)) { if (group_media != NULL) { - /* + /* * this media line is part of ANAT group, keep the previous * one negotiated media line. */ @@ -3426,7 +3391,7 @@ gsmsdp_negotiate_addr_type (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) } gsmsdp_get_local_source_v4_address(media); return (TRUE); - } + } /* phone is IPV6 only mode */ return (FALSE); } @@ -3440,8 +3405,8 @@ gsmsdp_negotiate_addr_type (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) /* * no pair media line found, this can be the first media * line negotiate. Keep this media line for now. - */ - if (media_addr_type == CPR_IP_ADDR_IPV4) { + */ + if (media_addr_type == CPR_IP_ADDR_IPV4) { gsmsdp_get_local_source_v4_address(media); } else { gsmsdp_get_local_source_v6_address(media); @@ -3450,20 +3415,20 @@ gsmsdp_negotiate_addr_type (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) } /* - * Found a ANAT pair media structure that this media line + * Found a ANAT pair media structure that this media line * is part of. */ if (media_addr_type == CPR_IP_ADDR_IPV4) { /* * This media line is IPV4, keep the other line that have * been accepted before i.e. it shows up first therefore - * the other one has preference. + * the other one has preference. */ return (FALSE); - } + } /* This media line is IPV6 */ - if (group_media->src_addr.type == CPR_IP_ADDR_IPV4) { + if (group_media->src_addr.type == CPR_IP_ADDR_IPV4) { /* * The previous media line part of ANAT group is IPV4. The * phone policy is to select IPV6 for media stream. Remove @@ -3477,18 +3442,18 @@ gsmsdp_negotiate_addr_type (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) return (TRUE); } /* - * keep the previous one is also IPV6, remove this one i.e. + * keep the previous one is also IPV6, remove this one i.e. * the one found has higher preferecne although this is not * a valid ANAT grouping. - */ - return (FALSE); + */ + return (FALSE); } /* * The phone is not in dual mode, the address type must be from the media * line must match the address type that the phone is supporting. */ - if ((ip_mode == CPR_IP_MODE_IPV6) && + if ((ip_mode == CPR_IP_MODE_IPV6) && (media_addr_type == CPR_IP_ADDR_IPV4)) { /* incompatible address type */ return (FALSE); @@ -3508,7 +3473,7 @@ gsmsdp_negotiate_addr_type (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) } /* - * We have a compatible address type, set the source address based on + * We have a compatible address type, set the source address based on * the address type from the remote media line. */ if (media_addr_type == CPR_IP_ADDR_IPV4) { @@ -3517,7 +3482,7 @@ gsmsdp_negotiate_addr_type (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) gsmsdp_get_local_source_v6_address(media); } /* keep this media line */ - return (TRUE); + return (TRUE); } /** @@ -3552,21 +3517,21 @@ gsmdsp_find_best_match_media_cap_index (fsmdef_dcb_t *dcb_p, remote_transport = sdp_get_media_transport(sdp_p->dest_sdp, media->level); remote_direction = gsmsdp_get_remote_sdp_direction(dcb_p, media->level, &media->dest_addr); - srtp_fallback = sip_regmgr_srtp_fallback_enabled(dcb_p->line); + srtp_fallback = sip_regmgr_srtp_fallback_enabled(dcb_p->line); media_type = media->type; /* * Select the best suitable media capability entry that * match this media line. - * + * * The following rules are used: * - * 1) rule out entry that is invalid or not enabled or with + * 1) rule out entry that is invalid or not enabled or with * different media type. * 2) rule out entry that has been used by other existing * media line. - * + * * After the above rules applies look for the better match for * direction support and security support. The platform should * arrange the capability table in preference order with @@ -3596,7 +3561,7 @@ gsmdsp_find_best_match_media_cap_index (fsmdef_dcb_t *dcb_p, * Check for security support. The rules below attempts to * use entry that support security unless there is no entry * and the SRTP fallback is enabled. If the remote offer is not - * SRTP just ignore the supported security and proceed on i.e. + * SRTP just ignore the supported security and proceed on i.e. * any entry is ok. */ if (remote_transport == SDP_TRANSPORT_RTPSAVP) { @@ -3622,7 +3587,7 @@ gsmdsp_find_best_match_media_cap_index (fsmdef_dcb_t *dcb_p, * offer as much as possible. This is the best we know. We can * not guess what the real capability of the offer may have or will * change in the future (re-invite). - */ + */ support_direction = media_cap->support_direction; if (remote_direction == SDP_DIRECTION_INACTIVE) { if (support_direction != SDP_DIRECTION_SENDRECV) { @@ -3705,7 +3670,7 @@ gsmsdp_assign_cap_entry_to_incoming_media (fsmdef_dcb_t *dcb_p, if (anat_media != NULL) { media_cap = gsmsdp_get_media_cap_entry_by_index(anat_media->cap_index, dcb_p); if (media_cap == NULL) { - GSM_ERR_MSG(GSM_L_C_F_PREFIX"no media capability\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"no media capability\n", dcb_p->line, dcb_p->call_id, fname); return (FALSE); } @@ -3723,15 +3688,15 @@ gsmsdp_assign_cap_entry_to_incoming_media (fsmdef_dcb_t *dcb_p, if (cap_index == CC_MAX_MEDIA_CAP) { GSM_ERR_MSG(GSM_L_C_F_PREFIX"reached max streams supported or" - " no suitable media capability\n", + " no suitable media capability\n", dcb_p->line, dcb_p->call_id, fname); return (FALSE); } - /* set the capabilities to the media and associate with it */ + /* set the capabilities to the media and associate with it */ media_cap = gsmsdp_get_media_cap_entry_by_index(cap_index,dcb_p); if (media_cap == NULL) { - GSM_ERR_MSG(GSM_L_C_F_PREFIX"no media cap\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"no media cap\n", dcb_p->line, dcb_p->call_id, fname); return (FALSE); } @@ -3747,17 +3712,17 @@ gsmsdp_assign_cap_entry_to_incoming_media (fsmdef_dcb_t *dcb_p, } media->cap_index = cap_index; - GSM_DEBUG(DEB_L_C_F_PREFIX"assign media cap index %d\n", + GSM_DEBUG(DEB_L_C_F_PREFIX"assign media cap index %d\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), cap_index); return (TRUE); } - + /** * - * The function handles negotiate adding of a media line. + * The function handles negotiate adding of a media line. * * @param[in]dcb_p - pointer to the fsmdef_dcb_t - * @param[in]media_type - media type. + * @param[in]media_type - media type. * @param[in]level - media line. * @param[in]remote_port - remote port * @param[in]offer - boolean indicates offer or answer. @@ -3765,17 +3730,17 @@ gsmsdp_assign_cap_entry_to_incoming_media (fsmdef_dcb_t *dcb_p, * @return pointer to fsmdef_media_t if media is successfully * added or return NULL. * - * @pre (dcb_p not_eq NULL) - * @pre (sdp_p not_eq NULL) + * @pre (dcb_p not_eq NULL) + * @pre (sdp_p not_eq NULL) * @pre (remote_addr not_eq NULL) */ static fsmdef_media_t * -gsmsdp_negotiate_add_media_line (fsmdef_dcb_t *dcb_p, +gsmsdp_negotiate_add_media_line (fsmdef_dcb_t *dcb_p, sdp_media_e media_type, uint16_t level, uint16_t remote_port, boolean offer) -{ +{ static const char fname[] = "gsmsdp_negotiate_add_media_line"; fsmdef_media_t *media; @@ -3791,7 +3756,7 @@ gsmsdp_negotiate_add_media_line (fsmdef_dcb_t *dcb_p, * This is not an offer, the remote end wants to add * a new media line in the answer. */ - GSM_ERR_MSG(GSM_L_C_F_PREFIX"remote trying add media in answer SDP\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"remote trying add media in answer SDP\n", dcb_p->line, dcb_p->call_id, fname); return (NULL); } @@ -3809,7 +3774,7 @@ gsmsdp_negotiate_add_media_line (fsmdef_dcb_t *dcb_p, * If this call is locally held, mark the media with local hold so * that the negotiate direction will have the correct direction. */ - if ((dcb_p->fcb->state == FSMDEF_S_HOLDING) || + if ((dcb_p->fcb->state == FSMDEF_S_HOLDING) || (dcb_p->fcb->state == FSMDEF_S_HOLD_PENDING)) { /* the call is locally held, set the local held status */ FSM_SET_FLAGS(media->hold, FSM_HOLD_LCL); @@ -3822,7 +3787,7 @@ gsmsdp_negotiate_add_media_line (fsmdef_dcb_t *dcb_p, * The function handles negotiate remove of a media line. Note the * removal of a media line does not actaully removed from the offer/answer * SDP. - * + * * @param[in]dcb_p - pointer to the fsmdef_dcb_t * @param[in]media - pointer to the fsmdef_media_t for the media entry * to deactivate. @@ -3846,9 +3811,9 @@ gsmsdp_negotiate_remove_media_line (fsmdef_dcb_t *dcb_p, /* This is an offer SDP from the remote */ if (remote_port != 0) { /* the remote quests media is not for removal */ - return (FALSE); - } - /* + return (FALSE); + } + /* * Remote wants to remove the media line or to keep the media line * disabled. Fall through. */ @@ -3856,14 +3821,14 @@ gsmsdp_negotiate_remove_media_line (fsmdef_dcb_t *dcb_p, /* This is an answer SDP from the remote */ if ((media->src_port != 0) && (remote_port != 0)) { /* the media line is not for removal */ - return (FALSE); + return (FALSE); } - /* + /* * There are 3 possible causes: * 1) our offered port is 0 and remote's port is 0 - * 2) our offered port is 0 and remote's port is not 0. + * 2) our offered port is 0 and remote's port is not 0. * 3) our offered port is not 0 and remote's port is 0. - * + * * In any of these cases, the media line will not be used. */ if ((media->src_port == 0) && (remote_port != 0)) { @@ -3938,7 +3903,7 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, num_m_lines = sdp_get_num_media_lines(sdp_p->dest_sdp); if (num_m_lines == 0) { - GSM_DEBUG(DEB_L_C_F_PREFIX"no media lines found.\n", + GSM_DEBUG(DEB_L_C_F_PREFIX"no media lines found.\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname)); return CC_CAUSE_NO_MEDIA; } @@ -3948,7 +3913,7 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, */ if (gsmsdp_validate_anat(sdp_p) == FALSE) { /* Failed anat validation */ - GSM_DEBUG(DEB_L_C_F_PREFIX"failed anat validation\n", + GSM_DEBUG(DEB_L_C_F_PREFIX"failed anat validation\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname)); return (CC_CAUSE_NO_MEDIA); } @@ -3964,8 +3929,8 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, media_type = sdp_get_media_type(sdp_p->dest_sdp, i); port = (uint16_t) sdp_get_media_portnum(sdp_p->dest_sdp, i); - GSM_DEBUG(DEB_L_C_F_PREFIX"Port is %d at %d %d\n", - DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), + GSM_DEBUG(DEB_L_C_F_PREFIX"Port is %d at %d %d\n", + DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), port, i, initial_offer); switch (media_type) { @@ -3974,13 +3939,13 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, case SDP_MEDIA_APPLICATION: /* * Get remote address before other negotiations process in case - * the address 0.0.0.0 (old style hold) to be used + * the address 0.0.0.0 (old style hold) to be used * for direction negotiation. */ - if (!gsmsdp_get_remote_media_address(dcb_p, sdp_p, i, + if (!gsmsdp_get_remote_media_address(dcb_p, sdp_p, i, &remote_addr)) { /* failed to get the remote address */ - GSM_DEBUG(DEB_L_C_F_PREFIX"unable to get remote addr at %d\n", + GSM_DEBUG(DEB_L_C_F_PREFIX"unable to get remote addr at %d\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), i); unsupported_line = TRUE; break; @@ -3990,7 +3955,7 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, * Find the corresponding media entry in the dcb to see * this has been negiotiated previously (from the * last offer/answer session). - */ + */ media = gsmsdp_find_media_by_level(dcb_p, i); if (media == NULL) { /* No previous media, negotiate adding new media line. */ @@ -4006,7 +3971,7 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, * initial offer of this line. */ new_media = TRUE; - GSM_DEBUG(DEB_L_C_F_PREFIX"new media entry at %d\n", + GSM_DEBUG(DEB_L_C_F_PREFIX"new media entry at %d\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), i); } else if (media->type == media_type) { /* @@ -4017,13 +3982,13 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, offer)) { /* the media line is to be removed from the SDP */ unsupported_line = TRUE; - GSM_DEBUG(DEB_L_C_F_PREFIX"media at %d is removed\n", + GSM_DEBUG(DEB_L_C_F_PREFIX"media at %d is removed\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), i); break; } } else { /* The media at the same level but not the expected type */ - GSM_ERR_MSG(GSM_L_C_F_PREFIX"mismatch media type at %d\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"mismatch media type at %d\n", dcb_p->line, dcb_p->call_id, fname, i); unsupported_line = TRUE; break; @@ -4045,11 +4010,11 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, if (!gsmsdp_assign_cap_entry_to_incoming_media(dcb_p, sdp_p, media)) { unsupported_line = TRUE; - GSM_DEBUG(DEB_L_C_F_PREFIX"unable to assign capability entry at %d\n", + GSM_DEBUG(DEB_L_C_F_PREFIX"unable to assign capability entry at %d\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), i); // Check if we need to update the UI that video has been offered if ( offer && media_type == SDP_MEDIA_VIDEO && - ( ( g_media_table.cap[CC_VIDEO_1].support_direction != + ( ( g_media_table.cap[CC_VIDEO_1].support_direction != SDP_DIRECTION_INACTIVE) ) ) { // passed basic checks, now on to more expensive checks... remote_direction = gsmsdp_get_remote_sdp_direction(dcb_p, @@ -4060,13 +4025,13 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, media, MEDIA_TABLE_GLOBAL); - GSM_DEBUG(DEB_L_C_F_PREFIX"remote_direction: %d global match %sfound\n", + GSM_DEBUG(DEB_L_C_F_PREFIX"remote_direction: %d global match %sfound\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), remote_direction, (cap_index != CC_MAX_MEDIA_CAP)?"":"not "); if ( cap_index != CC_MAX_MEDIA_CAP && remote_direction != SDP_DIRECTION_INACTIVE ) { // this is an offer and platform can support video - GSM_DEBUG(DEB_L_C_F_PREFIX"\n\n\n\nUpdate video Offered Called %d\n", + GSM_DEBUG(DEB_L_C_F_PREFIX"\n\n\n\nUpdate video Offered Called %d\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), remote_direction); lsm_update_video_offered(dcb_p->line, dcb_p->call_id, remote_direction); } @@ -4094,7 +4059,7 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, if (transport == SDP_TRANSPORT_INVALID) { /* unable to negotiate transport */ unsupported_line = TRUE; - GSM_DEBUG(DEB_L_C_F_PREFIX"transport mismatch at %d\n", + GSM_DEBUG(DEB_L_C_F_PREFIX"transport mismatch at %d\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), i); break; } @@ -4136,11 +4101,11 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, * then change the local sdp and do the necessary * call to set up reception of multicast packets */ - GSM_DEBUG(DEB_L_C_F_PREFIX"Got multicast offer\n", + GSM_DEBUG(DEB_L_C_F_PREFIX"Got multicast offer\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname)); media->is_multicast = TRUE; media->multicast_port = port; - update_local_ret_value = + update_local_ret_value = gsmsdp_update_local_sdp_for_multicast(dcb_p, port, media, offer, new_media); @@ -4152,7 +4117,7 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, } GSM_DEBUG(DEB_F_PREFIX"local transport after updateing local SDP: %d\n",DEB_F_PREFIX_ARGS(GSM, fname), sdp_get_media_transport(dcb_p->sdp->src_sdp, 1)); - /* + /* * Successful codec negotiated cache direction for ui video update */ if (media_type == SDP_MEDIA_VIDEO ) { @@ -4222,14 +4187,14 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, } break; - + default: /* Not a support media type stream */ unsupported_line = TRUE; - break; + break; } - if (unsupported_line) { + if (unsupported_line) { /* add this line to unsupported line */ gsmsdp_add_unsupported_stream_to_local_sdp(sdp_p, i); gsmsdp_set_mid_attr(sdp_p->src_sdp, i); @@ -4242,16 +4207,16 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, if (gsmsdp_validate_mid(sdp_p, i) == FALSE) { /* Failed mid validation */ cause = CC_CAUSE_NO_MEDIA; - GSM_DEBUG(DEB_L_C_F_PREFIX"failed mid validation at %d\n", + GSM_DEBUG(DEB_L_C_F_PREFIX"failed mid validation at %d\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), i); - } + } } /* * Must have at least one media found and at least one audio * line. */ - if (!media_found) { + if (!media_found) { if (cause != CC_CAUSE_PAYLOAD_MISMATCH) { cause = CC_CAUSE_NO_MEDIA; } @@ -4261,7 +4226,7 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, * some media lines have codec mismatch but there are some * that works, do not return error. */ - cause = CC_CAUSE_OK; + cause = CC_CAUSE_OK; } /* @@ -4271,8 +4236,8 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, gsmsdp_update_local_time_stamp(dcb_p, offer, initial_offer); /* - * workable media line was found. Need to make sure we don't - * advertise more than workable media lines. Loop through + * workable media line was found. Need to make sure we don't + * advertise more than workable media lines. Loop through * remaining media lines in local SDP and set port to zero. */ num_local_m_lines = sdp_get_num_media_lines(sdp_p->src_sdp); @@ -4316,13 +4281,13 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, /* * We have negotiated the line, clear flag that we have set * that we are waiting for an answer SDP in ack. - */ + */ dcb_p->remote_sdp_in_ack = FALSE; - /* + /* * check to see if UI needs to be updated for video */ - GSM_DEBUG(DEB_L_C_F_PREFIX"Update video Avail Called %d\n", + GSM_DEBUG(DEB_L_C_F_PREFIX"Update video Avail Called %d\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname),video_avail); // update direction but preserve the cast attrib @@ -4488,10 +4453,10 @@ gsmsdp_set_media_capability (fsmdef_media_t *media, * * @param[in]dcb_p - pointer to the fsmdef_dcb_t * @param[in]media_cap - media capability to be used with this new media - * line. + * line. * @param[in]cap_index - media capability entry index to associate with * the media line. - * @param[in]level - media line order in the SDP so called level. + * @param[in]level - media line order in the SDP so called level. * @param[in]addr_type - cpr_ip_type for address of the media line to add. * * @return Pointer to the fsmdef_media_t if successfully @@ -4500,7 +4465,7 @@ gsmsdp_set_media_capability (fsmdef_media_t *media, * @pre (dcb_p not_eq NULL) * @pre (media_cap not_eq NULL) */ -static fsmdef_media_t * +static fsmdef_media_t * gsmsdp_add_media_line (fsmdef_dcb_t *dcb_p, const cc_media_cap_t *media_cap, uint8_t cap_index, uint16_t level, cpr_ip_type addr_type) @@ -4519,7 +4484,7 @@ gsmsdp_add_media_line (fsmdef_dcb_t *dcb_p, const cc_media_cap_t *media_cap, media = gsmsdp_get_new_media(dcb_p, media_cap->type, level); if (media == NULL) { /* should not happen */ - GSM_ERR_MSG(GSM_L_C_F_PREFIX"no media entry available\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"no media entry available\n", dcb_p->line, dcb_p->call_id, fname); return (NULL); } @@ -4528,13 +4493,13 @@ gsmsdp_add_media_line (fsmdef_dcb_t *dcb_p, const cc_media_cap_t *media_cap, gsmsdp_set_media_capability(media, media_cap); /* associate this media line to the capability entry */ - media->cap_index = cap_index; /* keep the media cap entry index */ + media->cap_index = cap_index; /* keep the media cap entry index */ /* override the direction for special feature */ gsmsdp_feature_overide_direction(dcb_p, media); if (media->support_direction == SDP_DIRECTION_INACTIVE) { GSM_DEBUG(DEB_L_C_F_PREFIX"feature overrides direction to inactive" - " no media added\n", + " no media added\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname)); gsmsdp_remove_media(dcb_p, media); return (NULL); @@ -4558,7 +4523,7 @@ gsmsdp_add_media_line (fsmdef_dcb_t *dcb_p, const cc_media_cap_t *media_cap, if (cc_call_action(dcb_p->call_id, dcb_p->line, CC_ACTION_OPEN_RCV, &data) != CC_RC_SUCCESS) { - GSM_ERR_MSG(GSM_L_C_F_PREFIX"allocate rx port failed\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"allocate rx port failed\n", dcb_p->line, dcb_p->call_id, fname); gsmsdp_remove_media(dcb_p, media); return (NULL); @@ -4581,18 +4546,18 @@ gsmsdp_add_media_line (fsmdef_dcb_t *dcb_p, const cc_media_cap_t *media_cap, } else if (addr_type == CPR_IP_ADDR_IPV4) { gsmsdp_get_local_source_v4_address(media); } else { - GSM_ERR_MSG(GSM_L_C_F_PREFIX"invalid IP address mode\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"invalid IP address mode\n", dcb_p->line, dcb_p->call_id, fname); gsmsdp_remove_media(dcb_p, media); return (NULL); } - + /* * Initialize the media transport for RTP or SRTP (or do not thing * and leave to the gsmsdp_update_local_sdp_media to set default) */ - gsmsdp_init_sdp_media_transport(dcb_p, dcb_p->sdp->src_sdp, media); - + gsmsdp_init_sdp_media_transport(dcb_p, dcb_p->sdp->src_sdp, media); + gsmsdp_update_local_sdp_media(dcb_p, dcb_p->sdp, TRUE, media, media->transport); @@ -4626,8 +4591,8 @@ gsmsdp_add_media_line (fsmdef_dcb_t *dcb_p, const cc_media_cap_t *media_cap, default: /* Unsupported media type, not added */ - GSM_DEBUG(DEB_L_C_F_PREFIX"media type %d is not supported\n", - DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), media_cap->type); + GSM_DEBUG(DEB_L_C_F_PREFIX"media type %d is not supported\n", + DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), media_cap->type); break; } return (media); @@ -4653,9 +4618,9 @@ gsmsdp_create_local_sdp (fsmdef_dcb_t *dcb_p, boolean force_streams_enabled) { static const char fname[] = "gsmsdp_create_local_sdp"; uint16_t level; - const cc_media_cap_table_t *media_cap_tbl; + const cc_media_cap_table_t *media_cap_tbl; const cc_media_cap_t *media_cap; - cpr_ip_mode_e ip_mode; + cpr_ip_mode_e ip_mode; uint8_t cap_index; fsmdef_media_t *media; boolean has_audio; @@ -4672,7 +4637,7 @@ gsmsdp_create_local_sdp (fsmdef_dcb_t *dcb_p, boolean force_streams_enabled) if (media_cap_tbl == NULL) { /* should not happen */ - GSM_ERR_MSG(GSM_L_C_F_PREFIX"no media capbility available\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"no media capbility available\n", dcb_p->line, dcb_p->call_id, fname); return (CC_CAUSE_ERROR); } @@ -4684,24 +4649,24 @@ gsmsdp_create_local_sdp (fsmdef_dcb_t *dcb_p, boolean force_streams_enabled) * Add each enabled media line to the SDP */ if (media_cap->enabled || force_streams_enabled) { - level = level + 1; /* next level */ + level = level + 1; /* next level */ ip_mode = platform_get_ip_address_mode(); if (ip_mode >= CPR_IP_MODE_IPV6) { if (gsmsdp_add_media_line(dcb_p, media_cap, cap_index, - level, CPR_IP_ADDR_IPV6) + level, CPR_IP_ADDR_IPV6) == NULL) { /* fail to add a media line, go back one level */ level = level - 1; } - + if (ip_mode == CPR_IP_MODE_DUAL) { level = level + 1; /* next level */ - if (gsmsdp_add_media_line(dcb_p, media_cap, cap_index, + if (gsmsdp_add_media_line(dcb_p, media_cap, cap_index, level, CPR_IP_ADDR_IPV4) == NULL) { /* fail to add a media line, go back one level */ level = level - 1; - } + } } } else { if (gsmsdp_add_media_line(dcb_p, media_cap, cap_index, level, @@ -4717,12 +4682,12 @@ gsmsdp_create_local_sdp (fsmdef_dcb_t *dcb_p, boolean force_streams_enabled) if (level == 0) { /* - * Did not find media line for the SDP and we do not + * Did not find media line for the SDP and we do not * support SDP without any media line. */ - GSM_ERR_MSG(GSM_L_C_F_PREFIX"no media line for SDP\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"no media line for SDP\n", dcb_p->line, dcb_p->call_id, fname); - return (CC_CAUSE_ERROR); + return (CC_CAUSE_ERROR); } /* @@ -4758,7 +4723,7 @@ gsmsdp_create_local_sdp (fsmdef_dcb_t *dcb_p, boolean force_streams_enabled) return (CC_CAUSE_ERROR); } } - + return CC_CAUSE_OK; } @@ -4816,12 +4781,12 @@ gsmsdp_create_options_sdp (cc_sdp_t ** sdp_pp) } /** - * The function checks and removes media capability for the media + * The function checks and removes media capability for the media * lines that is to be removed. * * @param[in]dcb_p - Pointer to DCB * - * @return TRUE - if there is a media line removed. + * @return TRUE - if there is a media line removed. * FALSE - if there is no media line to remove. * * @pre (dcb_p not_eq NULL) @@ -4833,14 +4798,14 @@ gsmsdp_check_remove_local_sdp_media (fsmdef_dcb_t *dcb_p) fsmdef_media_t *media, *media_to_remove; const cc_media_cap_t *media_cap; boolean removed = FALSE; - + media = GSMSDP_FIRST_MEDIA_ENTRY(dcb_p); while (media) { media_cap = gsmsdp_get_media_cap_entry_by_index(media->cap_index,dcb_p); if (media_cap != NULL) { /* found the corresponding capability of the media line */ if (!media_cap->enabled) { - GSM_DEBUG(DEB_L_C_F_PREFIX"remove media at level %d\n", + GSM_DEBUG(DEB_L_C_F_PREFIX"remove media at level %d\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), media->level); /* set the media line to unused */ gsmsdp_add_unsupported_stream_to_local_sdp(dcb_p->sdp, @@ -4866,7 +4831,7 @@ gsmsdp_check_remove_local_sdp_media (fsmdef_dcb_t *dcb_p) /** * The function checks and adds media capability for the media * lines that is to be added. - * + * * @param[in]dcb_p - Pointer to DCB * @param[in]hold - TRUE indicates the newly media line * should have direction that indicates hold. @@ -4892,14 +4857,14 @@ gsmsdp_check_add_local_sdp_media (fsmdef_dcb_t *dcb_p, boolean hold) uint16_t i, num_ip_addrs; if (fsmcnf_get_ccb_by_call_id(dcb_p->call_id) != NULL) { - /* + /* * This call is part of a local conference. The mixing - * support will be needed for additional media line. + * support will be needed for additional media line. * If platform does not have capability to support mixing * of a particular media type for the local conference, either * leg in the conference will not see addition media line * added. - */ + */ need_mix = TRUE; } @@ -4910,7 +4875,7 @@ gsmsdp_check_add_local_sdp_media (fsmdef_dcb_t *dcb_p, boolean hold) for (cap_index = 0; cap_index < CC_MAX_MEDIA_CAP; cap_index++) { media_cap = gsmsdp_get_media_cap_entry_by_index(cap_index, dcb_p); if (media_cap == NULL) { - GSM_ERR_MSG(GSM_L_C_F_PREFIX"no media capbility available\n", + GSM_ERR_MSG(GSM_L_C_F_PREFIX"no media capbility available\n", dcb_p->line, dcb_p->call_id, fname); continue; } @@ -4924,15 +4889,15 @@ gsmsdp_check_add_local_sdp_media (fsmdef_dcb_t *dcb_p, boolean hold) continue; } - /* + /* * This is a new entry the capability table to be added. */ if (CC_IS_AUDIO(cap_index) && need_mix) { if (!gsmsdp_platform_addition_mix(dcb_p, media_cap->type)) { /* platform can not support additional mixing of this type */ GSM_DEBUG(DEB_L_C_F_PREFIX"no support addition mixing for %d " - "media type\n", - DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), + "media type\n", + DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), media_cap->type); continue; } @@ -4960,7 +4925,7 @@ gsmsdp_check_add_local_sdp_media (fsmdef_dcb_t *dcb_p, boolean hold) num_ip_addrs = 1; ip_addr_type[0] = CPR_IP_ADDR_IPV4; break; - } + } /* add media line or lines */ for (i = 0; i < num_ip_addrs; i++) { /* @@ -4978,7 +4943,7 @@ gsmsdp_check_add_local_sdp_media (fsmdef_dcb_t *dcb_p, boolean hold) num_m_lines = sdp_get_num_media_lines(src_sdp); level_to_use = num_m_lines + 1; } - GSM_DEBUG(DEB_L_C_F_PREFIX"add media at level %d\n", + GSM_DEBUG(DEB_L_C_F_PREFIX"add media at level %d\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), level_to_use); /* add a new media */ @@ -5001,12 +4966,12 @@ gsmsdp_check_add_local_sdp_media (fsmdef_dcb_t *dcb_p, boolean hold) } /** - * The function checks support direction changes and updates the support + * The function checks support direction changes and updates the support * direction of media lines. * * @param[in]dcb_p - Pointer to DCB * @param[in]no_sdp_update - TRUE indicates do not update SDP. - * + * * @return TRUE - if there is a media line support direction * changes. * FALSE - if there is no media line that has @@ -5020,7 +4985,7 @@ gsmsdp_check_direction_change_local_sdp_media (fsmdef_dcb_t *dcb_p, { static const char fname[] = "gsmsdp_check_direction_change_local_sdp_media"; fsmdef_media_t *media; - const cc_media_cap_t *media_cap; + const cc_media_cap_t *media_cap; boolean direction_change = FALSE; sdp_direction_e save_supported_direction; @@ -5036,11 +5001,11 @@ gsmsdp_check_direction_change_local_sdp_media (fsmdef_dcb_t *dcb_p, * the supported direction remains the same after override * take place. If it is different then there is a direction * change. - */ - save_supported_direction = media->support_direction; + */ + save_supported_direction = media->support_direction; media->support_direction = media_cap->support_direction; - gsmsdp_feature_overide_direction(dcb_p, media); - if (media->support_direction == save_supported_direction) { + gsmsdp_feature_overide_direction(dcb_p, media); + if (media->support_direction == save_supported_direction) { /* nothing change after override */ } else { /* there is no override, this is a change */ @@ -5049,8 +5014,8 @@ gsmsdp_check_direction_change_local_sdp_media (fsmdef_dcb_t *dcb_p, if (direction_change) { /* Support direction changed */ GSM_DEBUG(DEB_L_C_F_PREFIX"change support direction at level %d" - " from %d to %d\n", - DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), + " from %d to %d\n", + DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), media->level, media->support_direction, media_cap->support_direction); if (no_sdp_update) { @@ -5059,7 +5024,7 @@ gsmsdp_check_direction_change_local_sdp_media (fsmdef_dcb_t *dcb_p, */ media->direction = media_cap->support_direction; } else { - /* + /* * Need to update direction in the SDP. * The direction in the media structure will * be set by the gsmsdp_set_local_sdp_direction. @@ -5092,14 +5057,14 @@ static void gsmsdp_reset_media(fsmdef_dcb_t *dcb_p, fsmdef_media_t *media, boole } /** - * + * * This functions checks if the media IP Address has changed - * - * Convert the configMedia IP String to Ip address format, + * + * Convert the configMedia IP String to Ip address format, * check if it is valid and then compare to current media source * address, if the address is valid and the media source and * config media ip differ, then - * + * * 1) Stop the media to close the socket * 2) Set flag to true, to initiate re-invite * 3) Update the media src addr @@ -5111,12 +5076,12 @@ static void gsmsdp_reset_media(fsmdef_dcb_t *dcb_p, fsmdef_media_t *media, boole * * @pre (dcb_p not_eq NULL) */ -boolean +boolean gsmsdp_media_ip_changed (fsmdef_dcb_t *dcb_p) { static const char fname[] = "gsmsdp_media_ip_changed"; boolean ip_changed = FALSE; - cpr_ip_addr_t addr ; + cpr_ip_addr_t addr ; char curr_media_ip[MAX_IPADDR_STR_LEN]; char addr_str[MAX_IPADDR_STR_LEN]; fsmdef_media_t *media; @@ -5125,15 +5090,15 @@ gsmsdp_media_ip_changed (fsmdef_dcb_t *dcb_p) * Check if media IP has changed */ init_empty_str(curr_media_ip); - config_get_value(CFGID_MEDIA_IP_ADDR, curr_media_ip, + config_get_value(CFGID_MEDIA_IP_ADDR, curr_media_ip, MAX_IPADDR_STR_LEN); - if (is_empty_str(curr_media_ip) == FALSE) { + if (is_empty_str(curr_media_ip) == FALSE) { str2ip(curr_media_ip, &addr); util_ntohl(&addr, &addr); GSMSDP_FOR_ALL_MEDIA(media, dcb_p) { if ((util_check_if_ip_valid(&media->src_addr) == TRUE) && (util_check_if_ip_valid(&addr) == TRUE) && - (util_compare_ip(&media->src_addr, &addr) == FALSE)) { + (util_compare_ip(&media->src_addr, &addr) == FALSE)) { ipaddr2dotted(curr_media_ip, &media->src_addr); // for logging (void)cc_call_action(dcb_p->call_id, dcb_p->line, @@ -5145,7 +5110,7 @@ gsmsdp_media_ip_changed (fsmdef_dcb_t *dcb_p) gsmsdp_set_connection_address(dcb_p->sdp->src_sdp, media->level, dcb_p->ice_default_candidate_addr); - } + } ipaddr2dotted(addr_str, &media->src_addr); // for logging GSM_ERR_MSG("%s MEDIA IP_CHANGED: after Update IP %s"\ " before %s" ,fname, addr_str, curr_media_ip ); @@ -5193,7 +5158,7 @@ boolean is_gsmsdp_media_ip_updated_to_latest( fsmdef_dcb_t * dcb ) { * * @param[in]dcb_p - Pointer to DCB * @param[in]reset - Reset the unchanged media lines to include all - * codecs etc. again. + * codecs etc. again. * @param[in]hold - Set media line will be set to hold. * * @return TRUE - if media changes occur. @@ -5218,7 +5183,7 @@ gsmsdp_update_local_sdp_media_capability (fsmdef_dcb_t *dcb_p, boolean reset, */ if ((g_media_table.id != dcb_p->media_cap_tbl->id) || reset) { - /* + /* * capabilty table ID different or we are doing a reset for * the full offer again, need to check for various changes. * Update capabilities to match platform caps @@ -5242,7 +5207,7 @@ gsmsdp_update_local_sdp_media_capability (fsmdef_dcb_t *dcb_p, boolean reset, } /* - * Find media lines that may have direction changes + * Find media lines that may have direction changes */ if ( check_for_change && gsmsdp_check_direction_change_local_sdp_media(dcb_p, reset)) { @@ -5254,7 +5219,7 @@ gsmsdp_update_local_sdp_media_capability (fsmdef_dcb_t *dcb_p, boolean reset, * Reset all the existing media lines to have full codec etc. * again if the caller requested. */ - if (reset) { + if (reset) { GSMSDP_FOR_ALL_MEDIA(media, dcb_p) { gsmsdp_reset_media(dcb_p, media, hold); } @@ -5263,16 +5228,16 @@ gsmsdp_update_local_sdp_media_capability (fsmdef_dcb_t *dcb_p, boolean reset, /* * Find new media entries to be added. */ - if ( check_for_change && gsmsdp_check_add_local_sdp_media(dcb_p, hold)) { + if ( check_for_change && gsmsdp_check_add_local_sdp_media(dcb_p, hold)) { change_found = TRUE; } if (change_found) { - GSM_DEBUG(DEB_L_C_F_PREFIX"media capability change found \n", + GSM_DEBUG(DEB_L_C_F_PREFIX"media capability change found \n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname)); } - + /* report back any changes made */ return (change_found); } @@ -5321,7 +5286,7 @@ gsmsdp_reset_local_sdp_media (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media, /* * Reset media transport in preparation for hold or resume. * It is possible that transport media may - * change from the current media transport (for SRTP re-offer + * change from the current media transport (for SRTP re-offer * to a different end point). */ gsmsdp_reset_sdp_media_transport(dcb_p, dcb_p->sdp ? dcb_p->sdp->src_sdp : NULL, @@ -5398,15 +5363,15 @@ gsmsdp_set_local_hold_sdp (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) } else { /* * RFC3264 states that hold is signaled by setting the media - * direction attribute to SENDONLY if in SENDRECV mode. + * direction attribute to SENDONLY if in SENDRECV mode. * INACTIVE if RECVONLY mode (mutual hold). */ if (media->direction == SDP_DIRECTION_SENDRECV || media->direction == SDP_DIRECTION_SENDONLY) { - gsmsdp_set_local_sdp_direction(dcb_p, media, + gsmsdp_set_local_sdp_direction(dcb_p, media, SDP_DIRECTION_SENDONLY); } else { - gsmsdp_set_local_sdp_direction(dcb_p, media, + gsmsdp_set_local_sdp_direction(dcb_p, media, SDP_DIRECTION_INACTIVE); } } @@ -5447,7 +5412,7 @@ gsmsdp_set_local_resume_sdp (fsmdef_dcb_t *dcb_p, fsmdef_media_t *media) continue; } /* - * We are not locally held, set direction to the supported + * We are not locally held, set direction to the supported * direction. */ gsmsdp_set_local_sdp_direction(dcb_p, media, media->support_direction); @@ -5703,7 +5668,7 @@ gsmsdp_negotiate_answer_sdp (fsm_fcb_t *fcb_p, cc_msgbody_info_t *msg_body) /* Error parsing SDP */ return status; } - + gsmsdp_set_remote_sdp(dcb_p, dcb_p->sdp); status = gsmsdp_negotiate_media_lines(fcb_p, dcb_p->sdp, FALSE, FALSE, TRUE); @@ -5779,7 +5744,7 @@ gsmsdp_process_offer_sdp (fsm_fcb_t *fcb_p, /* Get just the SDP bodies */ num_sdp_bodies = gsmsdp_get_sdp_body(msg_body, &sdp_bodies[0], CC_MAX_BODY_PARTS); - GSM_DEBUG(DEB_L_C_F_PREFIX"Init is %d\n", + GSM_DEBUG(DEB_L_C_F_PREFIX"Init is %d\n", DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), init); if (num_sdp_bodies == 0) { /* @@ -5792,7 +5757,7 @@ gsmsdp_process_offer_sdp (fsm_fcb_t *fcb_p, return CC_CAUSE_ERROR; } } else { - /* + /* * Reset all media entries that we have to offer all capabilities */ (void)gsmsdp_update_local_sdp_media_capability(dcb_p, TRUE, FALSE); @@ -5832,7 +5797,7 @@ gsmsdp_process_offer_sdp (fsm_fcb_t *fcb_p, if (init) { (void)gsmsdp_init_local_sdp(&(dcb_p->sdp)); /* Note that there should not a previous version here as well */ - } + } gsmsdp_set_remote_sdp(dcb_p, dcb_p->sdp); @@ -5859,7 +5824,7 @@ gsmsdp_install_peer_ice_attributes(fsm_fcb_t *fcb_p) short vcm_res; fsmdef_dcb_t *dcb_p = fcb_p->dcb; cc_sdp_t *sdp_p = dcb_p->sdp; - fsmdef_media_t *media; + fsmdef_media_t *media; int level; short result; @@ -5890,7 +5855,7 @@ gsmsdp_install_peer_ice_attributes(fsm_fcb_t *fcb_p) SDP_ATTR_ICE_UFRAG, 1, &ufrag); if (sdp_res != SDP_SUCCESS) ufrag = NULL; - + sdp_res = sdp_attr_get_ice_attribute(sdp_p->dest_sdp, media->level, 0, SDP_ATTR_ICE_PWD, 1, &pwd); if (sdp_res != SDP_SUCCESS) @@ -5921,9 +5886,9 @@ gsmsdp_install_peer_ice_attributes(fsm_fcb_t *fcb_p) if (vcm_res) return (CC_CAUSE_ERROR); - + } - + return CC_CAUSE_OK; } @@ -6085,7 +6050,7 @@ gsmsdp_sdp_differs_from_previous_sdp (boolean rcv_only, fsmdef_media_t *media) if ( (media->previous_sdp.local_payload_type != media->local_dynamic_payload_type_value) ) { GSM_DEBUG(DEB_F_PREFIX"previous dynamic payload: %d new dynamic payload: %d\n", - DEB_F_PREFIX_ARGS(GSM, fname), media->previous_sdp.local_payload_type, + DEB_F_PREFIX_ARGS(GSM, fname), media->previous_sdp.local_payload_type, media->local_dynamic_payload_type_value); return TRUE; } diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp_crypto.c b/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp_crypto.c index 1856eba48d7d..181cd50a930d 100644 --- a/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp_crypto.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp_crypto.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include @@ -894,7 +859,7 @@ gsmsdp_check_answer_crypto_param (fsmdef_dcb_t *dcb_p, cc_sdp_t * cc_sdp_p, GSM_DEBUG_ERROR(GSM_L_C_F_PREFIX "Answer SDP contains invalid number of" " crypto attributes %d for media level %d\n", - dcb_p->line, dcb_p->call_id, fname, + dcb_p->line, dcb_p->call_id, fname, num_crypto_attr, level); return (FALSE); } @@ -937,7 +902,7 @@ gsmsdp_check_answer_crypto_param (fsmdef_dcb_t *dcb_p, cc_sdp_t * cc_sdp_p, GSM_DEBUG_ERROR(GSM_L_C_F_PREFIX "Answer SDP contains wrong tag %d vs %d" " for the media level %d\n", - dcb_p->line, dcb_p->call_id, fname, + dcb_p->line, dcb_p->call_id, fname, dest_crypto_tag, offered_tag, level); return (FALSE); } @@ -1263,7 +1228,7 @@ gsmsdp_add_single_crypto_attr (void *sdp_p, uint16_t level, int32_t tag, * N/A. */ static void -gsmsdp_add_all_crypto_lines (fsmdef_dcb_t *dcb_p, void *sdp_p, +gsmsdp_add_all_crypto_lines (fsmdef_dcb_t *dcb_p, void *sdp_p, fsmdef_media_t *media) { const char *fname = "gsmsdp_add_all_crypto_lines"; @@ -1283,8 +1248,8 @@ gsmsdp_add_all_crypto_lines (fsmdef_dcb_t *dcb_p, void *sdp_p, /* Get the crypto suite based on the algorithm ID */ crypto_suite = gsmsdp_algorithmID_to_crypto_suite(media->local_crypto.algorithmID); - if (gsmsdp_add_single_crypto_attr(sdp_p, media->level, - media->local_crypto.tag, crypto_suite, &media->local_crypto.key, + if (gsmsdp_add_single_crypto_attr(sdp_p, media->level, + media->local_crypto.tag, crypto_suite, &media->local_crypto.key, GSMSDP_DEFALT_KEY_LIFETIME) != SDP_SUCCESS) { GSM_DEBUG_ERROR(GSM_L_C_F_PREFIX "Failed to add crypto attributes\n", @@ -1590,7 +1555,7 @@ gsmsdp_update_crypto_transmit_key (fsmdef_dcb_t *dcb_p, if (initial_offer) { /* An initial offer always needs new key */ generate_key = TRUE; - } else if ((util_compare_ip(&(media->previous_sdp.dest_addr), + } else if ((util_compare_ip(&(media->previous_sdp.dest_addr), &(media->dest_addr)) == FALSE) && media->dest_addr.type != CPR_IP_ADDR_INVALID) { //Todo IPv6: IPv6 does not support 0.0.0.0 hold. @@ -1647,8 +1612,8 @@ gsmsdp_update_crypto_transmit_key (fsmdef_dcb_t *dcb_p, } else if (media->negotiated_crypto.tx_key.key_len == 0) { if (gsmsdp_local_offer_srtp(media)) { /* - * This an answer to our offer sent similar to - * the address change scenario above (delayed media, we + * This an answer to our offer sent similar to + * the address change scenario above (delayed media, we * sent SDP in 200OK and got SDP in ACK but GSM treats * SDP in ACK case as an offer rather than an answer). * Use the key in the offered SDP. @@ -1885,7 +1850,7 @@ gsmsdp_is_media_encrypted (fsmdef_dcb_t *dcb_p) if (!GSMSDP_MEDIA_ENABLED(media)) { continue; } - + if (media->transport == SDP_TRANSPORT_RTPSAVP || media->transport == SDP_TRANSPORT_RTPSAVPF) { num_encrypted++; } @@ -1939,12 +1904,12 @@ gsmsdp_crypto_params_change (boolean rcv_only, fsmdef_media_t *media) * @param[in] media - pointer to fsmdef_media_t. * * @return None. - * + * * @pre (media not_eq NULL) */ void gsmsdp_crypto_reset_params_change (fsmdef_media_t *media) { - media->negotiated_crypto.flags &= ~(FSMDEF_CRYPTO_RX_CHANGE | + media->negotiated_crypto.flags &= ~(FSMDEF_CRYPTO_RX_CHANGE | FSMDEF_CRYPTO_TX_CHANGE); } diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/h/fim.h b/media/webrtc/signaling/src/sipcc/core/gsm/h/fim.h index 711e49cb65a9..5eeb26a354bd 100755 --- a/media/webrtc/signaling/src/sipcc/core/gsm/h/fim.h +++ b/media/webrtc/signaling/src/sipcc/core/gsm/h/fim.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _FIM_H_ #define _FIM_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/h/fsm.h b/media/webrtc/signaling/src/sipcc/core/gsm/h/fsm.h index 309b8fb7b3d7..d3ba16c2a9a8 100755 --- a/media/webrtc/signaling/src/sipcc/core/gsm/h/fsm.h +++ b/media/webrtc/signaling/src/sipcc/core/gsm/h/fsm.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _FSM_H_ #define _FSM_H_ @@ -173,7 +138,7 @@ typedef struct fsmdef_previous_sdp_ { typedef struct fsmdef_media_t_ { sll_lite_node_t node; /* link node, must be first member of struct */ - media_refid_t refid; /* media reference id */ + media_refid_t refid; /* media reference id */ sdp_media_e type; /* audio, video etc. media */ sdp_addrtype_e addr_type;/* ipv4, ipv6 */ /* @@ -283,7 +248,7 @@ struct fsm_fcb_t_; typedef struct { callid_t call_id; - callid_t join_call_id; + callid_t join_call_id; line_t line; cc_caller_id_t caller_id; groupid_t group_id; @@ -428,13 +393,13 @@ typedef struct { cprTimer_t revertTimer; boolean dsp_out_of_resources; - + boolean selected; boolean select_pending; boolean call_not_counted_in_mnc_bt; - + /* * The media_cap holds the current media caps of the call */ @@ -450,8 +415,8 @@ typedef struct { */ cc_media_local_track_table_t *local_media_track_tbl; -#define FSMDEF_F_HOLD_REQ_PENDING (1 << 0)/* hold feature pending */ -#define FSMDEF_F_XFER_COMPLETE (1 << 1)/* hold feature pending */ +#define FSMDEF_F_HOLD_REQ_PENDING (1 << 0)/* hold feature pending */ +#define FSMDEF_F_XFER_COMPLETE (1 << 1)/* hold feature pending */ uint32_t flags; /* misc. flags. */ int log_disp; @@ -623,7 +588,7 @@ fsmdef_dcb_t *fsm_get_dcb(callid_t call_id); void fsm_init_scb(fim_icb_t *icb, callid_t call_id); fsm_fcb_t *fsm_get_fcb_by_call_id(callid_t call_id); fsm_fcb_t *fsm_get_fcb_by_call_id_and_type(callid_t call_id, fsm_types_t type); -void +void fsm_get_fcb_by_selected_or_connected_call_fcb(callid_t call_id, fsm_fcb_t **con_fcb_found, fsm_fcb_t **sel_fcb_found); fsm_fcb_t *fsm_get_new_fcb(callid_t call_id, fsm_types_t fsm_type); diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/h/gsm.h b/media/webrtc/signaling/src/sipcc/core/gsm/h/gsm.h index 37ce4f934331..ba6cafccfc84 100755 --- a/media/webrtc/signaling/src/sipcc/core/gsm/h/gsm.h +++ b/media/webrtc/signaling/src/sipcc/core/gsm/h/gsm.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _GSM_H_ #define _GSM_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/h/gsm_sdp.h b/media/webrtc/signaling/src/sipcc/core/gsm/h/gsm_sdp.h index 168391b420b8..7d99d319b9dd 100644 --- a/media/webrtc/signaling/src/sipcc/core/gsm/h/gsm_sdp.h +++ b/media/webrtc/signaling/src/sipcc/core/gsm/h/gsm_sdp.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _GSM_SDP_H_ #define _GSM_SDP_H_ @@ -61,7 +26,7 @@ #define GSMSDP_FOR_MEDIA_LIST(media, start_media, end_media, dcb) \ for (media = start_media; (media != NULL); \ media = (media != end_media ? \ - GSMSDP_NEXT_MEDIA_ENTRY(media) : NULL)) + GSMSDP_NEXT_MEDIA_ENTRY(media) : NULL)) #define GSMSDP_FOR_ALL_MEDIA(media, dcb) \ for (media = GSMSDP_FIRST_MEDIA_ENTRY(dcb); (media != NULL); \ @@ -69,7 +34,7 @@ cc_causes_t gsmsdp_create_local_sdp(fsmdef_dcb_t *dcb_p, boolean force_streams_enabled); void gsmsdp_create_options_sdp(cc_sdp_t **sdp_pp); -void gsmsdp_reset_local_sdp_media(fsmdef_dcb_t *dcb, fsmdef_media_t *media, +void gsmsdp_reset_local_sdp_media(fsmdef_dcb_t *dcb, fsmdef_media_t *media, boolean hold); void gsmsdp_set_local_sdp_direction(fsmdef_dcb_t *dcb_p, fsmdef_media_t *media, sdp_direction_e direction); diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/h/lsm.h b/media/webrtc/signaling/src/sipcc/core/gsm/h/lsm.h index 8e031bb5d47e..b0df529747af 100755 --- a/media/webrtc/signaling/src/sipcc/core/gsm/h/lsm.h +++ b/media/webrtc/signaling/src/sipcc/core/gsm/h/lsm.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _LSM_H_ #define _LSM_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/h/lsm_private.h b/media/webrtc/signaling/src/sipcc/core/gsm/h/lsm_private.h index c18e859f42d4..438cc869a69b 100644 --- a/media/webrtc/signaling/src/sipcc/core/gsm/h/lsm_private.h +++ b/media/webrtc/signaling/src/sipcc/core/gsm/h/lsm_private.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _LSM_PRIV_H_ #define _LSM_PRIV_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/h/sm.h b/media/webrtc/signaling/src/sipcc/core/gsm/h/sm.h index 928c6ca8c9fa..840aced0dfc7 100755 --- a/media/webrtc/signaling/src/sipcc/core/gsm/h/sm.h +++ b/media/webrtc/signaling/src/sipcc/core/gsm/h/sm.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _SM_H_ #define _SM_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/lsm.c b/media/webrtc/signaling/src/sipcc/core/gsm/lsm.c index d90a2e3f0716..7aa7df0ff472 100755 --- a/media/webrtc/signaling/src/sipcc/core/gsm/lsm.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/lsm.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include "cpr_types.h" @@ -197,7 +162,7 @@ static int ringSettingIdle; static int ringSettingActive; /* Ring mode set by remote-cc app */ -static cc_rcc_ring_mode_e cc_line_ringer_mode[MAX_REG_LINES+1] = +static cc_rcc_ring_mode_e cc_line_ringer_mode[MAX_REG_LINES+1] = {CC_RING_DEFAULT}; // Following data has to be non-stack b/c the way SIP stack uses it. // It is used by the lsm_is_phone_forwarded() function only. @@ -286,7 +251,7 @@ lsm_ui_call_state (call_events event, line_t line, lsm_lcb_t *lcb, cc_causes_t c * when local bridge is active */ ui_call_state(event, line, lcb->ui_id, cause); - } + } else if(event == evConnected) { //This is for Chaperone Conference case, if conference changed to a normal call, //then need to update the call state to refresh the key's status. like re-enable @@ -337,7 +302,7 @@ void lsm_set_lcb_dusting_call (callid_t call_id) /** * This function will be invoked by DEF SM to set call priority. * - * @param[in] call_id - GSM call id. + * @param[in] call_id - GSM call id. * * @return none * @@ -355,9 +320,9 @@ void lsm_set_lcb_call_priority (callid_t call_id) /** - * This function sets the LSM_FLAGS_DIALED_STRING bit in lcb->flags + * This function sets the LSM_FLAGS_DIALED_STRING bit in lcb->flags * - * @param[in] call_id - GSM call id. + * @param[in] call_id - GSM call id. * * @return none * @@ -376,7 +341,7 @@ void lsm_set_lcb_dialed_str_flag (callid_t call_id) /** * This function will be invoked by DEF SM to set gcid in lcb. * - * @param[in] call_id - GSM call id. + * @param[in] call_id - GSM call id. * @param[in] gcid - GCID provided by CUCM. * * @return none @@ -401,7 +366,7 @@ void lsm_update_gcid (callid_t call_id, char * gcid) * it will check if there is a RINGIN call * with the same GCID. If so, it will set a flag to prevent ringing. * - * @param[in] call_id - GSM call id. + * @param[in] call_id - GSM call id. * * @return none * @@ -528,7 +493,7 @@ lsm_internal_update_call_info (lsm_lcb_t *lcb, fsmdef_dcb_t *dcb) /* For local conference, do not update the primary * call bubbles call-info. Primary call is already * displaying To conference in this case - * But dcb-> caller_id should be updated to + * But dcb-> caller_id should be updated to * refresh the UI when the call is dropped */ ccb = fsmcnf_get_ccb_by_call_id(lcb->call_id); @@ -592,13 +557,13 @@ lsm_internal_update_call_info (lsm_lcb_t *lcb, fsmdef_dcb_t *dcb) * up by the caller to whether opens a receive channel or just * to allocate a receive port. * - * @param[in] lcb - pointer to the lsm_lcb_t. + * @param[in] lcb - pointer to the lsm_lcb_t. * @param[in/out] data - pointer to the cc_action_data_open_rcv_t. - * Upon a successful return, the port elelment + * Upon a successful return, the port elelment * of this structure will be filled with the actual * receive port. * @param[in] media - pointer to the fsmdef_media_t if a specific - * media to be operated on. + * media to be operated on. * * @return CC_RC_ERROR or CC_RC_SUCCESS. * @@ -628,11 +593,11 @@ lsm_open_rx (lsm_lcb_t *lcb, cc_action_data_open_rcv_t *data, if (media == NULL) { /* no explicit media parameter specified, look up based on refID */ if (data->media_refid != CC_NO_MEDIA_REF_ID) { - media = gsmsdp_find_media_by_refid(dcb, + media = gsmsdp_find_media_by_refid(dcb, data->media_refid); } if (media == NULL) { - LSM_DEBUG(get_debug_string(LSM_DBG_INT1), lcb->call_id, + LSM_DEBUG(get_debug_string(LSM_DBG_INT1), lcb->call_id, lcb->line, fname, "no media refID %d found", data->media_refid); return (rc); @@ -707,10 +672,10 @@ lsm_open_rx (lsm_lcb_t *lcb, cc_action_data_open_rcv_t *data, /* * This function updates the dscp value based on whether video is enable or not * and video is active or not. - * @param[in] dcb - pointer to the fsmdef_dcb. + * @param[in] dcb - pointer to the fsmdef_dcb. */ -void lsm_update_dscp_value(fsmdef_dcb_t *dcb) +void lsm_update_dscp_value(fsmdef_dcb_t *dcb) { static const char fname[] = "lsm_update_dscp_value"; int dscp = 184; /* default 184 used for DSCP */ @@ -724,22 +689,22 @@ void lsm_update_dscp_value(fsmdef_dcb_t *dcb) if (dcb != NULL) { LSM_DEBUG(DEB_L_C_F_PREFIX"Setting dscp=%d for Rx group_id=%d \n", DEB_L_C_F_PREFIX_ARGS(LSM, dcb->line, dcb->call_id, fname), dscp, dcb->group_id); - vcmSetRtcpDscp(dcb->group_id, dscp); + vcmSetRtcpDscp(dcb->group_id, dscp); } } /** * The function closes receive channel for a given media entry. - * The receive channel may not be closed if the caller intents to + * The receive channel may not be closed if the caller intents to * fresh the channel i.e close if needed but otherwise leave it open. - * When the caller indicates refreshing, the receive channel + * When the caller indicates refreshing, the receive channel * will be closed only when there is a difference in current SDP and * the previous SDP. * - * @param[in] lcb - pointer to the lsm_lcb_t. + * @param[in] lcb - pointer to the lsm_lcb_t. * @param[in] refresh - channel to be refreshed i.e. close if necessary. * @param[in] media - pointer to the fsmdef_media_t for the - * media entry to be refresh. + * media entry to be refresh. * * If the value of media is NULL, it indicates that * all current inused media entries. @@ -755,7 +720,7 @@ lsm_close_rx (lsm_lcb_t *lcb, boolean refresh, fsmdef_media_t *media) fsmdef_media_t *start_media, *end_media; fsmdef_dcb_t *dcb; int sdpmode = 0; - + dcb = lcb->dcb; if (dcb == NULL) { LSM_ERR_MSG(get_debug_string(DEBUG_INPUT_NULL), fname); @@ -775,7 +740,7 @@ lsm_close_rx (lsm_lcb_t *lcb, boolean refresh, fsmdef_media_t *media) end_media = media; } - /* close receive port on the media(s) */ + /* close receive port on the media(s) */ GSMSDP_FOR_MEDIA_LIST(media, start_media, end_media, dcb) { if (media->rcv_chan) { /* @@ -783,11 +748,11 @@ lsm_close_rx (lsm_lcb_t *lcb, boolean refresh, fsmdef_media_t *media) * recycling the receive port and the codec has changed, close the * receive port. Also stop bridging of media streams. */ - if (!refresh || - (refresh && + if (!refresh || + (refresh && gsmsdp_sdp_differs_from_previous_sdp(TRUE, media))) { - LSM_DEBUG(get_debug_string(LSM_DBG_INT1), dcb->call_id, - dcb->line, fname, "port closed", + LSM_DEBUG(get_debug_string(LSM_DBG_INT1), dcb->call_id, + dcb->line, fname, "port closed", media->src_port); config_get_value(CFGID_SDPMODE, &sdpmode, sizeof(sdpmode)); @@ -858,22 +823,22 @@ lsm_close_tx (lsm_lcb_t *lcb, boolean refresh, fsmdef_media_t *media) if (media->xmit_chan == TRUE) { if (!refresh || - (refresh && + (refresh && gsmsdp_sdp_differs_from_previous_sdp(FALSE, media))) { if (!sdpmode) { - vcmTxClose(media->cap_index, dcb->group_id, media->refid, + vcmTxClose(media->cap_index, dcb->group_id, media->refid, lsm_get_ms_ui_call_handle(lcb->line, lcb->call_id, lcb->ui_id)); } if (dcb->active_tone == VCM_MONITORWARNING_TONE || dcb->active_tone == VCM_RECORDERWARNING_TONE) { LSM_DEBUG(DEB_L_C_F_PREFIX"%s: Found active_tone: %d being played, current monrec_tone_action: %d. Need stop tone. \n", - DEB_L_C_F_PREFIX_ARGS(LSM, dcb->line, dcb->call_id, fname), fname, + DEB_L_C_F_PREFIX_ARGS(LSM, dcb->line, dcb->call_id, fname), fname, dcb->active_tone, dcb->monrec_tone_action); (void) lsm_stop_tone(lcb, NULL); } media->xmit_chan = FALSE; - LSM_DEBUG(DEB_L_C_F_PREFIX"closed", + LSM_DEBUG(DEB_L_C_F_PREFIX"closed", DEB_L_C_F_PREFIX_ARGS(LSM, dcb->line, dcb->call_id, fname)); } } @@ -884,7 +849,7 @@ lsm_close_tx (lsm_lcb_t *lcb, boolean refresh, fsmdef_media_t *media) * The function starts receive channel for a given media entry. * * @param[in] lcb - pointer to the lsm_lcb_t. - * @param[in] fname - pointer to to const. char for the name + * @param[in] fname - pointer to to const. char for the name * of the function that calls to this function. * It is for debuging purpose. * @param[in] media - pointer to the fsmdef_media_t for the @@ -903,7 +868,7 @@ lsm_rx_start (lsm_lcb_t *lcb, const char *fname, fsmdef_media_t *media) static const char fname1[] = "lsm_rx_start"; cc_action_data_open_rcv_t open_rcv; uint16_t port; - groupid_t group_id = CC_NO_GROUP_ID; + groupid_t group_id = CC_NO_GROUP_ID; callid_t call_id = lcb->call_id; vcm_mixing_mode_t mix_mode = VCM_NO_MIX; vcm_mixing_party_t mix_party = VCM_PARTY_NONE; @@ -932,7 +897,7 @@ lsm_rx_start (lsm_lcb_t *lcb, const char *fname, fsmdef_media_t *media) start_media = media; end_media = media; } - + /* Start receive channel for the media(s) */ GSMSDP_FOR_MEDIA_LIST(media, start_media, end_media, dcb) { if (!GSMSDP_MEDIA_ENABLED(media)) { @@ -954,14 +919,14 @@ lsm_rx_start (lsm_lcb_t *lcb, const char *fname, fsmdef_media_t *media) /* * Open the RTP receive channel if it is not already open. */ - LSM_DEBUG(get_debug_string(LSM_DBG_INT1), dcb->call_id, dcb->line, + LSM_DEBUG(get_debug_string(LSM_DBG_INT1), dcb->call_id, dcb->line, fname1, "rcv chan", media->rcv_chan); if (media->rcv_chan == FALSE) { memset(&open_rcv, 0, sizeof(open_rcv)); port = media->src_port; - if (media->is_multicast && + if (media->is_multicast && (media->direction == SDP_DIRECTION_RECVONLY)) { open_rcv.is_multicast = media->is_multicast; open_rcv.listen_ip = media->dest_addr; @@ -985,10 +950,10 @@ lsm_rx_start (lsm_lcb_t *lcb, const char *fname, fsmdef_media_t *media) } break; - case MONITOR: + case MONITOR: case LOCAL_CONF: //AgentGreeting is MIX RXBOTH, SilentMonitoring is MIX TXBOTH - //so we have to use VCM_PARTY_BOTH for case MONITOR + //so we have to use VCM_PARTY_BOTH for case MONITOR mix_mode = VCM_MIX; mix_party = VCM_PARTY_BOTH; break; @@ -1000,15 +965,15 @@ lsm_rx_start (lsm_lcb_t *lcb, const char *fname, fsmdef_media_t *media) } has_checked_conference = TRUE; } - + if (lsm_open_rx(lcb, &open_rcv, media) != CC_RC_SUCCESS) { LSM_ERR_MSG(LSM_L_C_F_PREFIX"%s: open receive port (%d) failed.\n", - dcb->line, dcb->call_id, fname1, + dcb->line, dcb->call_id, fname1, fname, media->src_port); } else { /* successful open receive channel */ media->rcv_chan = TRUE; /* recevied channel is created */ - /* save the source RX port */ + /* save the source RX port */ if (media->is_multicast) { media->multicast_port = open_rcv.port; } else { @@ -1067,19 +1032,19 @@ lsm_rx_start (lsm_lcb_t *lcb, const char *fname, fsmdef_media_t *media) lsm_update_dscp_value(dcb); - if (dcb->play_tone_action == FSMDEF_PLAYTONE_ZIP) + if (dcb->play_tone_action == FSMDEF_PLAYTONE_ZIP) { vcm_tones_t tone = VCM_ZIP; uint16_t direction = dcb->tone_direction; - LSM_DEBUG(DEB_L_C_F_PREFIX"%s: Found play_tone_action: %d. Need to play tone.\n", + LSM_DEBUG(DEB_L_C_F_PREFIX"%s: Found play_tone_action: %d. Need to play tone.\n", DEB_L_C_F_PREFIX_ARGS(LSM, dcb->line, dcb->call_id, fname), fname, dcb->play_tone_action); // reset to initialized values dcb->play_tone_action = FSMDEF_PLAYTONE_NO_ACTION; dcb->tone_direction = VCM_PLAY_TONE_TO_EAR; - lsm_util_tone_start_with_speaker_as_backup(tone, VCM_ALERT_INFO_OFF, + lsm_util_tone_start_with_speaker_as_backup(tone, VCM_ALERT_INFO_OFF, lsm_get_ms_ui_call_handle(dcb->line, dcb->call_id, CC_NO_CALL_ID), dcb->group_id, ((media != NULL) ? media->refid : CC_NO_MEDIA_REF_ID), @@ -1092,7 +1057,7 @@ lsm_rx_start (lsm_lcb_t *lcb, const char *fname, fsmdef_media_t *media) /** * The function starts transmit channel for a given media entry. - * + * * @param[in] lcb - pointer to the lsm_lcb_t. * @param[in] fname - pointer to to const. char for the name * of the function that calls to this function. @@ -1104,7 +1069,7 @@ lsm_rx_start (lsm_lcb_t *lcb, const char *fname, fsmdef_media_t *media) * all current inused media entries. * * @return None. - * + * * @pre (lcb is_not NULL) */ @@ -1117,7 +1082,7 @@ lsm_tx_start (lsm_lcb_t *lcb, const char *fname, fsmdef_media_t *media) int dscp = 184; /* default 184 used for DSCP */ char tmp[LSM_TMP_VAD_LEN]; fsmcnf_ccb_t *ccb = NULL; - groupid_t group_id; + groupid_t group_id; callid_t call_id = lcb->call_id; vcm_mixing_mode_t mix_mode = VCM_NO_MIX; vcm_mixing_party_t mix_party = VCM_PARTY_NONE; @@ -1193,7 +1158,7 @@ lsm_tx_start (lsm_lcb_t *lcb, const char *fname, fsmdef_media_t *media) case MONITOR: case LOCAL_CONF: //AgentGreeting is MIX RXBOTH, SilentMonitoring is MIX TXBOTH - //so we have to use VCM_PARTY_BOTH for case MONITOR + //so we have to use VCM_PARTY_BOTH for case MONITOR mix_mode = VCM_MIX; mix_party = VCM_PARTY_BOTH; break; @@ -1266,7 +1231,7 @@ lsm_tx_start (lsm_lcb_t *lcb, const char *fname, fsmdef_media_t *media) dcb->cur_video_avail &= ~CC_ATTRIB_CAST; - if (!strlen(dcb->peerconnection)){ + if (!strlen(dcb->peerconnection)){ if (vcmTxStart(media->cap_index, group_id, media->refid, lsm_get_ms_ui_call_handle(dcb->line, call_id, CC_NO_CALL_ID), @@ -1280,7 +1245,7 @@ lsm_tx_start (lsm_lcb_t *lcb, const char *fname, fsmdef_media_t *media) media->dest_port, FSM_NEGOTIATED_CRYPTO_ALGORITHM_ID(media), FSM_NEGOTIATED_CRYPTO_TX_KEY(media), - &attrs) == -1) + &attrs) == -1) { LSM_DEBUG(DEB_L_C_F_PREFIX"%s: vcmTxStart failed\n", DEB_L_C_F_PREFIX_ARGS(LSM, dcb->line, dcb->call_id, fname1), fname); @@ -1304,7 +1269,7 @@ lsm_tx_start (lsm_lcb_t *lcb, const char *fname, fsmdef_media_t *media) (short)dscp, FSM_NEGOTIATED_CRYPTO_DIGEST_ALGORITHM(media), FSM_NEGOTIATED_CRYPTO_DIGEST(media), - &attrs) == -1) + &attrs) == -1) { LSM_DEBUG(DEB_L_C_F_PREFIX"%s: vcmTxStartICE failed\n", DEB_L_C_F_PREFIX_ARGS(LSM, dcb->line, dcb->call_id, fname1), fname); @@ -1324,7 +1289,7 @@ lsm_tx_start (lsm_lcb_t *lcb, const char *fname, fsmdef_media_t *media) uint16_t direction = VCM_PLAY_TONE_TO_EAR; boolean play_both_tones = FALSE; - LSM_DEBUG(DEB_L_C_F_PREFIX"%s: Found monrec_tone_action: %d. Need to restart playing tone.\n", + LSM_DEBUG(DEB_L_C_F_PREFIX"%s: Found monrec_tone_action: %d. Need to restart playing tone.\n", DEB_L_C_F_PREFIX_ARGS(LSM, dcb->line, dcb->call_id, fname), fname, dcb->monrec_tone_action); switch (dcb->monrec_tone_action) { @@ -1349,7 +1314,7 @@ lsm_tx_start (lsm_lcb_t *lcb, const char *fname, fsmdef_media_t *media) } if (play_both_tones == TRUE) { - lsm_util_tone_start_with_speaker_as_backup(VCM_RECORDERWARNING_TONE, VCM_ALERT_INFO_OFF, + lsm_util_tone_start_with_speaker_as_backup(VCM_RECORDERWARNING_TONE, VCM_ALERT_INFO_OFF, lsm_get_ms_ui_call_handle(dcb->line, dcb->call_id, CC_NO_CALL_ID), dcb->group_id, ((media != NULL) ? media->refid : CC_NO_MEDIA_REF_ID), @@ -1412,13 +1377,13 @@ lsm_stop_tone (lsm_lcb_t *lcb, cc_action_data_tone_t *data) if (dcb->active_tone != VCM_NO_TONE) { fsmdef_media_t *media = gsmsdp_find_audio_media(lcb->dcb); vcmToneStop(dcb->active_tone, dcb->group_id, - ((media != NULL) ? media->refid : CC_NO_MEDIA_REF_ID), + ((media != NULL) ? media->refid : CC_NO_MEDIA_REF_ID), lsm_get_ms_ui_call_handle(lcb->line, lcb->call_id, lcb->ui_id)); /* * Both periodic tones, recording and monitoring, can be active at the * same time. And because we only keep track of last tone, requested to - * play, through active_tone, so when the tone to be stopped is of - * periodic type, then it could be that both type of periodic tones + * play, through active_tone, so when the tone to be stopped is of + * periodic type, then it could be that both type of periodic tones * could be playing and both should be stopped. If the second periodic * tone is not playing then media server will ignore the stop request. */ @@ -1428,7 +1393,7 @@ lsm_stop_tone (lsm_lcb_t *lcb, cc_action_data_tone_t *data) vcmToneStop(dcb->active_tone == VCM_RECORDERWARNING_TONE ? VCM_MONITORWARNING_TONE : VCM_RECORDERWARNING_TONE, dcb->group_id, - ((media != NULL) ? media->refid : CC_NO_MEDIA_REF_ID), + ((media != NULL) ? media->refid : CC_NO_MEDIA_REF_ID), lsm_get_ms_ui_call_handle(lcb->line, lcb->call_id, lcb->ui_id)); /* in case need to play back the tone again when tx channel active */ @@ -1450,7 +1415,7 @@ lsm_stop_tone (lsm_lcb_t *lcb, cc_action_data_tone_t *data) } LSM_DEBUG(DEB_L_C_F_PREFIX"%s: Setting monrec_tone_action: %d so resume to play correct tone.\n", - DEB_L_C_F_PREFIX_ARGS(LSM, dcb->line, dcb->call_id, fname), fname, + DEB_L_C_F_PREFIX_ARGS(LSM, dcb->line, dcb->call_id, fname), fname, dcb->monrec_tone_action); } dcb->active_tone = VCM_NO_TONE; @@ -1463,7 +1428,7 @@ lsm_stop_tone (lsm_lcb_t *lcb, cc_action_data_tone_t *data) } /* - * Function + * Function * * @param[in] tone - tone type * @param[in] alert_info - alertinfo header @@ -1485,14 +1450,14 @@ lsm_tone_start_with_duration (vcm_tones_t tone, short alert_info, DEF_DEBUG(DEB_L_C_F_PREFIX"tone=%-2d: direction=%-2d duration=%-2d\n", DEB_L_C_F_PREFIX_ARGS(LSM, GET_LINE_ID(call_handle), GET_CALL_ID(call_handle), fname), tone, direction, duration); - + /* * play the tone. audio path is always set by MSUI module. */ vcmToneStart (tone, alert_info, call_handle, group_id, stream_id, direction); - lsm_update_active_tone (tone, GET_CALL_ID(call_handle)); - + lsm_update_active_tone (tone, GET_CALL_ID(call_handle)); + lsm_start_tone_duration_timer (tone, duration, call_handle); } @@ -1563,7 +1528,7 @@ int lsm_get_all_used_instances_cnt () * * @param line - line number * - * Description: + * Description: * * @return none * @@ -1591,18 +1556,18 @@ void lsm_increment_call_chn_cnt (line_t line) LSM_DEBUG(DEB_F_PREFIX"number of calls on line[%d]=%d" "MaxNumCalls[%d]_reached=%s BusyTrigger[%d]_reached=%s\n", - DEB_F_PREFIX_ARGS(LSM, fname), - line, lsm_call_perline[line-1], + DEB_F_PREFIX_ARGS(LSM, fname), + line, lsm_call_perline[line-1], maxnumcalls, (lsm_mnc_reached[line-1] == TRUE) ? "TRUE" : "FALSE", busy_trigger,(lsm_bt_reached[line-1] == TRUE) ? "TRUE" : "FALSE"); } - + /* * Function: lsm_decrement_call_chn_cnt * * @param line - line number * - * Description: + * Description: * * @return none * @@ -1611,7 +1576,7 @@ void lsm_decrement_call_chn_cnt (line_t line) { uint32_t maxnumcalls = 0; uint32_t busy_trigger = 0; - static const char fname[] = "lsm_decrement_call_chn_cnt"; + static const char fname[] = "lsm_decrement_call_chn_cnt"; if ( line <=0 || line > MAX_REG_LINES ) { LSM_ERR_MSG(LSM_F_PREFIX"invalid line (%d)\n", fname, line); @@ -1630,8 +1595,8 @@ void lsm_decrement_call_chn_cnt (line_t line) } LSM_DEBUG(DEB_F_PREFIX"number of calls on line[%d]=%d" "MaxNumCalls[%d]_reached=%s BusyTrigger[%d]_reached=%s\n", - DEB_F_PREFIX_ARGS(LSM, fname), - line, lsm_call_perline[line-1], + DEB_F_PREFIX_ARGS(LSM, fname), + line, lsm_call_perline[line-1], maxnumcalls, (lsm_mnc_reached[line-1] == TRUE) ? "TRUE" : "FALSE", busy_trigger,(lsm_bt_reached[line-1] == TRUE) ? "TRUE" : "FALSE"); } @@ -1647,8 +1612,8 @@ void lsm_decrement_call_chn_cnt (line_t line) * @param same_dn - whether lines with same DN to be looked at. * @param incoming - whether we are looking for an available line for an anticipated incoming call. * - * Description: - * + * Description: + * * * @return found line number * @@ -1656,7 +1621,7 @@ void lsm_decrement_call_chn_cnt (line_t line) line_t lsm_find_next_available_line (line_t line, boolean same_dn, boolean incoming) { char current_line_dn_name[MAX_LINE_NAME_SIZE]; - char dn_name[MAX_LINE_NAME_SIZE]; + char dn_name[MAX_LINE_NAME_SIZE]; uint32_t line_feature; line_t i, j; boolean *limit_reached; @@ -1670,7 +1635,7 @@ line_t lsm_find_next_available_line (line_t line, boolean same_dn, boolean incom } config_get_line_string(CFGID_LINE_NAME, current_line_dn_name, line, sizeof(current_line_dn_name)); - /* This line has exhausted its limit, start rollover */ + /* This line has exhausted its limit, start rollover */ /* First, search the lines on top of the current one */ for (i=line+1; i <= MAX_REG_LINES; i++) { config_get_line_value(CFGID_LINE_FEATURE, &line_feature, sizeof(line_feature), i); @@ -1686,15 +1651,15 @@ line_t lsm_find_next_available_line (line_t line, boolean same_dn, boolean incom /* Does this line have the same DN */ if (cpr_strcasecmp(dn_name, current_line_dn_name) == 0) { return (i); - } + } } else { return (i); } } - } - /* - * We went up to the top and couldn't find an available line, - * start from line 1 and search up to the current line, thus + } + /* + * We went up to the top and couldn't find an available line, + * start from line 1 and search up to the current line, thus * we are treating the available lines as a circular pool */ @@ -1712,7 +1677,7 @@ line_t lsm_find_next_available_line (line_t line, boolean same_dn, boolean incom /* Does this line have the same DN */ if (cpr_strcasecmp(dn_name, current_line_dn_name) == 0) { return (j); - } + } } else { return (j); } @@ -1734,9 +1699,9 @@ line_t lsm_find_next_available_line (line_t line, boolean same_dn, boolean incom */ line_t lsm_get_newcall_line (line_t line) { - static const char fname[] = "lsm_get_newcall_line"; + static const char fname[] = "lsm_get_newcall_line"; int rollover; - line_t found_line; + line_t found_line; if (!lsm_mnc_reached[line-1]) { /* Still room for extra calls on this line */ @@ -1744,7 +1709,7 @@ line_t lsm_get_newcall_line (line_t line) } config_get_value(CFGID_ROLLOVER, &rollover, sizeof(int)); - + if (rollover == NO_ROLLOVER) { DEF_DEBUG(DEB_F_PREFIX"NO Rollover, no lines\n", DEB_F_PREFIX_ARGS(LSM, fname)); return (NO_LINES_AVAILABLE); @@ -1754,26 +1719,26 @@ line_t lsm_get_newcall_line (line_t line) if (rollover == ROLLOVER_ACROSS_SAME_DN) { /* Look for a line with the same DN */ return (lsm_find_next_available_line(line, TRUE, FALSE)); - } + } if (rollover == ROLLOVER_NEXT_AVAILABLE_LINE) { /* Look for a line with the same DN first */ found_line = lsm_find_next_available_line(line, TRUE, FALSE); if (found_line == NO_LINES_AVAILABLE) { - /* - * If nothing found, just look for any line, does - * not necessarily have to have the same DN + /* + * If nothing found, just look for any line, does + * not necessarily have to have the same DN */ return (lsm_find_next_available_line(line, FALSE, FALSE)); } else { return (found_line); } - } + } DEF_DEBUG(DEB_F_PREFIX"No lines available\n", DEB_F_PREFIX_ARGS(LSM, fname)); - return (NO_LINES_AVAILABLE); + return (NO_LINES_AVAILABLE); } /* @@ -1825,7 +1790,7 @@ boolean lsm_is_line_available (line_t line, boolean incoming) return (TRUE); } } - else { + else { if (!lsm_bt_reached[line-1]) { /* Still room for incoming calls on this line */ return (TRUE); @@ -1845,7 +1810,7 @@ boolean lsm_is_line_available (line_t line, boolean incoming) int lsm_get_instances_available_cnt (line_t line, boolean expline) { - static const char fname[] = "lsm_get_instances_available_cnt"; + static const char fname[] = "lsm_get_instances_available_cnt"; int max_instances; int used_instances = 0; int free_instances; @@ -1867,11 +1832,11 @@ lsm_get_instances_available_cnt (line_t line, boolean expline) int all_max_instances = (expline) ? (LSM_MAX_CALLS) : (LSM_MAX_CALLS - 1); int all_free_instances = all_max_instances - all_used_instances; free_instances = ((free_instances < all_free_instances) ? free_instances : all_free_instances); - LSM_DEBUG("lsm_get_instances_available_cnt: line=%d, expline=%d, free=%d, all_used=%d, all_max=%d, all_free=%d\n", + LSM_DEBUG("lsm_get_instances_available_cnt: line=%d, expline=%d, free=%d, all_used=%d, all_max=%d, all_free=%d\n", line, expline, free_instances, all_used_instances, all_max_instances, all_free_instances); } - LSM_DEBUG("lsm_get_instances_available_cnt: line=%d, expline=%d, free_instances=%d\n", + LSM_DEBUG("lsm_get_instances_available_cnt: line=%d, expline=%d, free_instances=%d\n", line, expline, free_instances); return (free_instances); } @@ -1919,7 +1884,7 @@ static void lsm_release_port (lsm_lcb_t *lcb) start_media = GSMSDP_FIRST_MEDIA_ENTRY(dcb); end_media = NULL; /* NULL means till the end of the list */ - + GSMSDP_FOR_MEDIA_LIST(media, start_media, end_media, dcb) { if (!sdpmode) { vcmRxReleasePort(media->cap_index, dcb->group_id, media->refid, @@ -1952,7 +1917,7 @@ lsm_free_lcb (lsm_lcb_t *lcb) static lsm_lcb_t * lsm_get_free_lcb (callid_t call_id, line_t line, fsmdef_dcb_t *dcb) { - static const char fname[] = "lsm_get_free_lcb"; + static const char fname[] = "lsm_get_free_lcb"; static int mru = 0; lsm_lcb_t *lcb; lsm_lcb_t *lcb_found = NULL; @@ -1983,7 +1948,7 @@ lsm_get_free_lcb (callid_t call_id, line_t line, fsmdef_dcb_t *dcb) lcb->state = LSM_S_PENDING; lcb->mru = mru; lcb->dcb = dcb; - // start unmuted if txPref is true + // start unmuted if txPref is true lcb->vid_mute = cc_media_getVideoAutoTxPref()?FALSE:TRUE; lcb->ui_id = call_id; /* default UI ID is the same as call_id */ @@ -2013,25 +1978,25 @@ lsm_get_lcb_by_call_id (callid_t call_id) return (lcb_found); } -/** +/** * This function returns the LSM state for the given call_id. - * + * * @param[in] call_id - call id - * + * * @return lsm_states_t of the given call_id. If the * there is no call associated with the given * call ID it returns the LSM_S_NONE. - */ + */ lsm_states_t lsm_get_state (callid_t call_id) { lsm_lcb_t *lcb; lcb = lsm_get_lcb_by_call_id(call_id); - - if (lcb == NULL) { + + if (lcb == NULL) { /* there is no call for this call id */ - return (LSM_S_NONE); + return (LSM_S_NONE); } return (lcb->state); } @@ -2039,8 +2004,8 @@ lsm_get_state (callid_t call_id) static void lsm_change_state (lsm_lcb_t *lcb, int line_num, lsm_states_t new_state) { - static const char fname1[] = "lsm_change_state"; - LSM_DEBUG(DEB_L_C_F_PREFIX"%d: %s -> %s\n", + static const char fname1[] = "lsm_change_state"; + LSM_DEBUG(DEB_L_C_F_PREFIX"%d: %s -> %s\n", DEB_L_C_F_PREFIX_ARGS(LSM, lcb->line, lcb->call_id, fname1), line_num, lsm_state_name(lcb->state), lsm_state_name(new_state)); @@ -2058,7 +2023,7 @@ lsm_is_phone_idle (void) LSM_DEBUG(DEB_F_PREFIX"No lsm line cb\n", DEB_F_PREFIX_ARGS(LSM, fname)); return (idle); } - + FSM_FOR_ALL_CBS(lcb, lsm_lcbs, LSM_MAX_LCBS) { if ((lcb->call_id != CC_NO_CALL_ID) && (lcb->state != LSM_S_IDLE)) { idle = FALSE; @@ -2164,29 +2129,29 @@ lsm_find_state (lsm_states_t state) /** * lsm_get_facility_by_called_number * return facility by the given called_number. - * + * * @param[in]call_id - gsm's call_id for a new call. * @param[in]called_number - pointer to the called number. * @paran[in/out]free_line - pointer to the line_t to store * the result line number corresponding - * to the called number given. + * to the called number given. * @param[in]expline - boolean indicating extra instance * is needed. - * @param[in]dcb - pointer to void but it must be + * @param[in]dcb - pointer to void but it must be * a pointer to fsmdef_dcb_t to bind with * the new LCB. The reason to use a void * pointer is the declaration of the function - * is in lsm.h. The lsm.h file is used by + * is in lsm.h. The lsm.h file is used by * components outside gsm environment. Those * modules would need to include the fsm.h * which is not desirable. Using void pointer * avoids this problem. - * - * @return cc_cause_t - * + * + * @return cc_cause_t + * * @pre (called_number not_eq NULL) * @pre (free_line not_eq NULL) - * @pre (dcb not_eq NULL) + * @pre (dcb not_eq NULL) */ cc_causes_t lsm_get_facility_by_called_number (callid_t call_id, @@ -2251,18 +2216,18 @@ lsm_get_facility_by_called_number (callid_t call_id, /** * lsm_allocate_call_bandwidth - * + * * @param[in] none. * - * The wlan interface puts into unique situation where call control - * has to allocate the worst case bandwith before creating a + * The wlan interface puts into unique situation where call control + * has to allocate the worst case bandwith before creating a * inbound or outbound call. The function call will interface through * media API into wlan to get the call bandwidth. The function * return is asynchronous and will block till the return media * callback signals to continue the execution. * * @return true if the bandwidth can be allocated else false. - * @pre none + * @pre none */ cc_causes_t lsm_allocate_call_bandwidth (callid_t call_id, int sessions) @@ -2270,10 +2235,10 @@ cc_causes_t lsm_allocate_call_bandwidth (callid_t call_id, int sessions) //get line for vcm line_t line = lsm_get_line_by_call_id(call_id); //cc_feature(CC_SRC_GSM, call_id, 0, CC_FEATURE_CAC_RESP_PASS, NULL); - + /* Activate the wlan before allocating bandwidth */ vcmActivateWlan(TRUE); - + if (vcmAllocateBandwidth(lsm_get_ms_ui_call_handle(line, call_id, CC_NO_CALL_ID), sessions)) { return(CC_CAUSE_OK); } @@ -2284,23 +2249,23 @@ cc_causes_t lsm_allocate_call_bandwidth (callid_t call_id, int sessions) /** * lsm_get_facility_by_line * return facility by the given line - * + * * @param[in]call_id - gsm's call_id for a new call. - * @param[in]line - line + * @param[in]line - line * @param[in]expline - boolean indicating extra instance * is needed. * @param[in]dcb - pointer to void but it must be * a pointer to fsmdef_dcb_t to bind with - * the new LCB. The reason to use a void - * pointer is the declaration of the function - * is in lsm.h. The lsm.h file is used by + * the new LCB. The reason to use a void + * pointer is the declaration of the function + * is in lsm.h. The lsm.h file is used by * components outside gsm environment. Those - * modules would need to include the fsm.h - * which is not desirable. Using void pointer + * modules would need to include the fsm.h + * which is not desirable. Using void pointer * avoids this problem. * - * @return cc_cause_t - * @pre (dcb not_eq NULL) + * @return cc_cause_t + * @pre (dcb not_eq NULL) */ cc_causes_t lsm_get_facility_by_line (callid_t call_id, line_t line, boolean expline, @@ -2394,7 +2359,7 @@ lsm_tmr_tones_callback (void *data) callid_t call_id; fsmdef_dcb_t *dcb = NULL; fsmdef_media_t *media; - + LSM_DEBUG(DEB_F_PREFIX"invoked", DEB_F_PREFIX_ARGS(LSM, fname)); call_id = (callid_t)(long)data; @@ -2403,7 +2368,7 @@ lsm_tmr_tones_callback (void *data) LSM_DEBUG(DEB_F_PREFIX"invalid call id\n", DEB_F_PREFIX_ARGS(LSM, fname)); return; } - + /* * A call-waiting tone should be played if these conditions are met: * 1. A line must be ringing for an incoming call @@ -2417,7 +2382,7 @@ lsm_tmr_tones_callback (void *data) } media = gsmsdp_find_audio_media(dcb); - + if ((lsm_find_state(LSM_S_RINGIN) > CC_NO_CALL_ID) && (lsm_callwaiting())) { /* Determine what tone/ringing pattern to play */ @@ -2429,7 +2394,7 @@ lsm_tmr_tones_callback (void *data) switch (dcb->alerting_ring) { case VCM_BELLCORE_DR2: lsm_util_start_tone(VCM_CALL_WAITING_2_TONE, NO, lsm_get_ms_ui_call_handle(dcb->line, dcb->call_id, CC_NO_CALL_ID), dcb->group_id, - ((media != NULL) ? media->refid : CC_NO_MEDIA_REF_ID), + ((media != NULL) ? media->refid : CC_NO_MEDIA_REF_ID), dcb->tone_direction); break; case VCM_BELLCORE_DR3: @@ -2559,7 +2524,7 @@ lsm_start_multipart_tone_timer (vcm_tones_t tone, LSM_DEBUG(get_debug_string(DEBUG_GENERAL_SYSTEMCALL_FAILED), fname, "cprCancelTimer", cpr_errno); } - if (cprStartTimer(lsm_tmr_tones, delay, (void *)(long)dcb->call_id) == + if (cprStartTimer(lsm_tmr_tones, delay, (void *)(long)dcb->call_id) == CPR_FAILURE) { LSM_DEBUG(get_debug_string(DEBUG_GENERAL_SYSTEMCALL_FAILED), fname, "cprStartTimer", cpr_errno); @@ -2660,7 +2625,7 @@ lsm_start_tone_duration_timer (vcm_tones_t tone, LSM_DEBUG(get_debug_string(DEBUG_GENERAL_SYSTEMCALL_FAILED), fname, "cprCancelTimer", cpr_errno); } - if (cprStartTimer(lsm_tone_duration_tmr, duration*1000, (void *)(long)dcb->call_id) == + if (cprStartTimer(lsm_tone_duration_tmr, duration*1000, (void *)(long)dcb->call_id) == CPR_FAILURE) { LSM_DEBUG(get_debug_string(DEBUG_GENERAL_SYSTEMCALL_FAILED), fname, "cprStartTimer", cpr_errno); @@ -2701,7 +2666,7 @@ lsm_tone_duration_tmr_callback (void *data) callid_t call_id; fsmdef_dcb_t *dcb = NULL; fsmdef_media_t *media; - + LSM_DEBUG(DEB_F_PREFIX"invoked", DEB_F_PREFIX_ARGS(LSM, fname)); call_id = (callid_t)(long)data; @@ -2710,7 +2675,7 @@ lsm_tone_duration_tmr_callback (void *data) LSM_DEBUG(DEB_F_PREFIX"invalid call id\n", DEB_F_PREFIX_ARGS(LSM, fname)); return; } - + /* Retrieve dcb from call id */ dcb = fsmdef_get_dcb_by_call_id(call_id); if (dcb == NULL) { @@ -2721,13 +2686,13 @@ lsm_tone_duration_tmr_callback (void *data) media = gsmsdp_find_audio_media(dcb); vcmToneStop(dcb->active_tone, dcb->group_id, - ((media != NULL) ? media->refid : CC_NO_MEDIA_REF_ID), + ((media != NULL) ? media->refid : CC_NO_MEDIA_REF_ID), lsm_get_ms_ui_call_handle(dcb->line, dcb->call_id, CC_NO_CALL_ID)); /* Up until this point, only sip core has started the call release procedure */ /* since upon receipt of the BYE. Now that tone is completed playing as requested */ /* in the BYE, need to continue processing with call clearing. */ - + cc_int_release(CC_SRC_GSM, CC_SRC_GSM, call_id, dcb->line, CC_CAUSE_NORMAL, NULL, NULL); } @@ -2802,7 +2767,7 @@ lsm_reversion_ringer (lsm_lcb_t *lcb, callid_t call_id, line_t line) if (ringSettingActive == BEEP_ONLY) { fsmdef_media_t *media = gsmsdp_find_audio_media(lcb->dcb); - + lsm_util_start_tone(toneMode, NO, lsm_get_ms_ui_call_handle(line, call_id, CC_NO_CALL_ID), lcb->dcb->group_id, ((media != NULL) ? media->refid : CC_NO_MEDIA_REF_ID), VCM_PLAY_TONE_TO_EAR); @@ -2866,7 +2831,7 @@ lsm_set_beep_only_settings (fsmdef_dcb_t *dcb, vcm_tones_t *toneMode_p) if (sip_regmgr_get_cc_mode(dcb->line) == REG_MODE_CCM) { dcb->alerting_tone = VCM_CALL_WAITING_TONE; LSM_DEBUG(DEB_F_PREFIX"%s - Overriding value in Alert-Info header as line %d is \ - connected to a Call Manager.\n", + connected to a Call Manager.\n", DEB_F_PREFIX_ARGS(LSM, "lsm_set_beep_only_settings"), dcb->line); } *toneMode_p = dcb->alerting_tone; @@ -2954,17 +2919,17 @@ lsm_set_ringer (lsm_lcb_t *lcb, callid_t call_id, line_t line, int alerting) * Otherwise, turn on the call-waiting tones. * */ - + if (priority_call_id == CC_NO_CALL_ID) { - /* get the call_id of the line that triggers this if it is ringing and + /* get the call_id of the line that triggers this if it is ringing and pass down the correct line variable and its ring type and let the ring - manager decides. Originally we only find line first line in ringing state + manager decides. Originally we only find line first line in ringing state which results in issue where Flash only line follows by audio ring line ringing simultaneously, the phone does not ring audibly. - */ + */ if (lcb->state == LSM_S_RINGIN) { other_call_id = call_id; - } else { + } else { other_call_id = lsm_find_state(LSM_S_RINGIN); } } @@ -2998,7 +2963,7 @@ lsm_set_ringer (lsm_lcb_t *lcb, callid_t call_id, line_t line, int alerting) line = dcb->line; if (!lsm_callwaiting()) { - + LSM_DEBUG(DEB_L_C_F_PREFIX"No call waiting, lcb->line=%d, lcb->flag=%d.\n", DEB_L_C_F_PREFIX_ARGS(LSM, line, lcb->call_id, fname), lcb->line, @@ -3080,7 +3045,7 @@ lsm_set_ringer (lsm_lcb_t *lcb, callid_t call_id, line_t line, int alerting) } LSM_DEBUG(DEB_L_C_F_PREFIX"Alert info=%d, ringSettingIdle=%d, ringerMode=%d\n", - DEB_L_C_F_PREFIX_ARGS(LSM, line, call_id, fname), + DEB_L_C_F_PREFIX_ARGS(LSM, line, call_id, fname), dcb->alert_info, ringSettingIdle, ringerMode); @@ -3109,13 +3074,13 @@ lsm_set_ringer (lsm_lcb_t *lcb, callid_t call_id, line_t line, int alerting) DEB_L_C_F_PREFIX_ARGS(LSM, line, call_id, fname)); media = gsmsdp_find_audio_media(lcb->dcb); - lsm_util_tone_start_with_speaker_as_backup(toneMode, NO, lsm_get_ms_ui_call_handle(line, call_id, CC_NO_CALL_ID), + lsm_util_tone_start_with_speaker_as_backup(toneMode, NO, lsm_get_ms_ui_call_handle(line, call_id, CC_NO_CALL_ID), lcb->dcb->group_id, ((media != NULL) ? media->refid : CC_NO_MEDIA_REF_ID), VCM_PLAY_TONE_TO_EAR); } else { LSM_DEBUG(DEB_L_C_F_PREFIX"Idle phone RING SETTING: ringer Mode = %s," - " Ring once = %d, alertInfo = %d\n", + " Ring once = %d, alertInfo = %d\n", DEB_L_C_F_PREFIX_ARGS(LSM, line, call_id, fname), vm_alert_names[ringerMode], ringOnce, alertInfo); @@ -3132,12 +3097,12 @@ lsm_set_ringer (lsm_lcb_t *lcb, callid_t call_id, line_t line, int alerting) // Ring off all lines. FSM_FOR_ALL_CBS(lcb2, lsm_lcbs, LSM_MAX_LCBS) { - if ((lcb2->call_id != CC_NO_CALL_ID) && - (lcb2->state == LSM_S_RINGIN) ) + if ((lcb2->call_id != CC_NO_CALL_ID) && + (lcb2->state == LSM_S_RINGIN) ) { LSM_DEBUG(DEB_L_C_F_PREFIX"Call waiting RING SETTING: " - "ringer Mode = RING_OFF, Ring once = NO, alertInfo = NO\n", - DEB_L_C_F_PREFIX_ARGS(LSM, lcb2->line, lcb2->call_id, fname)); + "ringer Mode = RING_OFF, Ring once = NO, alertInfo = NO\n", + DEB_L_C_F_PREFIX_ARGS(LSM, lcb2->line, lcb2->call_id, fname)); vcmControlRinger(VCM_RING_OFF, NO, NO, lcb2->line, call_id); } } @@ -3225,14 +3190,14 @@ lsm_set_ringer (lsm_lcb_t *lcb, callid_t call_id, line_t line, int alerting) */ if (ringSettingActive == BEEP_ONLY) { media = gsmsdp_find_audio_media(dcb); - + lsm_util_start_tone(toneMode, NO, lsm_get_ms_ui_call_handle(line, call_id, CC_NO_CALL_ID), dcb->group_id, ((media != NULL) ? media->refid : CC_NO_MEDIA_REF_ID), VCM_PLAY_TONE_TO_EAR); } else { LSM_DEBUG(DEB_L_C_F_PREFIX"Active call RING SETTING: " - "ringer Mode = %s, Ring once = %d, alertInfo = %d\n", + "ringer Mode = %s, Ring once = %d, alertInfo = %d\n", DEB_L_C_F_PREFIX_ARGS(LSM, line, call_id, fname), vm_alert_names[ringerMode], ringOnce, alertInfo); @@ -3278,7 +3243,7 @@ lsm_set_ringer (lsm_lcb_t *lcb, callid_t call_id, line_t line, int alerting) ringer_set = TRUE; LSM_DEBUG(DEB_L_C_F_PREFIX"Hold RINGBACK SETTING: ringer Mode = " - "VCM_INSIDE_RING, Ring once = YES, alertInfo = YES\n", + "VCM_INSIDE_RING, Ring once = YES, alertInfo = YES\n", DEB_L_C_F_PREFIX_ARGS(LSM, line, dcb->call_id, fname)); vcmControlRinger(VCM_INSIDE_RING, YES, YES, line, call_id); @@ -3294,7 +3259,7 @@ lsm_set_ringer (lsm_lcb_t *lcb, callid_t call_id, line_t line, int alerting) if (ringer_set == FALSE) { LSM_DEBUG(DEB_L_C_F_PREFIX"Ringer_set = False : " - "ringer Mode = VCM_RING_OFF, Ring once = NO, alertInfo = NO\n", + "ringer Mode = VCM_RING_OFF, Ring once = NO, alertInfo = NO\n", DEB_L_C_F_PREFIX_ARGS(LSM, line, call_id, fname)); @@ -3328,7 +3293,7 @@ lsm_offhook (lsm_lcb_t *lcb, cc_state_data_offhook_t *data) * in the RINGIN state should have ringing enabled. */ FSM_FOR_ALL_CBS(lcb2, lsm_lcbs, LSM_MAX_LCBS) { - if ((lcb2->call_id != CC_NO_CALL_ID) && + if ((lcb2->call_id != CC_NO_CALL_ID) && (lcb2->state == LSM_S_RINGIN)) { vcmControlRinger(VCM_RING_OFF, NO, NO, lcb2->line, lcb2->call_id); @@ -3340,7 +3305,7 @@ lsm_offhook (lsm_lcb_t *lcb, cc_state_data_offhook_t *data) attr = fsmutil_get_call_attr(dcb, line, call_id); ui_new_call(evOffHook, line, lcb->ui_id, attr, - dcb->caller_id.call_instance_id, + dcb->caller_id.call_instance_id, (boolean)FSM_CHK_FLAGS(lcb->flags, LSM_FLAGS_DIALED_STRING)); xcb = fsmxfr_get_xcb_by_call_id(call_id); @@ -3365,7 +3330,7 @@ lsm_dialing (lsm_lcb_t *lcb, cc_state_data_dialing_t *data) int stutterMsgWaiting = 0; fsmdef_dcb_t *dcb = lcb->dcb; fsmdef_media_t *media = gsmsdp_find_audio_media(dcb); - + if ( dcb == NULL) { return (CC_RC_ERROR); @@ -3394,7 +3359,7 @@ lsm_dialing (lsm_lcb_t *lcb, cc_state_data_dialing_t *data) stutterMsgWaiting &= 0x1; /* LSB indicates on/off */ } - if ( (data->suppress_stutter == FALSE) && + if ( (data->suppress_stutter == FALSE) && (ui_line_has_mwi_active(lcb->line)) && /* has msgs waiting */ stutterMsgWaiting ) { lsm_util_start_tone(VCM_STUTTER_TONE, FALSE, lsm_get_ms_ui_call_handle(lcb->line, CC_NO_CALL_ID, lcb->ui_id), @@ -3566,7 +3531,7 @@ lsm_far_end_alerting (lsm_lcb_t *lcb, cc_state_data_far_end_alerting_t *data) call_events call_state; fsmdef_media_t *audio_media; boolean is_session_progress = FALSE; - + /* * Need to check if rcv_chan is already open and if we will be @@ -3628,9 +3593,9 @@ lsm_far_end_alerting (lsm_lcb_t *lcb, cc_state_data_far_end_alerting_t *data) status = platform_get_phrase_index_str(CALL_ALERTING_LOCAL); if (spoof_ringout) { - + if (audio_media) { - + /* * Ringback delay timer is not used for spoof ringout case * so start local ringback tone now. @@ -3639,7 +3604,7 @@ lsm_far_end_alerting (lsm_lcb_t *lcb, cc_state_data_far_end_alerting_t *data) dcb->group_id,audio_media->refid, VCM_PLAY_TONE_TO_EAR); } - + } } else { is_session_progress = TRUE; @@ -3652,8 +3617,8 @@ lsm_far_end_alerting (lsm_lcb_t *lcb, cc_state_data_far_end_alerting_t *data) } /* start receive and transmit for all media entries that are active */ - GSMSDP_FOR_ALL_MEDIA(media, dcb) { - if (!GSMSDP_MEDIA_ENABLED(media)) { + GSMSDP_FOR_ALL_MEDIA(media, dcb) { + if (!GSMSDP_MEDIA_ENABLED(media)) { /* this entry is not active */ continue; } @@ -3661,7 +3626,7 @@ lsm_far_end_alerting (lsm_lcb_t *lcb, cc_state_data_far_end_alerting_t *data) " dest_addr:0x%x is_multicast:%d\n", DEB_L_C_F_PREFIX_ARGS(LSM, dcb->line, dcb->call_id, fname), media->direction_set, - media->direction, media->dest_addr, + media->direction, media->dest_addr, media->is_multicast); if (media->direction_set) { @@ -3679,8 +3644,8 @@ lsm_far_end_alerting (lsm_lcb_t *lcb, cc_state_data_far_end_alerting_t *data) cc_state_name(CC_STATE_FAR_END_ALERTING), media); } - } - } + } + } if (!rcv_port_started) { /* @@ -3693,7 +3658,7 @@ lsm_far_end_alerting (lsm_lcb_t *lcb, cc_state_data_far_end_alerting_t *data) */ status = platform_get_phrase_index_str(CALL_ALERTING_LOCAL); lsm_util_start_tone(VCM_ALERTING_TONE, FALSE, lsm_get_ms_ui_call_handle(line, call_id, CC_NO_CALL_ID), dcb->group_id, - ((audio_media != NULL) ? audio_media->refid : + ((audio_media != NULL) ? audio_media->refid : CC_NO_MEDIA_REF_ID), VCM_PLAY_TONE_TO_EAR); } else { @@ -3706,13 +3671,13 @@ lsm_far_end_alerting (lsm_lcb_t *lcb, cc_state_data_far_end_alerting_t *data) /* Update call information */ lsm_internal_update_call_info(lcb, dcb); - /* This is the case where remote end of the call has been early trasnfered + /* This is the case where remote end of the call has been early trasnfered * to another endpoint. */ ccb = fsmcnf_get_ccb_by_call_id(lcb->call_id); - if ((ccb != NULL) && (ccb->active == TRUE) && + if ((ccb != NULL) && (ccb->active == TRUE) && (ccb->flags & LCL_CNF)) { call_state = evConference; } else { @@ -3737,7 +3702,7 @@ lsm_far_end_alerting (lsm_lcb_t *lcb, cc_state_data_far_end_alerting_t *data) lsm_update_placed_callinfo(dcb); dcb->placed_call_update_required = FALSE; } - + if (status) { ui_set_call_status(status, line, lcb->ui_id); } @@ -3745,7 +3710,7 @@ lsm_far_end_alerting (lsm_lcb_t *lcb, cc_state_data_far_end_alerting_t *data) lsm_ui_call_state(call_state, line, lcb, CC_CAUSE_NORMAL); - } + } /* For roundtable phones, UI will be in dial state, which is different from TNP UI, * TNP UI does not have different dialing layer. In this case offhook dialing screen * does not vanish untill GSM provides procced call status, hence all the softkeys are @@ -3810,7 +3775,7 @@ lsm_answered (lsm_lcb_t *lcb, cc_state_data_answered_t *data) lsm_change_state(lcb, __LINE__, LSM_S_OFFHOOK); - + lsm_internal_update_call_info(lcb, dcb); vcmControlRinger(VCM_RING_OFF, NO, NO, line, dcb->call_id); @@ -3826,7 +3791,7 @@ lsm_answered (lsm_lcb_t *lcb, cc_state_data_answered_t *data) /** * - * Function updates media paths based on the negotated parameters. + * Function updates media paths based on the negotated parameters. * * @param lcb line control block * @param caller_fname caller function name @@ -3848,12 +3813,12 @@ lsm_update_media (lsm_lcb_t *lcb, const char *caller_fname) dcb = lcb->dcb; if (dcb == NULL) { - LSM_ERR_MSG(get_debug_string(DEBUG_INPUT_NULL), + LSM_ERR_MSG(get_debug_string(DEBUG_INPUT_NULL), fname); return; } - addr_str[0] = '\0'; + addr_str[0] = '\0'; /* * Close rx and tx port for media change. Check media direction @@ -3967,7 +3932,7 @@ lsm_call_state_media (lsm_lcb_t *lcb, line_t line, const char *fname) * by the state update. This is important sequence for 7940/60 * SIP to force the BTXML update. */ - // Commenting out original code for CSCsv72370. Leaving here for reference. + // Commenting out original code for CSCsv72370. Leaving here for reference. // lsm_internal_update_call_info(lcb, dcb); lsm_ui_call_state(call_state, line, lcb, CC_CAUSE_NORMAL); @@ -3988,7 +3953,7 @@ lsm_connected (lsm_lcb_t *lcb, cc_state_data_connected_t *data) boolean tone_stop_bool = TRUE; int sdpmode = 0; boolean start_ice = FALSE; - + config_get_value(CFGID_SDPMODE, &sdpmode, sizeof(sdpmode)); dcb = lcb->dcb; @@ -4024,12 +3989,12 @@ lsm_connected (lsm_lcb_t *lcb, cc_state_data_connected_t *data) start_ice = TRUE; lsm_change_state(lcb, __LINE__, LSM_S_CONNECTED); - + if (!sdpmode) { if (tone_stop_bool == TRUE) (void) lsm_stop_tone(lcb, NULL); } - + /* Start ICE */ if (start_ice) { short res = vcmStartIceChecks(dcb->peerconnection); @@ -4037,18 +4002,18 @@ lsm_connected (lsm_lcb_t *lcb, cc_state_data_connected_t *data) if (res) return CC_RC_SUCCESS; } - + /* * Open the RTP receive channel. */ lsm_call_state_media(lcb, line, cc_state_name(CC_STATE_CONNECTED)); - + if (!sdpmode) { vcmEnableSidetone(YES); lsm_set_ringer(lcb, call_id, line, alerting); - } + } FSM_RESET_FLAGS(lcb->flags, LSM_FLAGS_ANSWER_PENDING); FSM_RESET_FLAGS(lcb->flags, LSM_FLAGS_DUSTING); @@ -4147,7 +4112,7 @@ lsm_hold_local (lsm_lcb_t *lcb, cc_state_data_hold_t *data) */ lsm_change_state(lcb, __LINE__, LSM_S_HOLDING); - /* Round table phones need cause for the transfer or conference + /* Round table phones need cause for the transfer or conference Do not set the cause if the conference or transfer is created by remote-cc */ @@ -4187,7 +4152,7 @@ lsm_hold_local (lsm_lcb_t *lcb, cc_state_data_hold_t *data) } vcmActivateWlan(FALSE); - + return (CC_RC_SUCCESS); } @@ -4234,7 +4199,7 @@ lsm_hold_remote (lsm_lcb_t *lcb, cc_state_data_hold_t *data) } /* close tx if media is not inactive or receive only */ if ((media->direction == SDP_DIRECTION_INACTIVE) || - (media->direction == SDP_DIRECTION_RECVONLY)) { + (media->direction == SDP_DIRECTION_RECVONLY)) { lsm_close_tx(lcb, FALSE, media); } } @@ -4413,7 +4378,7 @@ lsm_onhook (lsm_lcb_t *lcb, cc_state_data_onhook_t *data) lsm_free_lcb(lcb); vcmActivateWlan(FALSE); - + vcmRemoveBandwidth(lsm_get_ms_ui_call_handle(line, call_id, CC_NO_CALL_ID)); return (CC_RC_SUCCESS); @@ -4430,15 +4395,15 @@ lsm_call_failed (lsm_lcb_t *lcb, cc_state_data_call_failed_t *data) call_events state; boolean send_call_info = TRUE; fsmdef_dcb_t *dcb; - boolean must_log = FALSE; - + boolean must_log = FALSE; + dcb = lcb->dcb; if (dcb == NULL) { return (CC_RC_ERROR); } /* For busy generated by UI-STATE in 183, do not manipulate the - * media port + * media port */ if (data->cause != CC_CAUSE_UI_STATE_BUSY) { /* hard close receive and transmit channels for all media entries */ @@ -4524,8 +4489,8 @@ lsm_call_failed (lsm_lcb_t *lcb, cc_state_data_call_failed_t *data) */ if ((data->cause != CC_CAUSE_UI_STATE_BUSY) && (data->cause != CC_CAUSE_REMOTE_DISCONN_REQ_PLAYTONE)) { fsmdef_media_t *audio_media = gsmsdp_find_audio_media(dcb); - - lsm_util_start_tone(tone, FALSE, lsm_get_ms_ui_call_handle(line, call_id, CC_NO_CALL_ID), dcb->group_id, + + lsm_util_start_tone(tone, FALSE, lsm_get_ms_ui_call_handle(line, call_id, CC_NO_CALL_ID), dcb->group_id, ((audio_media != NULL) ? audio_media->refid : CC_NO_MEDIA_REF_ID), VCM_PLAY_TONE_TO_EAR); @@ -4545,7 +4510,7 @@ lsm_ringer (lsm_lcb_t *lcb, cc_action_data_ringer_t *data) LSM_DEBUG(DEB_F_PREFIX"CTI RING SETTING: line = %d, ringer Mode = %s," "Ring once = NO, alertInfo = NO\n", DEB_F_PREFIX_ARGS(LSM, "lsm_ringer"), line, vm_alert_names[ringer]); - + vcmControlRinger(ringer, NO, NO, line, lcb->call_id); } @@ -4652,7 +4617,7 @@ lsm_update_ui (lsm_lcb_t *lcb, cc_action_data_update_ui_t *data) /* For local conference, do not update the primary * call bubbles call-info. Primary call is already * displaying To conference in this case - * But dcb-> caller_id should be updated to + * But dcb-> caller_id should be updated to * refresh the UI when the call is dropped */ ccb = fsmcnf_get_ccb_by_call_id(call_id); @@ -4684,10 +4649,10 @@ lsm_update_ui (lsm_lcb_t *lcb, cc_action_data_update_ui_t *data) * of a 3-way conf, and phone is the last party to receive the call, is ringing * and then be joined into a conference, direction would be outbound. The display * would say "To Conference". - */ + */ if ( (instance_state == LSM_S_RINGIN) && inbound ) { cc_state_data_alerting_t alerting_data; - + alerting_data.caller_id = dcb->caller_id; lsm_update_inalert_status(line, lcb->ui_id, &alerting_data, TRUE); } @@ -4701,8 +4666,8 @@ lsm_update_ui (lsm_lcb_t *lcb, cc_action_data_update_ui_t *data) update = TRUE; } - if (call_info->feature_flag & CC_POLICY) { - update = TRUE; + if (call_info->feature_flag & CC_POLICY) { + update = TRUE; } /* @@ -4863,20 +4828,20 @@ lsm_update_ui (lsm_lcb_t *lcb, cc_action_data_update_ui_t *data) break; - + default: break; } if (call_state != evMaxEvent) { - original_call_event = lcb->previous_call_event; + original_call_event = lcb->previous_call_event; lsm_ui_call_state(call_state, line, lcb, CC_CAUSE_NORMAL); if (original_call_event != call_state) { /* Call state changed, take care of special event */ - switch (call_state) { + switch (call_state) { case evConference: - break; + break; case evConnected: case evWhisper: @@ -4956,7 +4921,7 @@ lsm_update_placed_callinfo (void *data) } else { char tmp_str[STATUS_LINE_MAX_LEN]; platGetPhraseText(STR_INDEX_ANONYMOUS_SPACE, (char *)tmp_str, STATUS_LINE_MAX_LEN - 1); - if(strcmp(dcb->caller_id.called_number,tmp_str) == 0 + if(strcmp(dcb->caller_id.called_number,tmp_str) == 0 && strcmp(dcb->caller_id.orig_rpid_number, tmp_called_number) == 0 && strcmp(dcb->caller_id.called_name, platform_get_phrase_index_str(UI_UNKNOWN)) != 0) { called_name = dcb->caller_id.called_name; @@ -5040,7 +5005,7 @@ lsm_init (void) TIMER_EXPIRATION, gsm_msg_queue); lsm_init_config(); - for (i=0 ; istop_media.media_refid == CC_NO_MEDIA_REF_ID)) { /* no data provided or no specific ref ID, defaul to all entries */ lsm_close_rx(lcb, FALSE, NULL); @@ -5287,7 +5252,7 @@ lsm_stop_media (lsm_lcb_t *lcb, callid_t call_id, line_t line, } else { /* no entry found */ LSM_DEBUG(DEB_L_C_F_PREFIX"no media with reference ID %d found\n", - DEB_L_C_F_PREFIX_ARGS(LSM, dcb->line, dcb->call_id, fname), + DEB_L_C_F_PREFIX_ARGS(LSM, dcb->line, dcb->call_id, fname), data->stop_media.media_refid); return; } @@ -5429,15 +5394,15 @@ cc_call_non_call_action (callid_t call_id, line_t line, * * @return cc_rcs_t status. * - * @pre line not_eqs CC_NO_LINE - * @pre ((action equals CC_ACTION_PLAY_TONE) or + * @pre line not_eqs CC_NO_LINE + * @pre ((action equals CC_ACTION_PLAY_TONE) or * (action equals CC_ACTION_STOP_TONE) or * (action equals CC_ACTION_DIAL_MODE) or * (action equals CC_ACTION_MWI) or * (action equals CC_ACTION_OPEN_RCV) or * (action equals CC_ACTION_UPDATE_UI) or - * (action equals CC_ACTION_RINGER)) - */ + * (action equals CC_ACTION_RINGER)) + */ cc_rcs_t cc_call_action (callid_t call_id, line_t line, cc_actions_t action, cc_action_data_t *data) @@ -5514,7 +5479,7 @@ cc_call_action (callid_t call_id, line_t line, cc_actions_t action, result = lsm_update_ui(lcb, &(data->update_ui)); } else { result = CC_RC_ERROR; - } + } break; case CC_ACTION_MEDIA: @@ -5532,8 +5497,8 @@ cc_call_action (callid_t call_id, line_t line, cc_actions_t action, break; case CC_ACTION_START_RCV: - /* start receiving */ - dcb = lcb->dcb; + /* start receiving */ + dcb = lcb->dcb; if (dcb == NULL) { /* No call ID */ result = CC_RC_ERROR; @@ -5601,7 +5566,7 @@ lsm_ui_display_status (const char *status_str, line_t line, callid_t call_id) * This function will display notification status line. * * @param[in] str_index - index into phrase dictionary - * + * * @return none */ void lsm_ui_display_notify_str_index (int str_index) @@ -5688,7 +5653,7 @@ lsm_update_active_tone (vcm_tones_t tone, callid_t call_id) */ if (dcb->active_tone != VCM_NO_TONE) { LSM_DEBUG(DEB_L_C_F_PREFIX"Active Tone current = %d new = %d\n", - DEB_L_C_F_PREFIX_ARGS(LSM, dcb->line, call_id, fname), + DEB_L_C_F_PREFIX_ARGS(LSM, dcb->line, call_id, fname), dcb->active_tone, tone); } dcb->active_tone = tone; @@ -5727,7 +5692,7 @@ lsm_is_tx_channel_opened(callid_t call_id) */ GSMSDP_FOR_ALL_MEDIA(media, dcb_p) { if (media->type == SDP_MEDIA_AUDIO) { - /* found a match */ + /* found a match */ if (media->xmit_chan) return (TRUE); } @@ -5781,7 +5746,7 @@ lsm_update_monrec_tone_action (vcm_tones_t tone, callid_t call_id, uint16_t dire case FSMDEF_MRTONE_RESUME_MONITOR_TONE: case FSMDEF_MRTONE_RESUME_BOTH_TONES: default: - DEF_DEBUG(DEB_F_PREFIX"Invalid action request... tone:%d monrec_tone_action:%d \n", + DEF_DEBUG(DEB_F_PREFIX"Invalid action request... tone:%d monrec_tone_action:%d \n", DEB_F_PREFIX_ARGS("RCC", fname), tone, dcb->monrec_tone_action); break; } @@ -5811,7 +5776,7 @@ lsm_update_monrec_tone_action (vcm_tones_t tone, callid_t call_id, uint16_t dire case FSMDEF_MRTONE_RESUME_RECORDER_TONE: case FSMDEF_MRTONE_RESUME_BOTH_TONES: default: - DEF_DEBUG(DEB_F_PREFIX"Invalid action request... tone:%d monrec_tone_action:%d \n", + DEF_DEBUG(DEB_F_PREFIX"Invalid action request... tone:%d monrec_tone_action:%d \n", DEB_F_PREFIX_ARGS("RCC", fname), tone, dcb->monrec_tone_action); break; } @@ -5823,7 +5788,7 @@ lsm_update_monrec_tone_action (vcm_tones_t tone, callid_t call_id, uint16_t dire } /* end of switch */ LSM_DEBUG(DEB_L_C_F_PREFIX"Start request for tone: %d. Set monrec_tone_action: %d\n", - DEB_L_C_F_PREFIX_ARGS(LSM, dcb->line, call_id, fname), + DEB_L_C_F_PREFIX_ARGS(LSM, dcb->line, call_id, fname), tone, dcb->monrec_tone_action); } /* end of if */ @@ -5850,7 +5815,7 @@ lsm_downgrade_monrec_tone_action (vcm_tones_t tone, callid_t call_id) dcb = fsmdef_get_dcb_by_call_id(call_id); /* Need to downgrade the monrec_tone_action */ - + if (dcb != NULL) { switch (tone){ case VCM_MONITORWARNING_TONE: @@ -5872,7 +5837,7 @@ lsm_downgrade_monrec_tone_action (vcm_tones_t tone, callid_t call_id) case FSMDEF_MRTONE_PLAYED_RECORDER_TONE: case FSMDEF_MRTONE_RESUME_RECORDER_TONE: default: - DEF_DEBUG(DEB_F_PREFIX"Invalid action request... tone:%d monrec_tone_action:%d \n", + DEF_DEBUG(DEB_F_PREFIX"Invalid action request... tone:%d monrec_tone_action:%d \n", DEB_F_PREFIX_ARGS("RCC", fname), tone, dcb->monrec_tone_action); break; } @@ -5898,7 +5863,7 @@ lsm_downgrade_monrec_tone_action (vcm_tones_t tone, callid_t call_id) case FSMDEF_MRTONE_PLAYED_MONITOR_TONE: case FSMDEF_MRTONE_RESUME_MONITOR_TONE: default: - DEF_DEBUG(DEB_F_PREFIX"Invalid action request... tone:%d monrec_tone_action:%d \n", + DEF_DEBUG(DEB_F_PREFIX"Invalid action request... tone:%d monrec_tone_action:%d \n", DEB_F_PREFIX_ARGS("RCC", fname), tone, dcb->monrec_tone_action); break; } @@ -5910,7 +5875,7 @@ lsm_downgrade_monrec_tone_action (vcm_tones_t tone, callid_t call_id) } /* end of switch */ LSM_DEBUG(DEB_L_C_F_PREFIX"Stop request for tone: %d Downgrade monrec_tone_action: %d \n", - DEB_L_C_F_PREFIX_ARGS(LSM, dcb->line, call_id, fname), + DEB_L_C_F_PREFIX_ARGS(LSM, dcb->line, call_id, fname), tone, dcb->monrec_tone_action); } /* end of if */ } @@ -6005,7 +5970,7 @@ lsm_update_inalert_status (line_t line, callid_t call_id, sstrncpy(disp_str, platform_get_phrase_index_str(UI_FROM), sizeof(disp_str)); - LSM_DEBUG(DEB_L_C_F_PREFIX"+++ calling number = %s\n", + LSM_DEBUG(DEB_L_C_F_PREFIX"+++ calling number = %s\n", DEB_L_C_F_PREFIX_ARGS(LSM, line, call_id, fname), data->caller_id.calling_number); @@ -6028,8 +5993,8 @@ lsm_update_inalert_status (line_t line, callid_t call_id, // notification has higher priority than call status (e.g. connected). // This is done to have parity with SCCP phone behavior. if (notify == TRUE) { - ui_set_notification(line, call_id, - (char *)disp_str, (unsigned long)CALL_ALERT_TIMEOUT, + ui_set_notification(line, call_id, + (char *)disp_str, (unsigned long)CALL_ALERT_TIMEOUT, FALSE, FROM_NOTIFY_PRI); } // After the notification we wish to set the call status to From XXXX. Same as SCCP phone behavior @@ -6298,7 +6263,7 @@ lsm_get_ui_id (callid_t call_id) * lsm_get_ms_ui_id * * Description: - * The function gets the UI id from LSM's LCB for a given GSM call ID. During + * The function gets the UI id from LSM's LCB for a given GSM call ID. During * certain features like barge ui_id is set to CC_NO_CALL_ID. * * Parameters: @@ -6311,18 +6276,18 @@ cc_call_handle_t lsm_get_ms_ui_call_handle (line_t line, callid_t call_id, callid_t ui_id) { callid_t lsm_ui_id; - + if (ui_id != CC_NO_CALL_ID) { return CREATE_CALL_HANDLE(line, ui_id); } /* If ui_id present use that */ lsm_ui_id = lsm_get_ui_id(call_id); - + if (lsm_ui_id != CC_NO_CALL_ID) { return CREATE_CALL_HANDLE(line, lsm_ui_id); } - + return CREATE_CALL_HANDLE(line, call_id); } /* @@ -6385,7 +6350,7 @@ void lsm_update_video_avail (line_t line, callid_t call_id, int dir) ui_update_video_avail (line, lcb->ui_id, dir); - + lsm_update_dscp_value(dcb); } } @@ -6588,7 +6553,7 @@ static void lsm_util_start_tone(vcm_tones_t tone, short alert_info, * Update dcb->active_tone if start request * is for an infinite duration tone. */ - lsm_update_active_tone(tone, call_id); + lsm_update_active_tone(tone, call_id); } /* @@ -6615,7 +6580,7 @@ lsm_util_tone_start_with_speaker_as_backup (vcm_tones_t tone, short alert_info, //vcmToneStart vcmToneStart(tone, alert_info, call_handle, group_id, stream_id, direction); - + /* * Set delay value for multi-part tones and repeated tones. * Currently the only multi-part tones are stutter and message @@ -6641,6 +6606,6 @@ lsm_util_tone_start_with_speaker_as_backup (vcm_tones_t tone, short alert_info, * Update dcb->active_tone if start request * is for an infinite duration tone. */ - lsm_update_active_tone(tone, call_id); + lsm_update_active_tone(tone, call_id); } diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/media_cap_tbl.c b/media/webrtc/signaling/src/sipcc/core/gsm/media_cap_tbl.c index 567498308362..aeb6df31ab3d 100644 --- a/media/webrtc/signaling/src/sipcc/core/gsm/media_cap_tbl.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/media_cap_tbl.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include "ccapi.h" @@ -72,7 +37,7 @@ void escalateDeescalate() { if ( ccapp_get_state() != CC_INSERVICE ) { VCM_DEBUG(MED_F_PREFIX"Ignoring video cap update\n", "escalateDeescalate"); return; - } + } //post the event cc_int_feature(CC_SRC_UI, CC_SRC_GSM, CC_NO_CALL_ID, @@ -84,7 +49,7 @@ cc_boolean cc_media_isTxCapEnabled() { } cc_boolean cc_media_isVideoCapEnabled() { - if ( g_nativeVidSupported ) { + if ( g_nativeVidSupported ) { return g_vidCapEnabled; } return FALSE; @@ -93,7 +58,7 @@ cc_boolean cc_media_isVideoCapEnabled() { /** * API to update the local video cap in the table * called when native video support or vidCap cfg changes - * + * * This method looks at video cap in cfg & native vid support on platform */ static void updateVidCapTbl(){ @@ -101,10 +66,10 @@ static void updateVidCapTbl(){ if ( g_vidCapEnabled ) { if ( g_media_table.cap[CC_VIDEO_1].enabled == FALSE ) { // cfg is enabled but cap tbl is not - if ( g_nativeVidSupported ) { + if ( g_nativeVidSupported ) { // we can do native now enable cap g_media_table.cap[CC_VIDEO_1].enabled = TRUE; - g_media_table.cap[CC_VIDEO_1].support_direction = + g_media_table.cap[CC_VIDEO_1].support_direction = g_natve_txCap_enabled?SDP_DIRECTION_SENDRECV:SDP_DIRECTION_RECVONLY; if ( g_natve_txCap_enabled == FALSE ) { @@ -138,13 +103,13 @@ void cc_media_update_native_video_support(boolean val) { /** * - * API to update video capability on the device based on config + * API to update video capability on the device based on config */ void cc_media_update_video_cap(boolean val) { DEF_DEBUG(MED_F_PREFIX"Setting video cap val=%d\n", "cc_media_update_video_cap", val); g_vidCapEnabled = val; updateVidCapTbl(); - if ( g_nativeVidSupported ) { + if ( g_nativeVidSupported ) { ccsnap_gen_deviceEvent(CCAPI_DEVICE_EV_VIDEO_CAP_ADMIN_CONFIG_CHANGED, CC_DEVICE_ID); } } @@ -174,10 +139,10 @@ void cc_media_update_native_video_txcap(boolean enable) { } - g_media_table.cap[CC_VIDEO_1].support_direction = + g_media_table.cap[CC_VIDEO_1].support_direction = g_natve_txCap_enabled?SDP_DIRECTION_SENDRECV:SDP_DIRECTION_RECVONLY; - escalateDeescalate(); + escalateDeescalate(); } } diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/sm.c b/media/webrtc/signaling/src/sipcc/core/gsm/sm.c index fde86703517b..80ba7a2f58b4 100755 --- a/media/webrtc/signaling/src/sipcc/core/gsm/sm.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/sm.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_stdio.h" #include "sm.h" @@ -68,7 +33,7 @@ sm_process_event (sm_table_t *tbl, sm_event_t *event) (event_id < tbl->max_event)) { rc = SM_RC_DEF_CONT; /* - * Save some paramters for debuging, the event handler may + * Save some paramters for debuging, the event handler may * free the fcb once returned. */ fsm_type = fcb->fsm_type; diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/subapi.c b/media/webrtc/signaling/src/sipcc/core/gsm/subapi.c index 7885928f7a76..1dee58fa1e4e 100755 --- a/media/webrtc/signaling/src/sipcc/core/gsm/subapi.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/subapi.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdio.h" diff --git a/media/webrtc/signaling/src/sipcc/core/includes/ccSession.h b/media/webrtc/signaling/src/sipcc/core/includes/ccSession.h index c2640523286c..398f4976a325 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/ccSession.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/ccSession.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSESSION_H_ #define _CCSESSION_H_ @@ -48,26 +13,26 @@ #define GET_SESS_TYPE(x) ( (x & 0xF0000000) >> SID_TYPE_SHIFT ) #define GET_LINEID(x) (line_t)( (x & 0xFFF0000) >> SID_LINE_SHIFT ) -#define GET_CALLID(x) (callid_t)(x & 0xFFFF) +#define GET_CALLID(x) (callid_t)(x & 0xFFFF) -/** +/** * ccSessionProviderCmd - * CallControl Provider Management Interface + * CallControl Provider Management Interface * Called by Application to issue cmds to sipStack - * + * * @param data - command and data * data->cmd - see Session Provider Commands in session.h - * data->cmdData.ccData.reason - reason for SHUTDOWN/UNREGISTER_ALL_LINES CMD + * data->cmdData.ccData.reason - reason for SHUTDOWN/UNREGISTER_ALL_LINES CMD CC_CAUSE_NORMAL/CC_CAUSE_NONE * data->cmdData.ccData.reason_info - Descriptive stringa "notused" - * + * * @return none * */ -void ccSessionProviderCmd(sessionProvider_cmd_t *data); +void ccSessionProviderCmd(sessionProvider_cmd_t *data); /** @@ -75,14 +40,14 @@ void ccSessionProviderCmd(sessionProvider_cmd_t *data); * Method to report provider state updates to Application * * @param state - indicates the Session Provider state CCApp_states_t - * @param data - ccProvider_state_t indicating + * @param data - ccProvider_state_t indicating * data->stateData.ccData.mode - REGMODE CCM * data->stateData.ccData.cause - FAILOVER/FALLBACK - * + * * @return none * */ -void ccSessionProviderState(unsigned int state, ccProvider_state_t *data); +void ccSessionProviderState(unsigned int state, ccProvider_state_t *data); /** @@ -90,7 +55,7 @@ void ccSessionProviderState(unsigned int state, ccProvider_state_t *data); * Method to Handle session lifecycle command such as realize, start etc. * * @param sCmd - session liefcycle command - * sCmd->cmd - REQUEST CMD + * sCmd->cmd - REQUEST CMD * sCmd->sessID - session ID * * @return none @@ -102,7 +67,7 @@ void ccSessionCmd (sessionCmd_t *sCmd); /** * ccCreateSession - * + * * Called by Application to create a new session * * @param param - uri_t @@ -118,7 +83,7 @@ session_id_t ccCreateSession(uri_t *param); * Called by Application to close a session * * @param sess_id - ID of the session to be closed - * + * * @return 0 success -1 failure * */ @@ -133,7 +98,7 @@ int ccCloseSession(session_id_t sess_id); * Called by Application to invoke feature on session * * @param featData - featID and Additional info if needed for the feature - * + * * @return none * */ @@ -187,9 +152,9 @@ void ccFeatureUpdate(feature_update_t *session); /***** Internal APIs below this line ***************/ /** - * ccCreateSession + * ccCreateSession * - * Called to create a CC session + * Called to create a CC session * * @param param - ccSession_create_param_t * Contains the type of session and specific data @@ -218,7 +183,7 @@ char * getStrProperty(unsigned int id); /* Preserved API's from TNP Platform */ char *ccSetDP(const char *dp_file_name); // update_label_n_speed_dial method here -void setPropertyCacheBoolean(int cfg_id, int bool_value); +void setPropertyCacheBoolean(int cfg_id, int bool_value); void setPropertyCacheInteger(int cfg_id, int int_value); void setPropertyCacheString(int cfg_id, const char *string_value); void setPropertyCacheByte(int cfg_id, char byte_value); diff --git a/media/webrtc/signaling/src/sipcc/core/includes/ccapi.h b/media/webrtc/signaling/src/sipcc/core/includes/ccapi.h index f94f9f323e1f..cb48e028ac5a 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/ccapi.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/ccapi.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCAPI_H_ #define _CCAPI_H_ @@ -264,10 +229,10 @@ typedef enum cc_msgs_t_ { CC_MSG_DIALSTRING, CC_MSG_MWI, CC_MSG_AUDIT, - CC_MSG_CREATEOFFER, + CC_MSG_CREATEOFFER, CC_MSG_CREATEANSWER, CC_MSG_SETLOCALDESC, - CC_MSG_SETREMOTEDESC, + CC_MSG_SETREMOTEDESC, CC_MSG_REMOTEDESC, CC_MSG_LOCALDESC, CC_MSG_SETPEERCONNECTION, @@ -313,7 +278,7 @@ static const char *cc_msg_names[] = { "LOCALDESC", "SETPEERCONNECTION", "ADDSTREAM", - "REMOVESTREAM", + "REMOVESTREAM", "ADDCANDIDATE", "AUDIT_ACK", "OPTIONS", @@ -1212,29 +1177,29 @@ void cc_int_feature2(cc_msgs_t msg_id, cc_srcs_t src_id, cc_srcs_t dst_id, void cc_createoffer(cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t line, cc_features_t feature_id, cc_feature_data_t *data); - + void cc_createanswer (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t line, cc_features_t feature_id, string_t sdp, cc_feature_data_t *data); -void cc_setlocaldesc (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t line, +void cc_setlocaldesc (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t line, cc_features_t feature_id, cc_jsep_action_t action, string_t sdp, cc_feature_data_t *data); -void cc_setremotedesc (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t line, +void cc_setremotedesc (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t line, cc_features_t feature_id, cc_jsep_action_t action, string_t sdp, cc_feature_data_t *data); -void cc_localdesc (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t line, +void cc_localdesc (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t line, cc_features_t feature_id, cc_feature_data_t *data); -void cc_remotedesc (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t line, +void cc_remotedesc (cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t line, cc_features_t feature_id, cc_feature_data_t *data); - + void cc_int_feature_ack(cc_srcs_t src_id, cc_srcs_t dst_id, callid_t call_id, line_t line, cc_features_t feature_id, cc_feature_data_t *data, cc_causes_t cause); void cc_int_offhook(cc_srcs_t src_id, cc_srcs_t dst_id, callid_t prim_call_id, cc_hold_resume_reason_e consult_reason, callid_t call_id, - line_t line, char *global_call_id, + line_t line, char *global_call_id, monitor_mode_t monitor_mode, cfwdall_mode_t cfwdall_mode); diff --git a/media/webrtc/signaling/src/sipcc/core/includes/check_sync.h b/media/webrtc/signaling/src/sipcc/core/includes/check_sync.h index 19442e5ae1c7..c5dd8051df89 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/check_sync.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/check_sync.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef CHECK_SYNC_H #define CHECK_SYNC_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/ci.h b/media/webrtc/signaling/src/sipcc/core/includes/ci.h index 139f6bdac244..e5d014cf4a0c 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/ci.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/ci.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CI_INCLUDED_H #define _CI_INCLUDED_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/config.h b/media/webrtc/signaling/src/sipcc/core/includes/config.h index 824ca1fc366d..9dc31b9630e8 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/config.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/config.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CONFIG_H_ #define _CONFIG_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/includes/configapp.h b/media/webrtc/signaling/src/sipcc/core/includes/configapp.h index bed878b4a8d6..fae40922e514 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/configapp.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/configapp.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef CONFIGAPP_H #define CONFIGAPP_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/configmgr.h b/media/webrtc/signaling/src/sipcc/core/includes/configmgr.h index b8ef17a7895c..3c0b4bee8aaa 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/configmgr.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/configmgr.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CONFIGMGR_H_ #define _CONFIGMGR_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/includes/debug.h b/media/webrtc/signaling/src/sipcc/core/includes/debug.h index a1556a3b6d52..b9197c8eb195 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/debug.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/debug.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _DEBUG_INCLUDED_H /* allows multiple inclusion */ #define _DEBUG_INCLUDED_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/dialplan.h b/media/webrtc/signaling/src/sipcc/core/includes/dialplan.h index 489c88fc147a..ec1f93e61010 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/dialplan.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/dialplan.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef DIALPLAN_H #define DIALPLAN_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/dialplanint.h b/media/webrtc/signaling/src/sipcc/core/includes/dialplanint.h index e155f92da60f..bb0c4047fbe6 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/dialplanint.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/dialplanint.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef DIALPLANINT_H #define DIALPLANINT_H @@ -105,7 +70,7 @@ void dp_int_update_key_string(line_t line, callid_t call_id, char *digits); void dp_int_store_digit_string(line_t line, callid_t call_id, char *digit_str); void dp_int_update_keypress(line_t line, callid_t call_id, unsigned char digit); void dp_int_dial_immediate(line_t line, callid_t call_id, boolean collect_more, - char *digit_str, char *g_call_id, + char *digit_str, char *g_call_id, monitor_mode_t monitor_mode); void dp_int_do_redial(line_t line, callid_t call_id); void dp_int_onhook(line_t line, callid_t call_id); diff --git a/media/webrtc/signaling/src/sipcc/core/includes/digcalc.h b/media/webrtc/signaling/src/sipcc/core/includes/digcalc.h index d71c0532f6e2..3665f9f922da 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/digcalc.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/digcalc.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _DIGCALC_H_ #define _DIGCALC_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/includes/dns_utils.h b/media/webrtc/signaling/src/sipcc/core/includes/dns_utils.h index 938a45f2d288..51683bdf4152 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/dns_utils.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/dns_utils.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _DNS_UTILS_INCLUDED_H #define _DNS_UTILS_INCLUDED_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/dtmf.h b/media/webrtc/signaling/src/sipcc/core/includes/dtmf.h index 1e4b004df21b..906bce88ed79 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/dtmf.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/dtmf.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _DTMF_H_ #define _DTMF_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/includes/embedded.h b/media/webrtc/signaling/src/sipcc/core/includes/embedded.h index bb9e0560199f..68a076b72c09 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/embedded.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/embedded.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef embedded_hpp #define embedded_hpp diff --git a/media/webrtc/signaling/src/sipcc/core/includes/intelpentiumtypes.h b/media/webrtc/signaling/src/sipcc/core/includes/intelpentiumtypes.h index e5e1bce303f1..8e9955fadbfb 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/intelpentiumtypes.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/intelpentiumtypes.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef IntelPentium_hpp #define IntelPentium_hpp diff --git a/media/webrtc/signaling/src/sipcc/core/includes/kpml_common_util.h b/media/webrtc/signaling/src/sipcc/core/includes/kpml_common_util.h index 33e3e4c949ed..62381124328d 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/kpml_common_util.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/kpml_common_util.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef __KPML_COMMON_UTIL_H__ #define __KPML_COMMON_UTIL_H__ diff --git a/media/webrtc/signaling/src/sipcc/core/includes/kpmlmap.h b/media/webrtc/signaling/src/sipcc/core/includes/kpmlmap.h index b6f1c924e603..568895cbc377 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/kpmlmap.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/kpmlmap.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef KPMLMAP_H #define KPMLMAP_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/md5.h b/media/webrtc/signaling/src/sipcc/core/includes/md5.h index 0f79d2ff2637..9a7381c12f3a 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/md5.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/md5.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All * rights reserved. diff --git a/media/webrtc/signaling/src/sipcc/core/includes/memory.h b/media/webrtc/signaling/src/sipcc/core/includes/memory.h index c4aa8f851349..4a0fc35cef83 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/memory.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/memory.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _MEMORY_H_ #define _MEMORY_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/includes/misc_apps_task.h b/media/webrtc/signaling/src/sipcc/core/includes/misc_apps_task.h index 5ea6f5454a93..baa5214d93cd 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/misc_apps_task.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/misc_apps_task.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef MISC_APP_TASK_H #define MISC_APP_TASK_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/misc_util.h b/media/webrtc/signaling/src/sipcc/core/includes/misc_util.h index 415efacacf9c..fcd2e90f9f74 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/misc_util.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/misc_util.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef __MISC_UTIL_H__ #define __MISC_UTIL_H__ diff --git a/media/webrtc/signaling/src/sipcc/core/includes/phntask.h b/media/webrtc/signaling/src/sipcc/core/includes/phntask.h index 68e3a006eef5..24b5fceedbb5 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/phntask.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/phntask.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef PHNTASK_H #define PHNTASK_H @@ -313,12 +278,12 @@ enum { #define NICE_STEP -4 #define TIMER_THREAD_RELATIVE_PRIORITY 4*(NICE_STEP) /* -16 */ -/* redid priorities to adjust relative priority with EDT cannot +/* redid priorities to adjust relative priority with EDT cannot use NICE_STEP so using absolute numbers here */ -#define GSM_THREAD_RELATIVE_PRIORITY -14 -#define SIP_THREAD_RELATIVE_PRIORITY -14 -#define APP_THREAD_RELATIVE_PRIORITY -14 -#define CCPROVIDER_THREAD_RELATIVE_PRIORITY -14 +#define GSM_THREAD_RELATIVE_PRIORITY -14 +#define SIP_THREAD_RELATIVE_PRIORITY -14 +#define APP_THREAD_RELATIVE_PRIORITY -14 +#define CCPROVIDER_THREAD_RELATIVE_PRIORITY -14 #elif defined SIP_OS_OSX diff --git a/media/webrtc/signaling/src/sipcc/core/includes/phone.h b/media/webrtc/signaling/src/sipcc/core/includes/phone.h index bf6382efcc9e..62fa07d75d37 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/phone.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/phone.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef PHONE_H #define PHONE_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/phone_debug.h b/media/webrtc/signaling/src/sipcc/core/includes/phone_debug.h index d9dba0cf3ba9..ce8f7ed3c589 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/phone_debug.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/phone_debug.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _PHONE_DEBUG_H_ #define _PHONE_DEBUG_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/includes/phone_platform_constants.h b/media/webrtc/signaling/src/sipcc/core/includes/phone_platform_constants.h index 3b95634049c2..1c0aa6087a80 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/phone_platform_constants.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/phone_platform_constants.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _PHONE_PLATFORM_CONSTANTS_H_ #define _PHONE_PLATFORM_CONSTANTS_H_ @@ -169,7 +134,7 @@ // SOUNDWAVE #define PHONE_MODEL_NUMBER_SOUNDWAVE "575" -#define SOUNDWAVE_MODEL "SOUNDWAVE" +#define SOUNDWAVE_MODEL "SOUNDWAVE" #define CCSIP_SIP_SOUNDWAVE_USER_AGENT "SOUNDWAVE" @@ -207,7 +172,7 @@ #define RTLITE_MODEL_6945 "CP-6945" #define CCSIP_SIP_6945_USER_AGENT "CP6945" -//Definition for 6961 +//Definition for 6961 #define PHONE_MODEL_NUMBER_6961 "497" #define RTLITE_MODEL_6961 "CP-6961" #define CCSIP_SIP_6961_USER_AGENT "CP6961" @@ -232,7 +197,7 @@ /* * MAX_INSTANCES (call_instances) should equal to maximum number of calls - * allowed by the phone but MAX_CALLS is defined to be 1 more than the + * allowed by the phone but MAX_CALLS is defined to be 1 more than the * actual maximum capacity. Therefore define MAX_INSTANCES to MAX_CALLS -1 */ #define MAX_INSTANCES (MAX_CALLS - 1) /* max number of instance ID */ diff --git a/media/webrtc/signaling/src/sipcc/core/includes/phone_types.h b/media/webrtc/signaling/src/sipcc/core/includes/phone_types.h index d31f7082a49d..0b4f11f2f89a 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/phone_types.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/phone_types.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _PHONE_TYPES_H_ #define _PHONE_TYPES_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/includes/platform_api.h b/media/webrtc/signaling/src/sipcc/core/includes/platform_api.h index 6d8d4b21a28b..f791e6743ca1 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/platform_api.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/platform_api.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _PLATFORM_API_H_ #define _PLATFORM_API_H_ @@ -54,9 +19,9 @@ void platform_apply_config (char * configVersionStamp, char * dialplanVersionSta /** * Set ip address mode - * e.g. + * e.g. */ -cpr_ip_mode_e platGetIpAddressMode(); +cpr_ip_mode_e platGetIpAddressMode(); /** * @brief Given a msg buffer, returns a pointer to the buffer's header diff --git a/media/webrtc/signaling/src/sipcc/core/includes/pres_sub_not_handler.h b/media/webrtc/signaling/src/sipcc/core/includes/pres_sub_not_handler.h index 521d6fcf4b09..bc021a77632a 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/pres_sub_not_handler.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/pres_sub_not_handler.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef PRES_SUB_NOT_HANDLER_H #define PRES_SUB_NOT_HANDLER_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/publish_int.h b/media/webrtc/signaling/src/sipcc/core/includes/publish_int.h index 5a8c1a273994..c76b6660009f 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/publish_int.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/publish_int.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef PUBLISH_INT_H #define PUBLISH_INT_H @@ -45,7 +10,7 @@ #include "ccsip_callinfo.h" -typedef uint32_t pub_handle_t; +typedef uint32_t pub_handle_t; #define NULL_PUBLISH_HANDLE 0 /* this is to indicate that handle is not assigned yet */ @@ -67,7 +32,7 @@ typedef struct { pub_handle_t app_handle; // handle assigned by the Application } pub_rsp_t; -extern +extern void publish_init(pub_handle_t app_handle, char *ruri, char *esc, @@ -75,7 +40,7 @@ void publish_init(pub_handle_t app_handle, cc_subscriptions_t event_type, ccsip_event_data_t *event_data_p, cc_srcs_t callback_task, - int message_id + int message_id ); extern diff --git a/media/webrtc/signaling/src/sipcc/core/includes/rcc_int_types.h b/media/webrtc/signaling/src/sipcc/core/includes/rcc_int_types.h index effb356aac67..b55e00e6f025 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/rcc_int_types.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/rcc_int_types.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _RCC_INT_TYPES_H_ #define _RCC_INT_TYPES_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/includes/regexp.h b/media/webrtc/signaling/src/sipcc/core/includes/regexp.h index d61cdae735fa..99fb19b3df57 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/regexp.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/regexp.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef __REGEXP_H__ #define __REGEXP_H__ diff --git a/media/webrtc/signaling/src/sipcc/core/includes/ringlist.h b/media/webrtc/signaling/src/sipcc/core/includes/ringlist.h index 3bba3d858ea0..71ac3bddc809 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/ringlist.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/ringlist.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef RINGLIST_H #define RINGLIST_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/rtp_defs.h b/media/webrtc/signaling/src/sipcc/core/includes/rtp_defs.h index 19842d03ed78..b12f5fe9b653 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/rtp_defs.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/rtp_defs.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef RTP_DEFS_H #define RTP_DEFS_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/scSession.h b/media/webrtc/signaling/src/sipcc/core/includes/scSession.h index 7f3ccad68f98..0525d1928b1d 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/scSession.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/scSession.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "string_lib.h" #include "sessionConstants.h" diff --git a/media/webrtc/signaling/src/sipcc/core/includes/session.h b/media/webrtc/signaling/src/sipcc/core/includes/session.h index 9b3de20bff2c..2b2390a262e8 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/session.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/session.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _SESSION_H_ #define _SESSION_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/includes/sessionConstants.h b/media/webrtc/signaling/src/sipcc/core/includes/sessionConstants.h index c27bf5aa336a..a094c3d8672a 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/sessionConstants.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/sessionConstants.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _SESSION_CONSTANTS_H_ #define _SESSION_CONSTANTS_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/includes/sessionTypes.h b/media/webrtc/signaling/src/sipcc/core/includes/sessionTypes.h index 3ae932756f25..b58a59fd5ede 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/sessionTypes.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/sessionTypes.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _SESSIONTYPES_H_ #define _SESSIONTYPES_H_ @@ -128,14 +93,14 @@ typedef struct { typedef struct { cc_boolean start; - vcm_ring_mode_t mode; + vcm_ring_mode_t mode; cc_boolean once; } cc_ringer_state_t; /** * Define call status to carry over timeout/priority that might be sent from CUCM. - * Note: if the values of timeout and priority are zero, then 2 second is the - * derfault value for the timeout. It's mostly the application based on UI + * Note: if the values of timeout and priority are zero, then 2 second is the + * derfault value for the timeout. It's mostly the application based on UI * design. */ typedef struct { diff --git a/media/webrtc/signaling/src/sipcc/core/includes/sessuri.h b/media/webrtc/signaling/src/sipcc/core/includes/sessuri.h index 76bfc0c0cbbe..8c5ffbf55a58 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/sessuri.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/sessuri.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _SESSURI_H_ #define _SESSURI_H_ @@ -69,7 +34,7 @@ typedef enum { /** * parameter tags/names - * + * */ #define LINE_TAG "line" @@ -192,13 +157,13 @@ typedef union params { typedef struct uri_s { scheme_e scheme; char scheme_specific[MAX_LEN_SCHEME_INFO]; - union + union { call_session_param_t call_session_param; - file_session_param_t file_session_param; + file_session_param_t file_session_param; raw_rtp_session_param_t raw_session_param; }param; - + } uri_t; int parse_uri(const char *uri, uri_t *uri_info); diff --git a/media/webrtc/signaling/src/sipcc/core/includes/singly_link_list.h b/media/webrtc/signaling/src/sipcc/core/includes/singly_link_list.h index 2999828e0372..a0046abc6d74 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/singly_link_list.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/singly_link_list.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _SINGLY_LINK_LIST_H #define _SINGLY_LINK_LIST_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/sip_socket_api.h b/media/webrtc/signaling/src/sipcc/core/includes/sip_socket_api.h index 5d837bd6153c..2969d7d8d0f8 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/sip_socket_api.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/sip_socket_api.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef __SIP_SOCKET_API_H__ #define __SIP_SOCKET_API_H__ @@ -49,7 +14,7 @@ * @brief The sipSocketSend() function is a wrapper used by the sipstack to send * data over a socket. This function decides to use the secure versus unsecure * connection based on the "secure" flag. - * + * * @note - The implementation of both secure/non-secure is the same in RT/TNP * products. It is different for the other vendors and hence we need this * flexibility. @@ -64,7 +29,7 @@ ssize_t sipSocketSend (cpr_socket_t soc, CONST void *buf, - size_t len, + size_t len, int32_t flags, boolean secure); @@ -74,7 +39,7 @@ sipSocketSend (cpr_socket_t soc, * @brief The sipSocketRecv() function is a wrapper used by the sipstack to send * data over a socket. This function decides to use the secure versus unsecure * connection based on the "secure" flag. - * + * * @note - The implementation of both secure/non-secure is the same in RT/TNP * products. It is different for the other vendors and hence we need this * flexibility. @@ -97,14 +62,14 @@ sipSocketRecv (cpr_socket_t soc, * @brief The sipSocketClose() function is a wrapper used by the sipstack to * close a socket. This function decides to use the secure versus unsecure * connection based on the "secure" flag. - * + * * @note - The implementation of both secure/non-secure is the same in RT/TNP * products. It is different for the other vendors and hence we need this * flexibility. * * @param[in] soc - The socket that needs to be destroyed * - * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. + * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. * * @note The possible error values this function should return are * @li [CPR_EBADF] socket is not a valid socket descriptor. diff --git a/media/webrtc/signaling/src/sipcc/core/includes/sntp.h b/media/webrtc/signaling/src/sipcc/core/includes/sntp.h index 68305a7061bc..93f53ea147ca 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/sntp.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/sntp.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef SNTP_H #define SNTP_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/string_lib.h b/media/webrtc/signaling/src/sipcc/core/includes/string_lib.h index 6e7e984abbb3..acdabc90a4ae 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/string_lib.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/string_lib.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _STRING_LIB_INCLUDED_H /* allows multiple inclusion */ #define _STRING_LIB_INCLUDED_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/subapi.h b/media/webrtc/signaling/src/sipcc/core/includes/subapi.h index 969b8f8aead3..367842732a4d 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/subapi.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/subapi.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _SUBAPI_H_ #define _SUBAPI_H_ @@ -50,7 +15,7 @@ cc_rcs_t sub_int_subnot_register(cc_srcs_t src_id, cc_srcs_t dst_id, cc_rcs_t sub_int_subscribe(sipspi_msg_t *msg_p); -cc_rcs_t sub_int_subscribe_ack(cc_srcs_t src_id, cc_srcs_t dst_id, +cc_rcs_t sub_int_subscribe_ack(cc_srcs_t src_id, cc_srcs_t dst_id, sub_id_t sub_id, uint16_t response_code, int duration); @@ -60,10 +25,10 @@ cc_rcs_t sub_int_notify(cc_srcs_t src_id, cc_srcs_t dst_id, sub_id_t sub_id, ccsip_event_data_t *eventData, subscriptionState subState); -cc_rcs_t sub_int_notify_ack(sub_id_t sub_id, uint16_t response_code, +cc_rcs_t sub_int_notify_ack(sub_id_t sub_id, uint16_t response_code, uint32_t cseq); -cc_rcs_t sub_int_subscribe_term(sub_id_t sub_id, boolean immediate, +cc_rcs_t sub_int_subscribe_term(sub_id_t sub_id, boolean immediate, int request_id, cc_subscriptions_t event_package); diff --git a/media/webrtc/signaling/src/sipcc/core/includes/task.h b/media/webrtc/signaling/src/sipcc/core/includes/task.h index 1aa91d0f6b8b..6cbc937603bb 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/task.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/task.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef TASK_H #define TASK_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/time2.h b/media/webrtc/signaling/src/sipcc/core/includes/time2.h index 232f8528b7dc..cc02ce7dbe53 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/time2.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/time2.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef TIME2_H #define TIME2_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/timer.h b/media/webrtc/signaling/src/sipcc/core/includes/timer.h index f33a3f9b37f1..eb02e9e63f25 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/timer.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/timer.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef MGCP_TIMER_H #define MGCP_TIMER_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/tnpphone.h b/media/webrtc/signaling/src/sipcc/core/includes/tnpphone.h index f3c93310ddad..80d4d62ac0b0 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/tnpphone.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/tnpphone.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef TNPPHONE_H #define TNPPHONE_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/uart.h b/media/webrtc/signaling/src/sipcc/core/includes/uart.h index a02349666c40..30596cf4eaad 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/uart.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/uart.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _UART_H_ #define _UART_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/includes/uiapi.h b/media/webrtc/signaling/src/sipcc/core/includes/uiapi.h index 1f0e0ad343ca..6604264eb15f 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/uiapi.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/uiapi.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _UIAPI_H_ #define _UIAPI_H_ @@ -69,9 +34,9 @@ typedef enum { evCreateOffer = CREATEOFFER, evCreateAnswer = CREATEANSWER, evCreateOfferError = CREATEOFFERERROR, - evCreateAnswerError = CREATEANSWERERROR, + evCreateAnswerError = CREATEANSWERERROR, evSetLocalDesc = SETLOCALDESC, - evSetRemoteDesc = SETREMOTEDESC, + evSetRemoteDesc = SETREMOTEDESC, evSetLocalDescError = SETLOCALDESCERROR, evSetRemoteDescError = SETREMOTEDESCERROR, evOnRemoteStreamAdd = REMOTESTREAMADD, diff --git a/media/webrtc/signaling/src/sipcc/core/includes/upgrade.h b/media/webrtc/signaling/src/sipcc/core/includes/upgrade.h index 91179e3ea05f..96f2bd987ed6 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/upgrade.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/upgrade.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _UPGRADE_INCLUDED_H #define _UPGRADE_INCLUDED_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/util_ios_queue.h b/media/webrtc/signaling/src/sipcc/core/includes/util_ios_queue.h index fb43e498faef..98ad646c732e 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/util_ios_queue.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/util_ios_queue.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _UTIL_IOS_QUEUE_H #define _UTIL_IOS_QUEUE_H diff --git a/media/webrtc/signaling/src/sipcc/core/includes/util_parse.h b/media/webrtc/signaling/src/sipcc/core/includes/util_parse.h index bf8e5033e187..e3341124a230 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/util_parse.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/util_parse.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _UTIL_PARSE_H_ #define _UTIL_PARSE_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/includes/util_string.h b/media/webrtc/signaling/src/sipcc/core/includes/util_string.h index 45e0c8d6a023..04a53d9ecc98 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/util_string.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/util_string.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _UTIL_STRING_H_ #define _UTIL_STRING_H_ @@ -47,7 +12,7 @@ #define EMPTY_STR_LEN 1 boolean is_empty_str(char *str); -void init_empty_str(char *str); +void init_empty_str(char *str); void ipaddr2dotted(char *addr_str, cpr_ip_addr_t *addr); uint32_t dotted2ipaddr(const char *addr_str); diff --git a/media/webrtc/signaling/src/sipcc/core/includes/vcm_util.h b/media/webrtc/signaling/src/sipcc/core/includes/vcm_util.h index 1f85fc0ec808..e3b11ed89af6 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/vcm_util.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/vcm_util.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef VCM_UTIL_H_ #define VCM_UTIL_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/includes/www.h b/media/webrtc/signaling/src/sipcc/core/includes/www.h index 268bee4f84ba..e5c40b01eada 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/www.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/www.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _WWW_H_ #define _WWW_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/includes/xml_defs.h b/media/webrtc/signaling/src/sipcc/core/includes/xml_defs.h index 00e33ae0fd3b..b91558f30ae2 100644 --- a/media/webrtc/signaling/src/sipcc/core/includes/xml_defs.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/xml_defs.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _XML_DEFS_H_ #define _XML_DEFS_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/sdp/ccsdp.c b/media/webrtc/signaling/src/sipcc/core/sdp/ccsdp.c index d042ee47894b..a11c335b2ae9 100644 --- a/media/webrtc/signaling/src/sipcc/core/sdp/ccsdp.c +++ b/media/webrtc/signaling/src/sipcc/core/sdp/ccsdp.c @@ -1,47 +1,12 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "sdp.h" #include "ccapi.h" -const char* ccsdpAttrGetFmtpParamSets(void *sdp_ptr, u16 level, +const char* ccsdpAttrGetFmtpParamSets(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { cc_sdp_t *sdpp = sdp_ptr; @@ -52,7 +17,7 @@ const char* ccsdpAttrGetFmtpParamSets(void *sdp_ptr, u16 level, return sdp_attr_get_fmtp_param_sets(sdpp->dest_sdp, level, cap_num, inst_num); } -sdp_result_e ccsdpAttrGetFmtpPackMode(void *sdp_ptr, u16 level, +sdp_result_e ccsdpAttrGetFmtpPackMode(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 *val) { cc_sdp_t *sdpp = sdp_ptr; @@ -63,7 +28,7 @@ sdp_result_e ccsdpAttrGetFmtpPackMode(void *sdp_ptr, u16 level, return sdp_attr_get_fmtp_pack_mode(sdpp->dest_sdp, level, cap_num, inst_num, val); } -sdp_result_e ccsdpAttrGetFmtpLevelAsymmetryAllowed(void *sdp_ptr, u16 level, +sdp_result_e ccsdpAttrGetFmtpLevelAsymmetryAllowed(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 *val) { cc_sdp_t *sdpp = sdp_ptr; diff --git a/media/webrtc/signaling/src/sipcc/core/sdp/sdp.h b/media/webrtc/signaling/src/sipcc/core/sdp/sdp.h index 91c3b62dffb2..9069b715cc96 100644 --- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp.h +++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _SDP_H_ #define _SDP_H_ @@ -45,16 +10,14 @@ /* SDP Defines */ -/* The following defines are used to indicate params that are specified - * as the choose parameter or parameters that are invalid. These can +/* The following defines are used to indicate params that are specified + * as the choose parameter or parameters that are invalid. These can * be used where the value required is really a u16, but is represented * by an int32. */ #define SDP_CHOOSE_PARAM (-1) #define SDP_SESSION_LEVEL 0xFFFF -#define SDP_MAX_LEN 4096 - #define UNKNOWN_CRYPTO_SUITE "UNKNOWN_CRYPTO_SUITE" #define AES_CM_128_HMAC_SHA1_32 "AES_CM_128_HMAC_SHA1_32" #define AES_CM_128_HMAC_SHA1_80 "AES_CM_128_HMAC_SHA1_80" @@ -126,7 +89,7 @@ typedef enum { } sdp_choose_param_e; -/* Token Lines - these must be in the same order they should +/* Token Lines - these must be in the same order they should * appear in an SDP. */ typedef enum { @@ -268,8 +231,8 @@ typedef enum { /* Fmtp attribute format Types */ typedef enum { - SDP_FMTP_NTE, - SDP_FMTP_CODEC_INFO, + SDP_FMTP_NTE, + SDP_FMTP_CODEC_INFO, SDP_FMTP_MODE, SDP_FMTP_DATACHANNEL, SDP_FMTP_UNKNOWN_TYPE, @@ -279,8 +242,8 @@ typedef enum { /* T.38 Rate Mgmt Types */ typedef enum { - SDP_T38_LOCAL_TCF, - SDP_T38_TRANSFERRED_TCF, + SDP_T38_LOCAL_TCF, + SDP_T38_TRANSFERRED_TCF, SDP_T38_UNKNOWN_RATE, SDP_T38_MAX_RATES } sdp_t38_ratemgmt_e; @@ -308,7 +271,7 @@ typedef enum { (((sdp_direction_e)(arg)) == SDP_DIRECTION_INACTIVE ? "SDP_DIRECTION_INACTIVE " : \ ((sdp_direction_e)(arg)) == SDP_DIRECTION_SENDONLY ? "SDP_DIRECTION_SENDONLY": \ ((sdp_direction_e)(arg)) == SDP_DIRECTION_RECVONLY ? "SDP_DIRECTION_RECVONLY ": \ - ((sdp_direction_e)(arg)) == SDP_DIRECTION_SENDRECV ? " SDP_DIRECTION_SENDRECV": "SDP_MAX_QOS_DIRECTIONS") + ((sdp_direction_e)(arg)) == SDP_DIRECTION_SENDRECV ? " SDP_DIRECTION_SENDRECV": "SDP_MAX_QOS_DIRECTIONS") /* QOS Strength tag */ @@ -385,7 +348,7 @@ typedef enum { SDP_MAXBR, SDP_SQCIF, SDP_CIF4, - SDP_CIF16, + SDP_CIF16, SDP_CUSTOM, SDP_PAR, SDP_CPCF, @@ -394,7 +357,7 @@ typedef enum { SDP_PROFILE, SDP_LEVEL, SDP_INTERLACE, - + /* H.264 related */ SDP_PROFILE_LEVEL_ID, /* 17 */ SDP_PARAMETER_SETS, @@ -442,10 +405,10 @@ typedef enum { SDP_FMTP_PARAM_UNKNOWN } sdp_fmtp_codec_param_e; -/* Fmtp attribute parameters values for - fmtp attribute parameters which convey codec +/* Fmtp attribute parameters values for + fmtp attribute parameters which convey codec information */ - + typedef enum { SDP_YES, SDP_NO, @@ -552,22 +515,22 @@ typedef enum sdp_srtp_crypto_suite_t_ { /* sdp_config.c */ extern void *sdp_init_config(void); -extern void sdp_appl_debug(void *config_p, sdp_debug_e debug_type, +extern void sdp_appl_debug(void *config_p, sdp_debug_e debug_type, tinybool debug_flag); extern void sdp_require_version(void *config_p, tinybool version_required); extern void sdp_require_owner(void *config_p, tinybool owner_required); -extern void sdp_require_session_name(void *config_p, +extern void sdp_require_session_name(void *config_p, tinybool sess_name_required); extern void sdp_require_timespec(void *config_p, tinybool timespec_required); -extern void sdp_media_supported(void *config_p, sdp_media_e media_type, +extern void sdp_media_supported(void *config_p, sdp_media_e media_type, tinybool media_supported); -extern void sdp_nettype_supported(void *config_p, sdp_nettype_e nettype, +extern void sdp_nettype_supported(void *config_p, sdp_nettype_e nettype, tinybool nettype_supported); -extern void sdp_addrtype_supported(void *config_p, sdp_addrtype_e addrtype, +extern void sdp_addrtype_supported(void *config_p, sdp_addrtype_e addrtype, tinybool addrtype_supported); -extern void sdp_transport_supported(void *config_p, sdp_transport_e transport, +extern void sdp_transport_supported(void *config_p, sdp_transport_e transport, tinybool transport_supported); -extern void sdp_allow_choose(void *config_p, sdp_choose_param_e param, +extern void sdp_allow_choose(void *config_p, sdp_choose_param_e param, tinybool choose_allowed); /* sdp_main.c */ @@ -575,7 +538,7 @@ extern void *sdp_init_description(void *config_p); extern void sdp_debug(void *sdp_ptr, sdp_debug_e debug_type, tinybool debug_flag); extern void sdp_set_string_debug(void *sdp_ptr, char *debug_str); extern sdp_result_e sdp_parse(void *sdp_ptr, char **bufp, u16 len); -extern sdp_result_e sdp_build(void *sdp_ptr, char **bufp, u16 len); +extern sdp_result_e sdp_build(void *sdp_ptr, flex_string *fs); extern void *sdp_copy(void *sdp_ptr); extern sdp_result_e sdp_free_description(void *sdp_ptr); @@ -597,9 +560,9 @@ extern const char *sdp_get_owner_address(void *sdp_p); extern sdp_result_e sdp_set_owner_username(void *sdp_p, const char *username); extern sdp_result_e sdp_set_owner_sessionid(void *sdp_p, const char *sessid); extern sdp_result_e sdp_set_owner_version(void *sdp_p, const char *version); -extern sdp_result_e sdp_set_owner_network_type(void *sdp_p, +extern sdp_result_e sdp_set_owner_network_type(void *sdp_p, sdp_nettype_e network_type); -extern sdp_result_e sdp_set_owner_address_type(void *sdp_p, +extern sdp_result_e sdp_set_owner_address_type(void *sdp_p, sdp_addrtype_e address_type); extern sdp_result_e sdp_set_owner_address(void *sdp_p, const char *address); @@ -618,7 +581,7 @@ extern sdp_encrypt_type_e sdp_get_encryption_method(void *sdp_ptr, u16 level); extern const char *sdp_get_encryption_key(void *sdp_ptr, u16 level); extern sdp_result_e sdp_set_encryption_method(void *sdp_ptr, u16 level, sdp_encrypt_type_e method); -extern sdp_result_e sdp_set_encryption_key(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_set_encryption_key(void *sdp_ptr, u16 level, const char *key); extern tinybool sdp_connection_valid(void *sdp_p, u16 level); @@ -632,13 +595,13 @@ extern tinybool sdp_is_mcast_addr (void *sdp_ptr, u16 level); extern int32 sdp_get_mcast_ttl(void *sdp_ptr, u16 level); extern int32 sdp_get_mcast_num_of_addresses(void *sdp_ptr, u16 level); -extern sdp_result_e sdp_set_conn_nettype(void *sdp_p, u16 level, +extern sdp_result_e sdp_set_conn_nettype(void *sdp_p, u16 level, sdp_nettype_e nettype); -extern sdp_result_e sdp_set_conn_addrtype(void *sdp_p, u16 level, +extern sdp_result_e sdp_set_conn_addrtype(void *sdp_p, u16 level, sdp_addrtype_e addrtype); -extern sdp_result_e sdp_set_conn_address(void *sdp_p, u16 level, +extern sdp_result_e sdp_set_conn_address(void *sdp_p, u16 level, const char *address); -extern sdp_result_e sdp_set_mcast_addr_fields(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_set_mcast_addr_fields(void *sdp_ptr, u16 level, u16 ttl, u16 num_addr); extern tinybool sdp_media_line_valid(void *sdp_ptr, u16 level); @@ -653,36 +616,36 @@ extern int32 sdp_get_media_vcci(void *sdp_ptr, u16 level); extern int32 sdp_get_media_cid(void *sdp_ptr, u16 level); extern sdp_transport_e sdp_get_media_transport(void *sdp_ptr, u16 level); extern u16 sdp_get_media_num_profiles(void *sdp_ptr, u16 level); -extern sdp_transport_e sdp_get_media_profile(void *sdp_ptr, u16 level, +extern sdp_transport_e sdp_get_media_profile(void *sdp_ptr, u16 level, u16 profile_num); extern u16 sdp_get_media_num_payload_types(void *sdp_ptr, u16 level); extern u16 sdp_get_media_profile_num_payload_types(void *sdp_ptr, u16 level, u16 profile_num); -extern u32 sdp_get_media_payload_type(void *sdp_ptr, u16 level, +extern u32 sdp_get_media_payload_type(void *sdp_ptr, u16 level, u16 payload_num, sdp_payload_ind_e *indicator); -extern u32 sdp_get_media_profile_payload_type(void *sdp_ptr, u16 level, +extern u32 sdp_get_media_profile_payload_type(void *sdp_ptr, u16 level, u16 prof_num, u16 payload_num, sdp_payload_ind_e *indicator); extern sdp_result_e sdp_insert_media_line(void *sdp_ptr, u16 level); extern void sdp_delete_media_line(void *sdp_ptr, u16 level); -extern sdp_result_e sdp_set_media_type(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_set_media_type(void *sdp_ptr, u16 level, sdp_media_e media); -extern sdp_result_e sdp_set_media_port_format(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_set_media_port_format(void *sdp_ptr, u16 level, sdp_port_format_e port_format); -extern sdp_result_e sdp_set_media_portnum(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_set_media_portnum(void *sdp_ptr, u16 level, int32 portnum, int32 sctpport); -extern sdp_result_e sdp_set_media_portcount(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_set_media_portcount(void *sdp_ptr, u16 level, int32 num_ports); extern sdp_result_e sdp_set_media_vpi(void *sdp_ptr, u16 level, int32 vpi); extern sdp_result_e sdp_set_media_vci(void *sdp_ptr, u16 level, u32 vci); extern sdp_result_e sdp_set_media_vcci(void *sdp_ptr, u16 level, int32 vcci); extern sdp_result_e sdp_set_media_cid(void *sdp_ptr, u16 level, int32 cid); -extern sdp_result_e sdp_set_media_transport(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_set_media_transport(void *sdp_ptr, u16 level, sdp_transport_e transport); -extern sdp_result_e sdp_add_media_profile(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_add_media_profile(void *sdp_ptr, u16 level, sdp_transport_e profile); -extern sdp_result_e sdp_add_media_payload_type(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_add_media_payload_type(void *sdp_ptr, u16 level, u16 payload_type, sdp_payload_ind_e indicator); -extern sdp_result_e sdp_add_media_profile_payload_type(void *sdp_ptr, +extern sdp_result_e sdp_add_media_profile_payload_type(void *sdp_ptr, u16 level, u16 prof_num, u16 payload_type, sdp_payload_ind_e indicator); @@ -694,8 +657,8 @@ extern sdp_result_e sdp_copy_attr (void *src_sdp_ptr, void *dst_sdp_ptr, u8 src_cap_num, u8 dst_cap_num, sdp_attr_e src_attr_type, u16 src_inst_num); extern sdp_result_e sdp_copy_all_attrs(void *src_sdp_ptr, void *dst_sdp_ptr, - u16 src_level, u16 dst_level); -extern sdp_result_e sdp_attr_num_instances(void *sdp_ptr, u16 level, + u16 src_level, u16 dst_level); +extern sdp_result_e sdp_attr_num_instances(void *sdp_ptr, u16 level, u8 cap_num, sdp_attr_e attr_type, u16 *num_attr_inst); extern sdp_result_e sdp_get_total_attrs(void *sdp_ptr, u16 level, u8 cap_num, u16 *num_attrs); @@ -704,35 +667,35 @@ extern sdp_result_e sdp_get_attr_type(void *sdp_ptr, u16 level, u8 cap_num, extern sdp_result_e sdp_delete_attr(void *sdp_ptr, u16 level, u8 cap_num, sdp_attr_e attr_type, u16 inst_num); extern sdp_result_e sdp_delete_all_attrs(void *sdp_ptr, u16 level, u8 cap_num); -extern tinybool sdp_attr_valid(void *sdp_ptr, sdp_attr_e attr_type, +extern tinybool sdp_attr_valid(void *sdp_ptr, sdp_attr_e attr_type, u16 level, u8 cap_num, u16 inst_num); -extern const char *sdp_attr_get_simple_string(void *sdp_ptr, +extern const char *sdp_attr_get_simple_string(void *sdp_ptr, sdp_attr_e attr_type, u16 level, u8 cap_num, u16 inst_num); -extern sdp_result_e sdp_attr_set_simple_string(void *sdp_ptr, - sdp_attr_e attr_type, u16 level, +extern sdp_result_e sdp_attr_set_simple_string(void *sdp_ptr, + sdp_attr_e attr_type, u16 level, u8 cap_num, u16 inst_num, const char *string_parm); -extern u32 sdp_attr_get_simple_u32(void *sdp_ptr, sdp_attr_e attr_type, +extern u32 sdp_attr_get_simple_u32(void *sdp_ptr, sdp_attr_e attr_type, u16 level, u8 cap_num, u16 inst_num); -extern sdp_result_e sdp_attr_set_simple_u32(void *sdp_ptr, +extern sdp_result_e sdp_attr_set_simple_u32(void *sdp_ptr, sdp_attr_e attr_type, u16 level, u8 cap_num, u16 inst_num, u32 num_parm); -extern tinybool sdp_attr_get_simple_boolean(void *sdp_ptr, +extern tinybool sdp_attr_get_simple_boolean(void *sdp_ptr, sdp_attr_e attr_type, u16 level, u8 cap_num, u16 inst_num); -extern sdp_result_e sdp_attr_set_simple_boolean(void *sdp_ptr, +extern sdp_result_e sdp_attr_set_simple_boolean(void *sdp_ptr, sdp_attr_e attr_type, u16 level, u8 cap_num, u16 inst_num, u32 bool_parm); -extern const char* sdp_attr_get_maxprate(void *sdp_ptr, u16 level, +extern const char* sdp_attr_get_maxprate(void *sdp_ptr, u16 level, u16 inst_num); -extern sdp_result_e sdp_attr_set_maxprate(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_maxprate(void *sdp_ptr, u16 level, u16 inst_num, const char *string_parm); extern sdp_t38_ratemgmt_e sdp_attr_get_t38ratemgmt(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); -extern sdp_result_e sdp_attr_set_t38ratemgmt(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_t38ratemgmt(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, sdp_t38_ratemgmt_e t38ratemgmt); extern sdp_t38_udpec_e sdp_attr_get_t38udpec(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); -extern sdp_result_e sdp_attr_set_t38udpec(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_t38udpec(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, sdp_t38_udpec_e t38udpec); extern sdp_direction_e sdp_get_media_direction(void *sdp_ptr, u16 level, @@ -750,7 +713,7 @@ extern sdp_curr_type_e sdp_attr_get_curr_type (void *sdp_ptr, u16 level, extern sdp_des_type_e sdp_attr_get_des_type (void *sdp_ptr, u16 level, u8 cap_num, sdp_attr_e qos_attr, u16 inst_num); extern sdp_conf_type_e sdp_attr_get_conf_type (void *sdp_ptr, u16 level, - u8 cap_num, sdp_attr_e qos_attr, u16 inst_num); + u8 cap_num, sdp_attr_e qos_attr, u16 inst_num); extern sdp_result_e sdp_attr_set_conf_type (void *sdp_ptr, u16 level, u8 cap_num, sdp_attr_e qos_attr, u16 inst_num, sdp_conf_type_e conf_type); @@ -759,17 +722,17 @@ extern sdp_result_e sdp_attr_set_des_type (void *sdp_ptr, u16 level, sdp_des_type_e des_type); extern sdp_result_e sdp_attr_set_curr_type (void *sdp_ptr, u16 level, u8 cap_num, sdp_attr_e qos_attr, u16 inst_num, - sdp_curr_type_e curr_type); -extern sdp_result_e sdp_attr_set_qos_strength(void *sdp_ptr, u16 level, + sdp_curr_type_e curr_type); +extern sdp_result_e sdp_attr_set_qos_strength(void *sdp_ptr, u16 level, u8 cap_num, sdp_attr_e qos_attr, u16 inst_num, sdp_qos_strength_e strength); -extern sdp_result_e sdp_attr_set_qos_direction(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_qos_direction(void *sdp_ptr, u16 level, u8 cap_num, sdp_attr_e qos_attr, u16 inst_num, sdp_qos_dir_e direction); -extern sdp_result_e sdp_attr_set_qos_status_type(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_qos_status_type(void *sdp_ptr, u16 level, u8 cap_num, sdp_attr_e qos_attr, u16 inst_num, sdp_qos_status_types_e status_type); -extern sdp_result_e sdp_attr_set_qos_confirm(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_qos_confirm(void *sdp_ptr, u16 level, u8 cap_num, sdp_attr_e qos_attr, u16 inst_num, tinybool confirm); extern sdp_nettype_e sdp_attr_get_subnet_nettype(void *sdp_ptr, u16 level, @@ -780,19 +743,19 @@ extern const char *sdp_attr_get_subnet_addr(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); extern int32 sdp_attr_get_subnet_prefix(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); -extern sdp_result_e sdp_attr_set_subnet_nettype(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_subnet_nettype(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, sdp_nettype_e nettype); -extern sdp_result_e sdp_attr_set_subnet_addrtype(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_subnet_addrtype(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, sdp_addrtype_e addrtype); -extern sdp_result_e sdp_attr_set_subnet_addr(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_subnet_addr(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, const char *addr); -extern sdp_result_e sdp_attr_set_subnet_prefix(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_subnet_prefix(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, int32 prefix); -extern tinybool sdp_attr_rtpmap_payload_valid(void *sdp_ptr, u16 level, +extern tinybool sdp_attr_rtpmap_payload_valid(void *sdp_ptr, u16 level, u8 cap_num, u16 *inst_num, u16 payload_type); extern u16 sdp_attr_get_rtpmap_payload_type(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); @@ -802,17 +765,17 @@ extern u32 sdp_attr_get_rtpmap_clockrate(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); extern u16 sdp_attr_get_rtpmap_num_chan(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); -extern sdp_result_e sdp_attr_set_rtpmap_payload_type(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_rtpmap_payload_type(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 payload_num); -extern sdp_result_e sdp_attr_set_rtpmap_encname(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_rtpmap_encname(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, const char *encname); -extern sdp_result_e sdp_attr_set_rtpmap_clockrate(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_rtpmap_clockrate(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u32 clockrate); -extern sdp_result_e sdp_attr_set_rtpmap_num_chan(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_rtpmap_num_chan(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 num_chan); -extern tinybool sdp_attr_sprtmap_payload_valid(void *sdp_ptr, u16 level, +extern tinybool sdp_attr_sprtmap_payload_valid(void *sdp_ptr, u16 level, u8 cap_num, u16 *inst_num, u16 payload_type); extern u16 sdp_attr_get_sprtmap_payload_type(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); @@ -822,76 +785,76 @@ extern u32 sdp_attr_get_sprtmap_clockrate(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); extern u16 sdp_attr_get_sprtmap_num_chan(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); -extern sdp_result_e sdp_attr_set_sprtmap_payload_type(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_sprtmap_payload_type(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 payload_num); -extern sdp_result_e sdp_attr_set_sprtmap_encname(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_sprtmap_encname(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, const char *encname); -extern sdp_result_e sdp_attr_set_sprtmap_clockrate(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_sprtmap_clockrate(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 clockrate); -extern sdp_result_e sdp_attr_set_sprtmap_num_chan(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_sprtmap_num_chan(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 num_chan); -extern tinybool sdp_attr_fmtp_payload_valid(void *sdp_ptr, u16 level, +extern tinybool sdp_attr_fmtp_payload_valid(void *sdp_ptr, u16 level, u8 cap_num, u16 *inst_num, u16 payload_type); extern u16 sdp_attr_get_fmtp_payload_type(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); -extern sdp_ne_res_e sdp_attr_fmtp_is_range_set(void *sdp_ptr, u16 level, +extern sdp_ne_res_e sdp_attr_fmtp_is_range_set(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u8 low_val, u8 high_val); -extern tinybool sdp_attr_fmtp_valid(void *sdp_ptr, u16 level, u8 cap_num, +extern tinybool sdp_attr_fmtp_valid(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 appl_maxval, u32* evt_array); -extern sdp_result_e sdp_attr_set_fmtp_payload_type(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_fmtp_payload_type(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 payload_num); -extern sdp_result_e sdp_attr_get_fmtp_range(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_get_fmtp_range(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u32 *bmap); -extern sdp_result_e sdp_attr_set_fmtp_range(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_fmtp_range(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u8 low_val, u8 high_val); -extern sdp_result_e sdp_attr_set_fmtp_bitmap(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_fmtp_bitmap(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u32 *bmap, u32 maxval); -extern sdp_result_e sdp_attr_clear_fmtp_range(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_clear_fmtp_range(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u8 low_val, u8 high_val); extern sdp_ne_res_e sdp_attr_compare_fmtp_ranges(void *src_sdp_ptr, - void *dst_sdp_ptr, u16 src_level, u16 dst_level, - u8 src_cap_num, u8 dst_cap_num, u16 src_inst_num, + void *dst_sdp_ptr, u16 src_level, u16 dst_level, + u8 src_cap_num, u8 dst_cap_num, u16 src_inst_num, u16 dst_inst_num); -extern sdp_result_e sdp_attr_copy_fmtp_ranges(void *src_sdp_ptr, - void *dst_sdp_ptr, u16 src_level, u16 dst_level, - u8 src_cap_num, u8 dst_cap_num, u16 src_inst_num, +extern sdp_result_e sdp_attr_copy_fmtp_ranges(void *src_sdp_ptr, + void *dst_sdp_ptr, u16 src_level, u16 dst_level, + u8 src_cap_num, u8 dst_cap_num, u16 src_inst_num, u16 dst_inst_num); -extern sdp_result_e sdp_attr_set_fmtp_annexa (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_attr_set_fmtp_annexa (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, tinybool annexa); -extern sdp_result_e sdp_attr_set_fmtp_mode(void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_attr_set_fmtp_mode(void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u32 mode); extern u32 sdp_attr_get_fmtp_mode_for_payload_type (void *sdp_ptr, u16 level, u8 cap_num, u32 payload_type); -extern sdp_result_e sdp_attr_set_fmtp_annexb (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_attr_set_fmtp_annexb (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, tinybool annexb); -extern sdp_result_e sdp_attr_set_fmtp_bitrate_type (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_attr_set_fmtp_bitrate_type (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u32 bitrate); -extern sdp_result_e sdp_attr_set_fmtp_cif (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_attr_set_fmtp_cif (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 cif); -extern sdp_result_e sdp_attr_set_fmtp_qcif (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_attr_set_fmtp_qcif (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 qcif); -extern sdp_result_e sdp_attr_set_fmtp_sqcif (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_attr_set_fmtp_sqcif (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 sqcif); -extern sdp_result_e sdp_attr_set_fmtp_cif4 (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_attr_set_fmtp_cif4 (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 cif4); -extern sdp_result_e sdp_attr_set_fmtp_cif16 (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_attr_set_fmtp_cif16 (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 cif16); -extern sdp_result_e sdp_attr_set_fmtp_maxbr (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_attr_set_fmtp_maxbr (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 maxbr); extern sdp_result_e sdp_attr_set_fmtp_max_average_bitrate (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, @@ -911,127 +874,127 @@ extern sdp_result_e sdp_attr_set_fmtp_maxcodedaudiobandwidth (void *sdp_ptr, u16 extern sdp_result_e sdp_attr_set_fmtp_cbr (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, tinybool cbr); -extern sdp_result_e sdp_attr_set_fmtp_custom (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, - u16 custom_x, u16 custom_y, +extern sdp_result_e sdp_attr_set_fmtp_custom (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, + u16 custom_x, u16 custom_y, u16 custom_mpi); -extern sdp_result_e sdp_attr_set_fmtp_par (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_attr_set_fmtp_par (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 par_width, u16 par_height); -extern sdp_result_e sdp_attr_set_fmtp_bpp (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_attr_set_fmtp_bpp (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 bpp); -extern sdp_result_e sdp_attr_set_fmtp_hrd (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_attr_set_fmtp_hrd (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 hrd); -extern sdp_result_e sdp_attr_set_fmtp_h263_num_params (void *sdp_ptr, - int16 level, - u8 cap_num, +extern sdp_result_e sdp_attr_set_fmtp_h263_num_params (void *sdp_ptr, + int16 level, + u8 cap_num, u16 inst_num, int16 profile, u16 h263_level, tinybool interlace); -extern sdp_result_e sdp_attr_set_fmtp_profile_level_id (void *sdp_ptr, - u16 level, - u8 cap_num, +extern sdp_result_e sdp_attr_set_fmtp_profile_level_id (void *sdp_ptr, + u16 level, + u8 cap_num, u16 inst_num, const char *prof_id); -extern sdp_result_e sdp_attr_set_fmtp_parameter_sets (void *sdp_ptr, - u16 level, - u8 cap_num, +extern sdp_result_e sdp_attr_set_fmtp_parameter_sets (void *sdp_ptr, + u16 level, + u8 cap_num, u16 inst_num, const char *parameter_sets); -extern sdp_result_e sdp_attr_set_fmtp_deint_buf_req (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_attr_set_fmtp_deint_buf_req (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u32 deint_buf_req); -extern sdp_result_e sdp_attr_set_fmtp_init_buf_time (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_attr_set_fmtp_init_buf_time (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u32 init_buf_time); -extern sdp_result_e sdp_attr_set_fmtp_max_don_diff (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_attr_set_fmtp_max_don_diff (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u32 max_don_diff); -extern sdp_result_e sdp_attr_set_fmtp_interleaving_depth (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_attr_set_fmtp_interleaving_depth (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 interleaving_depth); -extern sdp_result_e sdp_attr_set_fmtp_pack_mode (void *sdp_ptr, - u16 level, - u8 cap_num, +extern sdp_result_e sdp_attr_set_fmtp_pack_mode (void *sdp_ptr, + u16 level, + u8 cap_num, u16 inst_num, u16 pack_mode); -extern sdp_result_e sdp_attr_set_fmtp_level_asymmetry_allowed (void *sdp_ptr, - u16 level, - u8 cap_num, +extern sdp_result_e sdp_attr_set_fmtp_level_asymmetry_allowed (void *sdp_ptr, + u16 level, + u8 cap_num, u16 inst_num, u16 level_asymmetry_allowed); -extern sdp_result_e sdp_attr_set_fmtp_redundant_pic_cap (void *sdp_ptr, - u16 level, - u8 cap_num, +extern sdp_result_e sdp_attr_set_fmtp_redundant_pic_cap (void *sdp_ptr, + u16 level, + u8 cap_num, u16 inst_num, tinybool redundant_pic_cap); -extern sdp_result_e sdp_attr_set_fmtp_max_mbps (void *sdp_ptr, - u16 level, - u8 cap_num, +extern sdp_result_e sdp_attr_set_fmtp_max_mbps (void *sdp_ptr, + u16 level, + u8 cap_num, u16 inst_num, u32 max_mbps); -extern sdp_result_e sdp_attr_set_fmtp_max_fs (void *sdp_ptr, - u16 level, - u8 cap_num, +extern sdp_result_e sdp_attr_set_fmtp_max_fs (void *sdp_ptr, + u16 level, + u8 cap_num, u16 inst_num, u32 max_fs); -extern sdp_result_e sdp_attr_set_fmtp_max_cpb (void *sdp_ptr, - u16 level, - u8 cap_num, +extern sdp_result_e sdp_attr_set_fmtp_max_cpb (void *sdp_ptr, + u16 level, + u8 cap_num, u16 inst_num, u32 max_cpb); -extern sdp_result_e sdp_attr_set_fmtp_max_dpb (void *sdp_ptr, - u16 level, - u8 cap_num, +extern sdp_result_e sdp_attr_set_fmtp_max_dpb (void *sdp_ptr, + u16 level, + u8 cap_num, u16 inst_num, u32 max_dpb); -extern sdp_result_e sdp_attr_set_fmtp_max_br (void *sdp_ptr, - u16 level, - u8 cap_num, +extern sdp_result_e sdp_attr_set_fmtp_max_br (void *sdp_ptr, + u16 level, + u8 cap_num, u16 inst_num, u32 max_br); -extern sdp_result_e sdp_attr_set_fmtp_max_rcmd_nalu_size (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_attr_set_fmtp_max_rcmd_nalu_size (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u32 max_rcmd_nalu_size); -extern sdp_result_e sdp_attr_set_fmtp_deint_buf_cap (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_attr_set_fmtp_deint_buf_cap (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u32 deint_buf_cap); -extern sdp_result_e sdp_attr_set_fmtp_h264_parameter_add (void *sdp_ptr, - u16 level, - u8 cap_num, +extern sdp_result_e sdp_attr_set_fmtp_h264_parameter_add (void *sdp_ptr, + u16 level, + u8 cap_num, u16 inst_num, tinybool parameter_add); -extern sdp_result_e sdp_attr_set_fmtp_h261_annex_params (void *sdp_ptr, - u16 level, - u8 cap_num, +extern sdp_result_e sdp_attr_set_fmtp_h261_annex_params (void *sdp_ptr, + u16 level, + u8 cap_num, u16 inst_num, tinybool annex_d); -extern sdp_result_e sdp_attr_set_fmtp_h263_annex_params (void *sdp_ptr, - u16 level, - u8 cap_num, +extern sdp_result_e sdp_attr_set_fmtp_h263_annex_params (void *sdp_ptr, + u16 level, + u8 cap_num, u16 inst_num, tinybool annex_f, tinybool annex_i, @@ -1131,7 +1094,7 @@ extern sdp_result_e sdp_attr_get_fmtp_pack_mode (void *sdp_ptr, u16 level, extern sdp_result_e sdp_attr_get_fmtp_level_asymmetry_allowed (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 *val); - + extern sdp_result_e sdp_attr_get_fmtp_interleaving_depth (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 *val); @@ -1139,8 +1102,8 @@ extern sdp_result_e sdp_attr_get_fmtp_max_don_diff (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u32 *val); -/* The following four H.264 parameters that require special handling as - * the values range from 0 - 4294967295 +/* The following four H.264 parameters that require special handling as + * the values range from 0 - 4294967295 */ extern sdp_result_e sdp_attr_get_fmtp_deint_buf_req (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, @@ -1151,7 +1114,7 @@ extern sdp_result_e sdp_attr_get_fmtp_deint_buf_cap (void *sdp_ptr, u16 level, extern sdp_result_e sdp_attr_get_fmtp_init_buf_time (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u32 *val); -extern sdp_result_e sdp_attr_get_fmtp_max_rcmd_nalu_size (void *sdp_ptr, +extern sdp_result_e sdp_attr_get_fmtp_max_rcmd_nalu_size (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u32 *val); @@ -1166,62 +1129,62 @@ extern sdp_result_e sdp_attr_get_fmtp_max_dpb (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u32 *val); extern sdp_result_e sdp_attr_get_fmtp_max_br (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u32 *val); -extern tinybool sdp_attr_fmtp_is_redundant_pic_cap (void *sdp_ptr, u16 level, - u8 cap_num, +extern tinybool sdp_attr_fmtp_is_redundant_pic_cap (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num); -extern tinybool sdp_attr_fmtp_is_parameter_add (void *sdp_ptr, u16 level, - u8 cap_num, +extern tinybool sdp_attr_fmtp_is_parameter_add (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num); -extern tinybool sdp_attr_fmtp_is_annexa_set (void *sdp_ptr, u16 level, - u8 cap_num, +extern tinybool sdp_attr_fmtp_is_annexa_set (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num); - -extern tinybool sdp_attr_fmtp_is_annexb_set (void *sdp_ptr, u16 level, - u8 cap_num, + +extern tinybool sdp_attr_fmtp_is_annexb_set (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num); - -extern sdp_fmtp_format_type_e sdp_attr_fmtp_get_fmtp_format (void *sdp_ptr, u16 level, u8 cap_num, + +extern sdp_fmtp_format_type_e sdp_attr_fmtp_get_fmtp_format (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); extern u16 sdp_attr_get_pccodec_num_payload_types(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); -extern u16 sdp_attr_get_pccodec_payload_type(void *sdp_ptr, u16 level, +extern u16 sdp_attr_get_pccodec_payload_type(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 payload_num); -extern sdp_result_e sdp_attr_add_pccodec_payload_type(void *sdp_ptr, +extern sdp_result_e sdp_attr_add_pccodec_payload_type(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 payload_type); -extern u16 sdp_attr_get_xcap_first_cap_num(void *sdp_ptr, u16 level, +extern u16 sdp_attr_get_xcap_first_cap_num(void *sdp_ptr, u16 level, u16 inst_num); extern sdp_media_e sdp_attr_get_xcap_media_type(void *sdp_ptr, u16 level, u16 inst_num); -extern sdp_transport_e sdp_attr_get_xcap_transport_type(void *sdp_ptr, +extern sdp_transport_e sdp_attr_get_xcap_transport_type(void *sdp_ptr, u16 level, u16 inst_num); extern u16 sdp_attr_get_xcap_num_payload_types(void *sdp_ptr, u16 level, u16 inst_num); extern u16 sdp_attr_get_xcap_payload_type(void *sdp_ptr, u16 level, u16 inst_num, u16 payload_num, sdp_payload_ind_e *indicator); -extern sdp_result_e sdp_attr_set_xcap_media_type(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_xcap_media_type(void *sdp_ptr, u16 level, u16 inst_num, sdp_media_e media); -extern sdp_result_e sdp_attr_set_xcap_transport_type(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_xcap_transport_type(void *sdp_ptr, u16 level, u16 inst_num, sdp_transport_e transport); extern sdp_result_e sdp_attr_add_xcap_payload_type(void *sdp_ptr, u16 level, u16 inst_num, u16 payload_type, sdp_payload_ind_e indicator); -extern u16 sdp_attr_get_cdsc_first_cap_num(void *sdp_ptr, u16 level, +extern u16 sdp_attr_get_cdsc_first_cap_num(void *sdp_ptr, u16 level, u16 inst_num); extern sdp_media_e sdp_attr_get_cdsc_media_type(void *sdp_ptr, u16 level, u16 inst_num); -extern sdp_transport_e sdp_attr_get_cdsc_transport_type(void *sdp_ptr, +extern sdp_transport_e sdp_attr_get_cdsc_transport_type(void *sdp_ptr, u16 level, u16 inst_num); extern u16 sdp_attr_get_cdsc_num_payload_types(void *sdp_ptr, u16 level, u16 inst_num); extern u16 sdp_attr_get_cdsc_payload_type(void *sdp_ptr, u16 level, u16 inst_num, u16 payload_num, sdp_payload_ind_e *indicator); -extern sdp_result_e sdp_attr_set_cdsc_media_type(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_cdsc_media_type(void *sdp_ptr, u16 level, u16 inst_num, sdp_media_e media); -extern sdp_result_e sdp_attr_set_cdsc_transport_type(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_cdsc_transport_type(void *sdp_ptr, u16 level, u16 inst_num, sdp_transport_e transport); extern sdp_result_e sdp_attr_add_cdsc_payload_type(void *sdp_ptr, u16 level, u16 inst_num, u16 payload_type, @@ -1232,7 +1195,7 @@ extern tinybool sdp_media_dynamic_payload_valid (void *sdp_ptr, u16 payload_type extern sdp_result_e sdp_attr_set_rtr_confirm (void *, u16 , \ u8 ,u16 ,tinybool ); extern tinybool sdp_attr_get_rtr_confirm (void *, u16, u8, u16); - + extern tinybool sdp_attr_get_silencesupp_enabled(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); extern u16 sdp_attr_get_silencesupp_timer(void *sdp_ptr, u16 level, @@ -1240,7 +1203,7 @@ extern u16 sdp_attr_get_silencesupp_timer(void *sdp_ptr, u16 level, tinybool *null_ind); extern sdp_silencesupp_pref_e sdp_attr_get_silencesupp_pref(void *sdp_ptr, u16 level, - u8 cap_num, + u8 cap_num, u16 inst_num); extern sdp_silencesupp_siduse_e sdp_attr_get_silencesupp_siduse(void *sdp_ptr, u16 level, @@ -1269,14 +1232,14 @@ extern sdp_result_e sdp_attr_set_silencesupp_fxnslevel(void *sdp_ptr, u16 value, tinybool null_ind); -extern sdp_mediadir_role_e sdp_attr_get_comediadir_role(void *sdp_ptr, +extern sdp_mediadir_role_e sdp_attr_get_comediadir_role(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); -extern sdp_result_e sdp_attr_set_comediadir_role(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_comediadir_role(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, sdp_mediadir_role_e role); -extern sdp_result_e sdp_delete_all_media_direction_attrs (void *sdp_ptr, +extern sdp_result_e sdp_delete_all_media_direction_attrs (void *sdp_ptr, u16 level); extern u16 sdp_attr_get_mptime_num_intervals( @@ -1290,17 +1253,17 @@ extern sdp_result_e sdp_attr_add_mptime_interval( extern sdp_result_e sdp_delete_bw_line (void *sdp_ptr, u16 level, u16 inst_num); extern sdp_result_e sdp_copy_all_bw_lines(void *src_sdp_ptr, void *dst_sdp_ptr, u16 src_level, u16 dst_level); -extern sdp_bw_modifier_e sdp_get_bw_modifier(void *sdp_ptr, u16 level, +extern sdp_bw_modifier_e sdp_get_bw_modifier(void *sdp_ptr, u16 level, u16 inst_num); extern int32 sdp_get_bw_value(void *sdp_ptr, u16 level, u16 inst_num); extern int32 sdp_get_num_bw_lines (void *sdp_ptr, u16 level); -extern sdp_result_e sdp_add_new_bw_line(void *sdp_ptr, u16 level, +extern sdp_result_e sdp_add_new_bw_line(void *sdp_ptr, u16 level, sdp_bw_modifier_e bw_modifier, u16 *inst_num); -extern sdp_result_e sdp_set_bw(void *sdp_ptr, u16 level, u16 inst_num, +extern sdp_result_e sdp_set_bw(void *sdp_ptr, u16 level, u16 inst_num, sdp_bw_modifier_e value, u32 bw_val); -extern sdp_group_attr_e sdp_get_group_attr(void *sdp_ptr, u16 level, +extern sdp_group_attr_e sdp_get_group_attr(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); extern sdp_result_e sdp_set_group_attr(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, @@ -1309,34 +1272,34 @@ extern sdp_result_e sdp_set_group_attr(void *sdp_ptr, u16 level, extern const char* sdp_attr_get_x_sidout (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); -extern sdp_result_e sdp_attr_set_x_sidout (void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_x_sidout (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, const char *sidout); extern const char* sdp_attr_get_x_sidin (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); -extern sdp_result_e sdp_attr_set_x_sidin (void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_x_sidin (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, const char *sidin); extern const char* sdp_attr_get_x_confid (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); -extern sdp_result_e sdp_attr_set_x_confid (void *sdp_ptr, u16 level, +extern sdp_result_e sdp_attr_set_x_confid (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, const char *confid); extern sdp_result_e sdp_attr_set_ice_candidate(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, const char *ice_candidate); -extern u16 sdp_get_group_num_id(void *sdp_ptr, u16 level, +extern u16 sdp_get_group_num_id(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); extern sdp_result_e sdp_set_group_num_id(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 group_num_id); -extern int32 sdp_get_group_id(void *sdp_ptr, u16 level, +extern int32 sdp_get_group_id(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 id_num); extern sdp_result_e sdp_set_group_id (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 group_id); @@ -1345,147 +1308,147 @@ extern sdp_result_e sdp_set_group_id (void *sdp_ptr, u16 level, extern int32 sdp_get_mid_value(void *sdp_ptr, u16 level); extern sdp_result_e sdp_set_mid_value(void *sdp_ptr, u16 level, u32 mid_val); -extern sdp_result_e sdp_set_source_filter(void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_set_source_filter(void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, sdp_src_filter_mode_e mode, - sdp_nettype_e nettype, + sdp_nettype_e nettype, sdp_addrtype_e addrtype, - const char *dest_addr, + const char *dest_addr, const char *src_addr); -extern sdp_result_e sdp_include_new_filter_src_addr(void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_include_new_filter_src_addr(void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, const char *src_addr); -extern sdp_src_filter_mode_e sdp_get_source_filter_mode(void *sdp_ptr, +extern sdp_src_filter_mode_e sdp_get_source_filter_mode(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); -extern sdp_result_e sdp_get_filter_destination_attributes(void *sdp_ptr, +extern sdp_result_e sdp_get_filter_destination_attributes(void *sdp_ptr, u16 level, u8 cap_num, - u16 inst_num, + u16 inst_num, sdp_nettype_e *nettype, sdp_addrtype_e *addrtype, char *dest_addr); extern int32 sdp_get_filter_source_address_count(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num); -extern sdp_result_e sdp_get_filter_source_address (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +extern sdp_result_e sdp_get_filter_source_address (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 src_addr_id, char *src_addr); extern sdp_result_e sdp_set_rtcp_unicast_mode(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, sdp_rtcp_unicast_mode_e mode); -extern sdp_rtcp_unicast_mode_e sdp_get_rtcp_unicast_mode(void *sdp_ptr, - u16 level, u8 cap_num, +extern sdp_rtcp_unicast_mode_e sdp_get_rtcp_unicast_mode(void *sdp_ptr, + u16 level, u8 cap_num, u16 inst_num); void sdp_crypto_debug(char *buffer, ulong length_bytes); char * sdp_debug_msg_filter(char *buffer, ulong length_bytes); extern int32 -sdp_attr_get_sdescriptions_tag(void *sdp_ptr, +sdp_attr_get_sdescriptions_tag(void *sdp_ptr, u16 level, - u8 cap_num, + u8 cap_num, u16 inst_num); - + extern sdp_srtp_crypto_suite_t -sdp_attr_get_sdescriptions_crypto_suite(void *sdp_ptr, +sdp_attr_get_sdescriptions_crypto_suite(void *sdp_ptr, u16 level, - u8 cap_num, + u8 cap_num, u16 inst_num); - + extern const char* -sdp_attr_get_sdescriptions_key(void *sdp_ptr, +sdp_attr_get_sdescriptions_key(void *sdp_ptr, u16 level, - u8 cap_num, + u8 cap_num, u16 inst_num); - + extern const char* -sdp_attr_get_sdescriptions_salt(void *sdp_ptr, +sdp_attr_get_sdescriptions_salt(void *sdp_ptr, u16 level, - u8 cap_num, + u8 cap_num, u16 inst_num); - + extern const char* -sdp_attr_get_sdescriptions_lifetime(void *sdp_ptr, +sdp_attr_get_sdescriptions_lifetime(void *sdp_ptr, u16 level, - u8 cap_num, + u8 cap_num, u16 inst_num); - + extern sdp_result_e -sdp_attr_get_sdescriptions_mki(void *sdp_ptr, +sdp_attr_get_sdescriptions_mki(void *sdp_ptr, u16 level, - u8 cap_num, + u8 cap_num, u16 inst_num, const char **mki_value, u16 *mki_length); - + extern const char* -sdp_attr_get_sdescriptions_session_params(void *sdp_ptr, +sdp_attr_get_sdescriptions_session_params(void *sdp_ptr, u16 level, - u8 cap_num, + u8 cap_num, u16 inst_num); - -extern unsigned char -sdp_attr_get_sdescriptions_key_size(void *sdp_ptr, - u16 level, - u8 cap_num, + +extern unsigned char +sdp_attr_get_sdescriptions_key_size(void *sdp_ptr, + u16 level, + u8 cap_num, u16 inst_num); -extern unsigned char -sdp_attr_get_sdescriptions_salt_size(void *sdp_ptr, - u16 level, - u8 cap_num, +extern unsigned char +sdp_attr_get_sdescriptions_salt_size(void *sdp_ptr, + u16 level, + u8 cap_num, u16 inst_num); - -extern unsigned long -sdp_attr_get_srtp_crypto_selection_flags(void *sdp_ptr, - u16 level, - u8 cap_num, + +extern unsigned long +sdp_attr_get_srtp_crypto_selection_flags(void *sdp_ptr, + u16 level, + u8 cap_num, u16 inst_num); - -extern sdp_result_e + +extern sdp_result_e sdp_attr_set_sdescriptions_tag(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, int32 tag_num); - -extern sdp_result_e + +extern sdp_result_e sdp_attr_set_sdescriptions_crypto_suite(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, sdp_srtp_crypto_suite_t crypto_suite); - -extern sdp_result_e + +extern sdp_result_e sdp_attr_set_sdescriptions_key(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, char *key); - -extern sdp_result_e + +extern sdp_result_e sdp_attr_set_sdescriptions_salt(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, char *salt); - -extern sdp_result_e + +extern sdp_result_e sdp_attr_set_sdescriptions_lifetime(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, char *lifetime); - -extern sdp_result_e + +extern sdp_result_e sdp_attr_set_sdescriptions_mki(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, char *mki_value, u16 mki_length); - + extern sdp_result_e -sdp_attr_set_sdescriptions_key_size(void *sdp_ptr, - u16 level, - u8 cap_num, - u16 inst_num, +sdp_attr_set_sdescriptions_key_size(void *sdp_ptr, + u16 level, + u8 cap_num, + u16 inst_num, unsigned char key_size); extern sdp_result_e -sdp_attr_set_sdescriptions_salt_size(void *sdp_ptr, - u16 level, - u8 cap_num, - u16 inst_num, +sdp_attr_set_sdescriptions_salt_size(void *sdp_ptr, + u16 level, + u8 cap_num, + u16 inst_num, unsigned char salt_size); sdp_result_e diff --git a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_access.c b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_access.c index 1766d781a139..3dcc23602085 100644 --- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_access.c +++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_access.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "sdp_os_defs.h" #include "sdp.h" @@ -58,7 +23,7 @@ sdp_mca_t *sdp_find_media_level (sdp_t *sdp_p, u16 level) sdp_mca_t *mca_p = NULL; if ((level >= 1) && (level <= sdp_p->mca_count)) { - for (i=1, mca_p = sdp_p->mca_p; + for (i=1, mca_p = sdp_p->mca_p; ((i < level) && (mca_p != NULL)); mca_p = mca_p->next_p, i++) { @@ -66,7 +31,7 @@ sdp_mca_t *sdp_find_media_level (sdp_t *sdp_p, u16 level) ; /* Do nothing. */ } } - + return (mca_p); } @@ -77,7 +42,7 @@ sdp_mca_t *sdp_find_media_level (sdp_t *sdp_p, u16 level) * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * Returns: TRUE or FALSE. */ -tinybool sdp_version_valid (void *sdp_ptr) +tinybool sdp_version_valid (void *sdp_ptr) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -97,7 +62,7 @@ tinybool sdp_version_valid (void *sdp_ptr) * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * Returns: Version value. */ -int32 sdp_get_version (void *sdp_ptr) +int32 sdp_get_version (void *sdp_ptr) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -115,7 +80,7 @@ int32 sdp_get_version (void *sdp_ptr) * version Version to set. * Returns: SDP_SUCCESS */ -sdp_result_e sdp_set_version (void *sdp_ptr, int32 version) +sdp_result_e sdp_set_version (void *sdp_ptr, int32 version) { sdp_t *sdp_p = (sdp_t*)sdp_ptr; @@ -129,11 +94,11 @@ sdp_result_e sdp_set_version (void *sdp_ptr, int32 version) /* Function: sdp_owner_valid * Description: Returns true or false depending on whether the owner - * token line has been defined for this SDP. + * token line has been defined for this SDP. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * Returns: TRUE or FALSE. */ -tinybool sdp_owner_valid (void *sdp_ptr) +tinybool sdp_owner_valid (void *sdp_ptr) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -153,12 +118,12 @@ tinybool sdp_owner_valid (void *sdp_ptr) /* Function: sdp_get_owner_username * Description: Returns a pointer to the value of the username parameter - * from the o= owner token line. Value is returned as a - * const ptr and so cannot be modified by the application. + * from the o= owner token line. Value is returned as a + * const ptr and so cannot be modified by the application. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * Returns: Version value. */ -const char *sdp_get_owner_username (void *sdp_ptr) +const char *sdp_get_owner_username (void *sdp_ptr) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -170,11 +135,11 @@ const char *sdp_get_owner_username (void *sdp_ptr) } /* Function: sdp_get_owner_sessionid - * Description: Returns the session id parameter from the o= owner token + * Description: Returns the session id parameter from the o= owner token * line. Because the value may be larger than 32 bits, this * parameter is returned as a string, though has been verified - * to be numeric. Value is returned as a const ptr and so - * cannot be modified by the application. + * to be numeric. Value is returned as a const ptr and so + * cannot be modified by the application. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * Returns: Ptr to owner session id or NULL. */ @@ -190,11 +155,11 @@ const char *sdp_get_owner_sessionid (void *sdp_ptr) } /* Function: sdp_get_owner_version - * Description: Returns the version parameter from the o= owner token + * Description: Returns the version parameter from the o= owner token * line. Because the value may be larger than 32 bits, this * parameter is returned as a string, though has been verified - * to be numeric. Value is returned as a const ptr and so - * cannot be modified by the application. + * to be numeric. Value is returned as a const ptr and so + * cannot be modified by the application. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * Returns: Ptr to owner version or NULL. */ @@ -210,7 +175,7 @@ const char *sdp_get_owner_version (void *sdp_ptr) } /* Function: sdp_get_owner_network_type - * Description: Returns the network type parameter from the o= owner token + * Description: Returns the network type parameter from the o= owner token * line. If network type has not been set SDP_NT_INVALID will * be returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. @@ -228,7 +193,7 @@ sdp_nettype_e sdp_get_owner_network_type (void *sdp_ptr) } /* Function: sdp_get_owner_address_type - * Description: Returns the address type parameter from the o= owner token + * Description: Returns the address type parameter from the o= owner token * line. If address type has not been set SDP_AT_INVALID will * be returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. @@ -246,9 +211,9 @@ sdp_addrtype_e sdp_get_owner_address_type (void *sdp_ptr) } /* Function: sdp_get_owner_address - * Description: Returns the address parameter from the o= owner token - * line. Value is returned as a const ptr and so - * cannot be modified by the application. + * Description: Returns the address parameter from the o= owner token + * line. Value is returned as a const ptr and so + * cannot be modified by the application. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * Returns: Ptr to address or NULL. */ @@ -330,7 +295,7 @@ sdp_result_e sdp_set_owner_version (void *sdp_ptr, const char *version) * network_type Network type for the owner line. * Returns: SDP_SUCCESS */ -sdp_result_e sdp_set_owner_network_type (void *sdp_ptr, +sdp_result_e sdp_set_owner_network_type (void *sdp_ptr, sdp_nettype_e network_type) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -350,7 +315,7 @@ sdp_result_e sdp_set_owner_network_type (void *sdp_ptr, * address_type Address type for the owner line. * Returns: SDP_SUCCESS */ -sdp_result_e sdp_set_owner_address_type (void *sdp_ptr, +sdp_result_e sdp_set_owner_address_type (void *sdp_ptr, sdp_addrtype_e address_type) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -385,7 +350,7 @@ sdp_result_e sdp_set_owner_address (void *sdp_ptr, const char *address) /* Function: sdp_session_name_valid * Description: Returns true or false depending on whether the session name - * s= token line has been defined for this SDP. + * s= token line has been defined for this SDP. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * Returns: TRUE or FALSE. */ @@ -406,8 +371,8 @@ tinybool sdp_session_name_valid (void *sdp_ptr) /* Function: sdp_get_session_name * Description: Returns the session name parameter from the s= session - * name token line. Value is returned as a const ptr and so - * cannot be modified by the application. + * name token line. Value is returned as a const ptr and so + * cannot be modified by the application. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * Returns: Ptr to session name or NULL. */ @@ -423,9 +388,9 @@ const char *sdp_get_session_name (void *sdp_ptr) } /* Function: sdp_set_session_name - * Description: Sets the value of the session name parameter for the s= - * session name token line. The string is copied into the - * SDP structure so application memory will not be + * Description: Sets the value of the session name parameter for the s= + * session name token line. The string is copied into the + * SDP structure so application memory will not be * referenced by the SDP lib. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * sessname Ptr to the session name string. @@ -445,7 +410,7 @@ sdp_result_e sdp_set_session_name (void *sdp_ptr, const char *sessname) /* Function: sdp_timespec_valid * Description: Returns true or false depending on whether the timespec t= - * token line has been defined for this SDP. + * token line has been defined for this SDP. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * Returns: TRUE or FALSE. */ @@ -467,11 +432,11 @@ tinybool sdp_timespec_valid (void *sdp_ptr) } /* Function: sdp_get_time_start - * Description: Returns the start time parameter from the t= timespec token + * Description: Returns the start time parameter from the t= timespec token * line. Because the value may be larger than 32 bits, this * parameter is returned as a string, though has been verified - * to be numeric. Value is returned as a const ptr and so - * cannot be modified by the application. + * to be numeric. Value is returned as a const ptr and so + * cannot be modified by the application. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * Returns: Ptr to start time or NULL. */ @@ -491,11 +456,11 @@ const char *sdp_get_time_start (void *sdp_ptr) } /* Function: sdp_get_time_stop - * Description: Returns the stop time parameter from the t= timespec token + * Description: Returns the stop time parameter from the t= timespec token * line. Because the value may be larger than 32 bits, this * parameter is returned as a string, though has been verified - * to be numeric. Value is returned as a const ptr and so - * cannot be modified by the application. + * to be numeric. Value is returned as a const ptr and so + * cannot be modified by the application. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * Returns: Ptr to stop time or NULL. */ @@ -515,9 +480,9 @@ const char *sdp_get_time_stop (void *sdp_ptr) } /* Function: sdp_set_time_start - * Description: Sets the value of the start time parameter for the t= - * timespec token line. The string is copied into the - * SDP structure so application memory will not be + * Description: Sets the value of the start time parameter for the t= + * timespec token line. The string is copied into the + * SDP structure so application memory will not be * referenced by the SDP lib. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * start_time Ptr to the start time string. @@ -540,15 +505,15 @@ sdp_result_e sdp_set_time_start (void *sdp_ptr, const char *start_time) sdp_p->timespec_p->start_time[0] = '\0'; sdp_p->timespec_p->stop_time[0] = '\0'; } - sstrncpy(sdp_p->timespec_p->start_time, start_time, + sstrncpy(sdp_p->timespec_p->start_time, start_time, sizeof(sdp_p->timespec_p->start_time)); return (SDP_SUCCESS); } /* Function: sdp_set_time_stop - * Description: Sets the value of the stop time parameter for the t= - * timespec token line. The string is copied into the - * SDP structure so application memory will not be + * Description: Sets the value of the stop time parameter for the t= + * timespec token line. The string is copied into the + * SDP structure so application memory will not be * referenced by the SDP lib. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * stop_time Ptr to the stop time string. @@ -571,17 +536,17 @@ sdp_result_e sdp_set_time_stop (void *sdp_ptr, const char *stop_time) sdp_p->timespec_p->start_time[0] = '\0'; sdp_p->timespec_p->stop_time[0] = '\0'; } - sstrncpy(sdp_p->timespec_p->stop_time, stop_time, + sstrncpy(sdp_p->timespec_p->stop_time, stop_time, sizeof(sdp_p->timespec_p->stop_time)); return (SDP_SUCCESS); } /* Function: sdp_encryption_valid * Description: Returns true or false depending on whether the encryption k= - * token line has been defined for this SDP at the given level. + * token line has been defined for this SDP at the given level. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the k= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a + * level The level to check for the k= line. Will be + * either SDP_SESSION_LEVEL or 1-n specifying a * media line level. * Returns: TRUE or FALSE. */ @@ -605,7 +570,7 @@ tinybool sdp_encryption_valid (void *sdp_ptr, u16 level) encrypt_p = &(mca_p->encrypt); } - if ((encrypt_p->encrypt_type == SDP_ENCRYPT_INVALID) || + if ((encrypt_p->encrypt_type == SDP_ENCRYPT_INVALID) || ((encrypt_p->encrypt_type != SDP_ENCRYPT_PROMPT) && (encrypt_p->encrypt_key[0] == '\0'))) { return (FALSE); @@ -615,12 +580,12 @@ tinybool sdp_encryption_valid (void *sdp_ptr, u16 level) } /* Function: sdp_get_encryption_method - * Description: Returns the encryption method parameter from the k= - * encryption token line. If encryption method has not been + * Description: Returns the encryption method parameter from the k= + * encryption token line. If encryption method has not been * set SDP_ENCRYPT_INVALID will be returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the c= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a + * level The level to check for the c= line. Will be + * either SDP_SESSION_LEVEL or 1-n specifying a * media line level. * Returns: Encryption method or SDP_ENCRYPT_INVALID. */ @@ -649,11 +614,11 @@ sdp_encrypt_type_e sdp_get_encryption_method (void *sdp_ptr, u16 level) /* Function: sdp_get_encryption_key * Description: Returns a pointer to the encryption key parameter - * from the k= encryption token line. Value is returned as a - * const ptr and so cannot be modified by the application. + * from the k= encryption token line. Value is returned as a + * const ptr and so cannot be modified by the application. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the c= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a + * level The level to check for the c= line. Will be + * either SDP_SESSION_LEVEL or 1-n specifying a * media line level. * Returns: Ptr to encryption key or NULL. */ @@ -681,11 +646,11 @@ const char *sdp_get_encryption_key (void *sdp_ptr, u16 level) } /* Function: sdp_set_encryption_method - * Description: Sets the value of the encryption method param for the k= + * Description: Sets the value of the encryption method param for the k= * encryption token line. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the k= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a + * level The level to check for the k= line. Will be + * either SDP_SESSION_LEVEL or 1-n specifying a * media line level. * type The encryption type. * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER @@ -711,19 +676,19 @@ sdp_result_e sdp_set_encryption_method (void *sdp_ptr, u16 level, } encrypt_p = &(mca_p->encrypt); } - + encrypt_p->encrypt_type = type; return (SDP_SUCCESS); } /* Function: sdp_set_encryption_key - * Description: Sets the value of the encryption key parameter for the k= - * encryption token line. The string is copied into the - * SDP structure so application memory will not be + * Description: Sets the value of the encryption key parameter for the k= + * encryption token line. The string is copied into the + * SDP structure so application memory will not be * referenced by the SDP lib. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the k= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a + * level The level to check for the k= line. Will be + * either SDP_SESSION_LEVEL or 1-n specifying a * media line level. * key Ptr to the encryption key string. * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER @@ -748,17 +713,17 @@ sdp_result_e sdp_set_encryption_key (void *sdp_ptr, u16 level, const char *key) } encrypt_p = &(mca_p->encrypt); } - + sstrncpy(encrypt_p->encrypt_key, key, sizeof(encrypt_p->encrypt_key)); return (SDP_SUCCESS); } /* Function: sdp_connection_valid * Description: Returns true or false depending on whether the connection c= - * token line has been defined for this SDP at the given level. + * token line has been defined for this SDP at the given level. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the c= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a + * level The level to check for the c= line. Will be + * either SDP_SESSION_LEVEL or 1-n specifying a * media line level. * Returns: TRUE or FALSE. */ @@ -781,14 +746,14 @@ tinybool sdp_connection_valid (void *sdp_ptr, u16 level) } conn_p = &(mca_p->conn); } - - /*if network type is ATM . then allow c= line without address type - * and address . This is a special case to cover PVC - */ - if (conn_p->nettype == SDP_NT_ATM && - conn_p->addrtype == SDP_AT_INVALID) { - return TRUE; - } + + /*if network type is ATM . then allow c= line without address type + * and address . This is a special case to cover PVC + */ + if (conn_p->nettype == SDP_NT_ATM && + conn_p->addrtype == SDP_AT_INVALID) { + return TRUE; + } if ((conn_p->nettype >= SDP_MAX_NETWORK_TYPES) || (conn_p->addrtype >= SDP_MAX_ADDR_TYPES) || @@ -801,12 +766,12 @@ tinybool sdp_connection_valid (void *sdp_ptr, u16 level) /* Function: sdp_bandwidth_valid * Description: Returns true or false depending on whether the bandwidth b= - * token line has been defined for this SDP at the given level. + * token line has been defined for this SDP at the given level. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the c= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a + * level The level to check for the c= line. Will be + * either SDP_SESSION_LEVEL or 1-n specifying a * media line level. - * inst_num instance number of bw line at that level. The first + * inst_num instance number of bw line at that level. The first * instance has a inst_num of 1 and so on. * Returns: TRUE or FALSE. */ @@ -819,9 +784,9 @@ tinybool sdp_bandwidth_valid (void *sdp_ptr, u16 level, u16 inst_num) return FALSE; } - bw_data_p = sdp_find_bw_line(sdp_p, level, inst_num); + bw_data_p = sdp_find_bw_line(sdp_p, level, inst_num); if (bw_data_p != NULL) { - if ((bw_data_p->bw_modifier < SDP_BW_MODIFIER_AS) || + if ((bw_data_p->bw_modifier < SDP_BW_MODIFIER_AS) || (bw_data_p->bw_modifier >= SDP_MAX_BW_MODIFIER_VAL)) { return FALSE; } else { @@ -836,12 +801,12 @@ tinybool sdp_bandwidth_valid (void *sdp_ptr, u16 level, u16 inst_num) * sdp_bw_line_exists * * Description: This api retruns true if there exists a bw line at the - * instance and level specified. + * instance and level specified. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the c= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a + * level The level to check for the c= line. Will be + * either SDP_SESSION_LEVEL or 1-n specifying a * media line level. - * inst_num instance number of bw line at that level. The first + * inst_num instance number of bw line at that level. The first * instance has a inst_num of 1 and so on. * Returns: TRUE or FALSE */ @@ -854,7 +819,7 @@ tinybool sdp_bw_line_exists (void *sdp_ptr, u16 level, u16 inst_num) return FALSE; } - bw_data_p = sdp_find_bw_line(sdp_p, level, inst_num); + bw_data_p = sdp_find_bw_line(sdp_p, level, inst_num); if (bw_data_p != NULL) { return TRUE; } else { @@ -863,12 +828,12 @@ tinybool sdp_bw_line_exists (void *sdp_ptr, u16 level, u16 inst_num) } /* Function: sdp_get_conn_nettype - * Description: Returns the network type parameter from the c= - * connection token line. If network type has not been + * Description: Returns the network type parameter from the c= + * connection token line. If network type has not been * set SDP_NT_INVALID will be returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the c= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a + * level The level to check for the c= line. Will be + * either SDP_SESSION_LEVEL or 1-n specifying a * media line level. * Returns: Network type or SDP_NT_INVALID. */ @@ -896,12 +861,12 @@ sdp_nettype_e sdp_get_conn_nettype (void *sdp_ptr, u16 level) } /* Function: sdp_get_conn_addrtype - * Description: Returns the address type parameter from the c= - * connection token line. If address type has not been + * Description: Returns the address type parameter from the c= + * connection token line. If address type has not been * set SDP_AT_INVALID will be returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the c= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a + * level The level to check for the c= line. Will be + * either SDP_SESSION_LEVEL or 1-n specifying a * media line level. * Returns: Address type or SDP_AT_INVALID. */ @@ -930,11 +895,11 @@ sdp_addrtype_e sdp_get_conn_addrtype (void *sdp_ptr, u16 level) /* Function: sdp_get_conn_address * Description: Returns a pointer to the address parameter - * from the c= connection token line. Value is returned as a - * const ptr and so cannot be modified by the application. + * from the c= connection token line. Value is returned as a + * const ptr and so cannot be modified by the application. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the c= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a + * level The level to check for the c= line. Will be + * either SDP_SESSION_LEVEL or 1-n specifying a * media line level. * Returns: Ptr to address or NULL. */ @@ -962,11 +927,11 @@ const char *sdp_get_conn_address (void *sdp_ptr, u16 level) } /* Function: sdp_is_mcast_addr - * Description: Returns a boolean to indicate if the addr is multicast in + * Description: Returns a boolean to indicate if the addr is multicast in * the c=line. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the c= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a + * level The level to check for the c= line. Will be + * either SDP_SESSION_LEVEL or 1-n specifying a * media line level. * Returns: TRUE if the addr is multicast, FALSE if not. */ @@ -976,22 +941,22 @@ tinybool sdp_is_mcast_addr (void *sdp_ptr, u16 level) sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_conn_t *conn_p; sdp_mca_t *mca_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (FALSE); } - + if (level == SDP_SESSION_LEVEL) { conn_p = &(sdp_p->default_conn); } else { mca_p = sdp_find_media_level(sdp_p, level); if (mca_p != NULL) { conn_p = &(mca_p->conn); - } else { + } else { return (FALSE); } } - + if ((conn_p) && (conn_p->is_multicast)) { return (TRUE); } else { @@ -1000,11 +965,11 @@ tinybool sdp_is_mcast_addr (void *sdp_ptr, u16 level) } /* Function: sdp_get_mcast_ttl - * Description: Get the time to live(ttl) value for the multicast address + * Description: Get the time to live(ttl) value for the multicast address * if present. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the c= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a + * level The level to check for the c= line. Will be + * either SDP_SESSION_LEVEL or 1-n specifying a * media line level. * Returns: Multicast address - Time to live (ttl) value */ @@ -1015,7 +980,7 @@ int32 sdp_get_mcast_ttl (void *sdp_ptr, u16 level) sdp_conn_t *conn_p; sdp_mca_t *mca_p; u16 ttl=0; - + if (sdp_verify_sdp_ptr(sdp_p) != FALSE) { if (level == SDP_SESSION_LEVEL) { conn_p = &(sdp_p->default_conn); @@ -1030,7 +995,7 @@ int32 sdp_get_mcast_ttl (void *sdp_ptr, u16 level) } else { return SDP_INVALID_VALUE; } - + if (conn_p) { ttl = conn_p->ttl; } @@ -1038,11 +1003,11 @@ int32 sdp_get_mcast_ttl (void *sdp_ptr, u16 level) } /* Function: sdp_get_mcast_num_of_addresses - * Description: Get the number of addresses value for the multicast address + * Description: Get the number of addresses value for the multicast address * if present. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the c= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a + * level The level to check for the c= line. Will be + * either SDP_SESSION_LEVEL or 1-n specifying a * media line level. * Returns: Multicast address - number of addresses value */ @@ -1053,7 +1018,7 @@ int32 sdp_get_mcast_num_of_addresses (void *sdp_ptr, u16 level) sdp_conn_t *conn_p; sdp_mca_t *mca_p; u16 num_addr = 0; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } else { @@ -1068,23 +1033,23 @@ int32 sdp_get_mcast_num_of_addresses (void *sdp_ptr, u16 level) } } } - + if (conn_p) { num_addr = conn_p->num_of_addresses; } return num_addr; } /* Function: sdp_set_conn_nettype - * Description: Sets the value of the network type parameter for the c= + * Description: Sets the value of the network type parameter for the c= * connection token line. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * nettype Network type for the connection line. - * level The level to check for the c= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a + * level The level to check for the c= line. Will be + * either SDP_SESSION_LEVEL or 1-n specifying a * media line level. * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER */ -sdp_result_e sdp_set_conn_nettype (void *sdp_ptr, u16 level, +sdp_result_e sdp_set_conn_nettype (void *sdp_ptr, u16 level, sdp_nettype_e nettype) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -1111,16 +1076,16 @@ sdp_result_e sdp_set_conn_nettype (void *sdp_ptr, u16 level, } /* Function: sdp_set_conn_addrtype - * Description: Sets the value of the address type parameter for the c= + * Description: Sets the value of the address type parameter for the c= * connection token line. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * addrtype Address type for the connection line. - * level The level to check for the c= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a + * level The level to check for the c= line. Will be + * either SDP_SESSION_LEVEL or 1-n specifying a * media line level. * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER */ -sdp_result_e sdp_set_conn_addrtype (void *sdp_ptr, u16 level, +sdp_result_e sdp_set_conn_addrtype (void *sdp_ptr, u16 level, sdp_addrtype_e addrtype) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -1147,18 +1112,18 @@ sdp_result_e sdp_set_conn_addrtype (void *sdp_ptr, u16 level, } /* Function: sdp_set_conn_address - * Description: Sets the value of the address parameter for the c= - * connection token line. The string is copied into the - * SDP structure so application memory will not be + * Description: Sets the value of the address parameter for the c= + * connection token line. The string is copied into the + * SDP structure so application memory will not be * referenced by the SDP lib. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the c= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a + * level The level to check for the c= line. Will be + * either SDP_SESSION_LEVEL or 1-n specifying a * media line level. * address Ptr to the address string. * Returns: SDP_SUCCESS */ -sdp_result_e sdp_set_conn_address (void *sdp_ptr, u16 level, +sdp_result_e sdp_set_conn_address (void *sdp_ptr, u16 level, const char *address) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -1185,18 +1150,18 @@ sdp_result_e sdp_set_conn_address (void *sdp_ptr, u16 level, } /* Function: sdp_set_mcast_addr_fields - * Description: Sets the value of the ttl and num of addresses for + * Description: Sets the value of the ttl and num of addresses for * a multicast address. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the c= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a + * level The level to check for the c= line. Will be + * either SDP_SESSION_LEVEL or 1-n specifying a * media line level. * ttl Time to live (ttl) value. * num_of_addresses number of addresses . * Returns: SDP_SUCCESS */ -sdp_result_e sdp_set_mcast_addr_fields(void *sdp_ptr, u16 level, +sdp_result_e sdp_set_mcast_addr_fields(void *sdp_ptr, u16 level, u16 ttl, u16 num_of_addresses) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -1225,19 +1190,19 @@ sdp_result_e sdp_set_mcast_addr_fields(void *sdp_ptr, u16 level, } conn_p->num_of_addresses = num_of_addresses; } else { - return (SDP_FAILURE); + return (SDP_FAILURE); } return (SDP_SUCCESS); } /* Function: sdp_media_line_valid - * Description: Returns true or false depending on whether the specified + * Description: Returns true or false depending on whether the specified * media line m= has been defined for this SDP. The * SDP_SESSION_LEVEL level is not valid for this check since, * by definition, this is a media level. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the c= line. Will be + * level The level to check for the c= line. Will be * 1-n specifying a media line level. * Returns: TRUE or FALSE. */ @@ -1283,8 +1248,8 @@ u16 sdp_get_num_media_lines (void *sdp_ptr) } /* Function: sdp_get_media_type - * Description: Returns the media type parameter from the m= - * media token line. If media type has not been + * Description: Returns the media type parameter from the m= + * media token line. If media type has not been * set SDP_MEDIA_INVALID will be returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level The level to of the m= media line. Will be 1-n. @@ -1308,8 +1273,8 @@ sdp_media_e sdp_get_media_type (void *sdp_ptr, u16 level) } /* Function: sdp_get_media_port_format - * Description: Returns the port format type associated with the m= - * media token line. If port format type has not been + * Description: Returns the port format type associated with the m= + * media token line. If port format type has not been * set SDP_PORT_FORMAT_INVALID will be returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level The level to of the m= media line. Will be 1-n. @@ -1333,8 +1298,8 @@ sdp_port_format_e sdp_get_media_port_format (void *sdp_ptr, u16 level) } /* Function: sdp_get_media_portnum - * Description: Returns the port number associated with the m= - * media token line. If port number has not been + * Description: Returns the port number associated with the m= + * media token line. If port number has not been * set SDP_INVALID_VALUE will be returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level The level to of the m= media line. Will be 1-n. @@ -1360,7 +1325,7 @@ int32 sdp_get_media_portnum (void *sdp_ptr, u16 level) (mca_p->port_format != SDP_PORT_NUM_VPI_VCI) && (mca_p->port_format != SDP_PORT_NUM_VPI_VCI_CID)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - SDP_ERROR("%s Port num not valid for media line %u", + SDP_ERROR("%s Port num not valid for media line %u", sdp_p->debug_str, level); } sdp_p->conf_p->num_invalid_param++; @@ -1371,8 +1336,8 @@ int32 sdp_get_media_portnum (void *sdp_ptr, u16 level) } /* Function: sdp_get_media_portcount - * Description: Returns the port count associated with the m= - * media token line. If port count has not been + * Description: Returns the port count associated with the m= + * media token line. If port count has not been * set SDP_INVALID_VALUE will be returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level The level to of the m= media line. Will be 1-n. @@ -1395,7 +1360,7 @@ int32 sdp_get_media_portcount (void *sdp_ptr, u16 level) /* Make sure port number is valid for the specified format. */ if (mca_p->port_format != SDP_PORT_NUM_COUNT) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - SDP_ERROR("%s Port count not valid for media line %u", + SDP_ERROR("%s Port count not valid for media line %u", sdp_p->debug_str, level); } sdp_p->conf_p->num_invalid_param++; @@ -1406,8 +1371,8 @@ int32 sdp_get_media_portcount (void *sdp_ptr, u16 level) } /* Function: sdp_get_media_vpi - * Description: Returns the VPI parameter associated with the m= - * media token line. If VPI has not been set + * Description: Returns the VPI parameter associated with the m= + * media token line. If VPI has not been set * SDP_INVALID_VALUE will be returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level The level to of the m= media line. Will be 1-n. @@ -1428,11 +1393,11 @@ int32 sdp_get_media_vpi (void *sdp_ptr, u16 level) } /* Make sure port number is valid for the specified format. */ - if ((mca_p->port_format != SDP_PORT_VPI_VCI) && - (mca_p->port_format != SDP_PORT_NUM_VPI_VCI) && + if ((mca_p->port_format != SDP_PORT_VPI_VCI) && + (mca_p->port_format != SDP_PORT_NUM_VPI_VCI) && (mca_p->port_format != SDP_PORT_NUM_VPI_VCI_CID)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - SDP_ERROR("%s VPI not valid for media line %u", + SDP_ERROR("%s VPI not valid for media line %u", sdp_p->debug_str, level); } sdp_p->conf_p->num_invalid_param++; @@ -1443,8 +1408,8 @@ int32 sdp_get_media_vpi (void *sdp_ptr, u16 level) } /* Function: sdp_get_media_vci - * Description: Returns the VCI parameter associated with the m= - * media token line. If VCI has not been set + * Description: Returns the VCI parameter associated with the m= + * media token line. If VCI has not been set * SDP_INVALID_VALUE will be returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level The level to of the m= media line. Will be 1-n. @@ -1465,11 +1430,11 @@ u32 sdp_get_media_vci (void *sdp_ptr, u16 level) } /* Make sure port number is valid for the specified format. */ - if ((mca_p->port_format != SDP_PORT_VPI_VCI) && - (mca_p->port_format != SDP_PORT_NUM_VPI_VCI) && + if ((mca_p->port_format != SDP_PORT_VPI_VCI) && + (mca_p->port_format != SDP_PORT_NUM_VPI_VCI) && (mca_p->port_format != SDP_PORT_NUM_VPI_VCI_CID)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - SDP_ERROR("%s VCI not valid for media line %u", + SDP_ERROR("%s VCI not valid for media line %u", sdp_p->debug_str, level); } sdp_p->conf_p->num_invalid_param++; @@ -1480,8 +1445,8 @@ u32 sdp_get_media_vci (void *sdp_ptr, u16 level) } /* Function: sdp_get_media_vcci - * Description: Returns the VCCI parameter associated with the m= - * media token line. If VCCI has not been set + * Description: Returns the VCCI parameter associated with the m= + * media token line. If VCCI has not been set * SDP_INVALID_VALUE will be returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level The level to of the m= media line. Will be 1-n. @@ -1502,10 +1467,10 @@ int32 sdp_get_media_vcci (void *sdp_ptr, u16 level) } /* Make sure port number is valid for the specified format. */ - if ((mca_p->port_format != SDP_PORT_VCCI) && + if ((mca_p->port_format != SDP_PORT_VCCI) && (mca_p->port_format != SDP_PORT_VCCI_CID)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - SDP_ERROR("%s VCCI not valid for media line %u", + SDP_ERROR("%s VCCI not valid for media line %u", sdp_p->debug_str, level); } sdp_p->conf_p->num_invalid_param++; @@ -1516,8 +1481,8 @@ int32 sdp_get_media_vcci (void *sdp_ptr, u16 level) } /* Function: sdp_get_media_cid - * Description: Returns the CID parameter associated with the m= - * media token line. If CID has not been set + * Description: Returns the CID parameter associated with the m= + * media token line. If CID has not been set * SDP_INVALID_VALUE will be returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level The level to of the m= media line. Will be 1-n. @@ -1538,10 +1503,10 @@ int32 sdp_get_media_cid (void *sdp_ptr, u16 level) } /* Make sure port number is valid for the specified format. */ - if ((mca_p->port_format != SDP_PORT_VCCI_CID) && + if ((mca_p->port_format != SDP_PORT_VCCI_CID) && (mca_p->port_format != SDP_PORT_NUM_VPI_VCI_CID)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - SDP_ERROR("%s CID not valid for media line %u", + SDP_ERROR("%s CID not valid for media line %u", sdp_p->debug_str, level); } sdp_p->conf_p->num_invalid_param++; @@ -1552,8 +1517,8 @@ int32 sdp_get_media_cid (void *sdp_ptr, u16 level) } /* Function: sdp_get_media_transport - * Description: Returns the transport type parameter associated with the m= - * media token line. If transport type has not been set + * Description: Returns the transport type parameter associated with the m= + * media token line. If transport type has not been set * SDP_TRANSPORT_INVALID will be returned. If the transport * type is one of the AAL2 variants, the profile routines below * should be used to access multiple profile types and payload @@ -1580,7 +1545,7 @@ sdp_transport_e sdp_get_media_transport (void *sdp_ptr, u16 level) } /* Function: sdp_get_media_num_profiles - * Description: Returns the number of profiles associated with the m= + * Description: Returns the number of profiles associated with the m= * media token line. If the media line is invalid, zero will * be returned. Application must validate the media line * before using this routine. Multiple profile types per @@ -1614,17 +1579,17 @@ u16 sdp_get_media_num_profiles (void *sdp_ptr, u16 level) } /* Function: sdp_get_media_profile - * Description: Returns the specified profile type associated with the m= - * media token line. If the media line or profile number is - * invalid, SDP_TRANSPORT_INVALID will be returned. - * Applications must validate the media line before using this - * routine. + * Description: Returns the specified profile type associated with the m= + * media token line. If the media line or profile number is + * invalid, SDP_TRANSPORT_INVALID will be returned. + * Applications must validate the media line before using this + * routine. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level The level to of the m= media line. Will be 1-n. * profile_num The specific profile type number to be retrieved. * Returns: The profile type or SDP_TRANSPORT_INVALID. */ -sdp_transport_e sdp_get_media_profile (void *sdp_ptr, u16 level, +sdp_transport_e sdp_get_media_profile (void *sdp_ptr, u16 level, u16 profile_num) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -1648,7 +1613,7 @@ sdp_transport_e sdp_get_media_profile (void *sdp_ptr, u16 level, } /* Function: sdp_get_media_num_payload_types - * Description: Returns the number of payload types associated with the m= + * Description: Returns the number of payload types associated with the m= * media token line. If the media line is invalid, zero will * be returned. Application must validate the media line * before using this routine. @@ -1674,8 +1639,8 @@ u16 sdp_get_media_num_payload_types (void *sdp_ptr, u16 level) } /* Function: sdp_get_media_profile_num_payload_types - * Description: Returns the number of payload types associated with the - * specified profile on the m= media token line. If the + * Description: Returns the number of payload types associated with the + * specified profile on the m= media token line. If the * media line or profile number is invalid, zero will * be returned. Application must validate the media line * and profile before using this routine. @@ -1708,9 +1673,9 @@ u16 sdp_get_media_profile_num_payload_types (void *sdp_ptr, u16 level, } /* Function: sdp_get_media_payload_type - * Description: Returns the payload type of the specified payload for the m= - * media token line. If the media line or payload number is - * invalid, zero will be returned. Application must validate + * Description: Returns the payload type of the specified payload for the m= + * media token line. If the media line or payload number is + * invalid, zero will be returned. Application must validate * the media line before using this routine. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level The level to of the m= media line. Will be 1-n. @@ -1768,7 +1733,7 @@ u32 sdp_get_media_payload_type (void *sdp_ptr, u16 level, u16 payload_num, } if (cpr_strcasecmp(encname, SIPSDP_ATTR_ENCNAME_L16_256K) == 0) { return (SET_PAYLOAD_TYPE_WITH_DYNAMIC(ptype, RTP_L16)); - } + } if (cpr_strcasecmp(encname, SIPSDP_ATTR_ENCNAME_ISAC) == 0) { return (SET_PAYLOAD_TYPE_WITH_DYNAMIC(ptype, RTP_ISAC)); } @@ -1785,7 +1750,7 @@ u32 sdp_get_media_payload_type (void *sdp_ptr, u16 level, u16 payload_num, } if (cpr_strcasecmp(encname, SIPSDP_ATTR_ENCNAME_VP8) == 0) { return (SET_PAYLOAD_TYPE_WITH_DYNAMIC(ptype, RTP_VP8)); - } + } } } } @@ -1794,9 +1759,9 @@ u32 sdp_get_media_payload_type (void *sdp_ptr, u16 level, u16 payload_num, } /* Function: sdp_get_media_profile_payload_type - * Description: Returns the payload type of the specified payload for the m= - * media token line. If the media line or payload number is - * invalid, zero will be returned. Application must validate + * Description: Returns the payload type of the specified payload for the m= + * media token line. If the media line or payload number is + * invalid, zero will be returned. Application must validate * the media line before using this routine. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level The level to of the m= media line. Will be 1-n. @@ -1807,7 +1772,7 @@ u32 sdp_get_media_payload_type (void *sdp_ptr, u16 level, u16 payload_num, * Returns: Payload type or zero. */ u32 sdp_get_media_profile_payload_type (void *sdp_ptr, u16 level, u16 prof_num, - u16 payload_num, + u16 payload_num, sdp_payload_ind_e *indicator) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -1829,7 +1794,7 @@ u32 sdp_get_media_profile_payload_type (void *sdp_ptr, u16 level, u16 prof_num, return (0); } - if ((payload_num < 1) || + if ((payload_num < 1) || (payload_num > prof_p->num_payloads[prof_num-1])) { return (0); } @@ -1839,7 +1804,7 @@ u32 sdp_get_media_profile_payload_type (void *sdp_ptr, u16 level, u16 prof_num, } /* Function: sdp_insert_media_line - * Description: Insert a new media line at the level specified for the + * Description: Insert a new media line at the level specified for the * given SDP. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level The new media level to insert. Will be 1-n. @@ -1876,7 +1841,7 @@ sdp_result_e sdp_insert_media_line (void *sdp_ptr, u16 level) new_mca_p->next_p = sdp_p->mca_p; sdp_p->mca_p = new_mca_p; } else { - /* Find the pointer to the media stream just prior to where + /* Find the pointer to the media stream just prior to where * we want to insert the new stream. */ mca_p = sdp_find_media_level(sdp_p, (u16)(level-1)); @@ -1895,7 +1860,7 @@ sdp_result_e sdp_insert_media_line (void *sdp_ptr, u16 level) } /* Function: sdp_delete_media_line - * Description: Delete the media line at the level specified for the + * Description: Delete the media line at the level specified for the * given SDP. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level The media level to delete. Will be 1-n. @@ -1915,7 +1880,7 @@ void sdp_delete_media_line (void *sdp_ptr, u16 level) return; } - /* If we're not deleting media line 1, then we need a pointer + /* If we're not deleting media line 1, then we need a pointer * to the previous media line so we can relink. */ if (level == 1) { mca_p = sdp_find_media_level(sdp_p, level); @@ -1960,7 +1925,7 @@ void sdp_delete_media_line (void *sdp_ptr, u16 level) } /* Function: sdp_set_media_type - * Description: Sets the value of the media type parameter for the m= + * Description: Sets the value of the media type parameter for the m= * media token line. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level The media level to set the param. Will be 1-n. @@ -1987,17 +1952,17 @@ sdp_result_e sdp_set_media_type (void *sdp_ptr, u16 level, sdp_media_e media) } /* Function: sdp_set_media_port_format - * Description: Sets the value of the port format parameter for the m= + * Description: Sets the value of the port format parameter for the m= * media token line. Note that this parameter must be set - * before any of the port type specific parameters. If a - * parameter is not valid according to the port format + * before any of the port type specific parameters. If a + * parameter is not valid according to the port format * specified, an attempt to set the parameter will fail. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level The media level to set the param. Will be 1-n. * port_format Media type for the media line. * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER */ -sdp_result_e sdp_set_media_port_format (void *sdp_ptr, u16 level, +sdp_result_e sdp_set_media_port_format (void *sdp_ptr, u16 level, sdp_port_format_e port_format) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -2018,7 +1983,7 @@ sdp_result_e sdp_set_media_port_format (void *sdp_ptr, u16 level, } /* Function: sdp_set_media_portnum - * Description: Sets the value of the port number parameter for the m= + * Description: Sets the value of the port number parameter for the m= * media token line. If the port number is not valid with the * port format specified for the media line, this call will * fail. @@ -2049,7 +2014,7 @@ sdp_result_e sdp_set_media_portnum (void *sdp_ptr, u16 level, int32 portnum, int } /* Function: sdp_set_media_portcount - * Description: Sets the value of the port count parameter for the m= + * Description: Sets the value of the port count parameter for the m= * media token line. If the port count is not valid with the * port format specified for the media line, this call will * fail. @@ -2058,7 +2023,7 @@ sdp_result_e sdp_set_media_portnum (void *sdp_ptr, u16 level, int32 portnum, int * num_ports Port count to set. * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER */ -sdp_result_e sdp_set_media_portcount (void *sdp_ptr, u16 level, +sdp_result_e sdp_set_media_portcount (void *sdp_ptr, u16 level, int32 num_ports) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -2079,7 +2044,7 @@ sdp_result_e sdp_set_media_portcount (void *sdp_ptr, u16 level, } /* Function: sdp_set_media_vpi - * Description: Sets the value of the VPI parameter for the m= + * Description: Sets the value of the VPI parameter for the m= * media token line. If the VPI is not valid with the * port format specified for the media line, this call will * fail. @@ -2108,7 +2073,7 @@ sdp_result_e sdp_set_media_vpi (void *sdp_ptr, u16 level, int32 vpi) } /* Function: sdp_set_media_vci - * Description: Sets the value of the VCI parameter for the m= + * Description: Sets the value of the VCI parameter for the m= * media token line. If the VCI is not valid with the * port format specified for the media line, this call will * fail. @@ -2137,7 +2102,7 @@ sdp_result_e sdp_set_media_vci (void *sdp_ptr, u16 level, u32 vci) } /* Function: sdp_set_media_vcci - * Description: Sets the value of the VCCI parameter for the m= + * Description: Sets the value of the VCCI parameter for the m= * media token line. If the VCCI is not valid with the * port format specified for the media line, this call will * fail. @@ -2166,7 +2131,7 @@ sdp_result_e sdp_set_media_vcci (void *sdp_ptr, u16 level, int32 vcci) } /* Function: sdp_set_media_cid - * Description: Sets the value of the CID parameter for the m= + * Description: Sets the value of the CID parameter for the m= * media token line. If the CID is not valid with the * port format specified for the media line, this call will * fail. @@ -2195,14 +2160,14 @@ sdp_result_e sdp_set_media_cid (void *sdp_ptr, u16 level, int32 cid) } /* Function: sdp_set_media_transport - * Description: Sets the value of the transport type parameter for the m= + * Description: Sets the value of the transport type parameter for the m= * media token line. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level The media level to set the param. Will be 1-n. * transport The transport type to set. * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER */ -sdp_result_e sdp_set_media_transport (void *sdp_ptr, u16 level, +sdp_result_e sdp_set_media_transport (void *sdp_ptr, u16 level, sdp_transport_e transport) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -2232,7 +2197,7 @@ sdp_result_e sdp_set_media_transport (void *sdp_ptr, u16 level, * profile The profile type to add. * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER */ -sdp_result_e sdp_add_media_profile (void *sdp_ptr, u16 level, +sdp_result_e sdp_add_media_profile (void *sdp_ptr, u16 level, sdp_transport_e profile) { u16 prof_num; @@ -2278,7 +2243,7 @@ sdp_result_e sdp_add_media_profile (void *sdp_ptr, u16 level, } /* Function: sdp_add_media_payload_type - * Description: Add a new payload type for the media line at the level + * Description: Add a new payload type for the media line at the level * specified. The new payload type will be added at the end * of the payload type list. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. @@ -2288,8 +2253,8 @@ sdp_result_e sdp_add_media_profile (void *sdp_ptr, u16 level, * NUMERIC or ENUM. * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER */ -sdp_result_e sdp_add_media_payload_type (void *sdp_ptr, u16 level, - u16 payload_type, +sdp_result_e sdp_add_media_payload_type (void *sdp_ptr, u16 level, + u16 payload_type, sdp_payload_ind_e indicator) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -2320,7 +2285,7 @@ sdp_result_e sdp_add_media_payload_type (void *sdp_ptr, u16 level, } /* Function: sdp_add_media_profile_payload_type - * Description: Add a new payload type for the media line at the level + * Description: Add a new payload type for the media line at the level * specified. The new payload type will be added at the end * of the payload type list. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. @@ -2331,7 +2296,7 @@ sdp_result_e sdp_add_media_payload_type (void *sdp_ptr, u16 level, * NUMERIC or ENUM. * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER */ -sdp_result_e sdp_add_media_profile_payload_type (void *sdp_ptr, u16 level, +sdp_result_e sdp_add_media_profile_payload_type (void *sdp_ptr, u16 level, u16 prof_num, u16 payload_type, sdp_payload_ind_e indicator) { @@ -2359,11 +2324,11 @@ sdp_result_e sdp_add_media_profile_payload_type (void *sdp_ptr, u16 level, return (SDP_INVALID_PARAMETER); } - if (mca_p->media_profiles_p->num_payloads[prof_num-1] == + if (mca_p->media_profiles_p->num_payloads[prof_num-1] == SDP_MAX_PAYLOAD_TYPES) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s Max number of profile payload types already " - "defined profile %u on media line %u", + "defined profile %u on media line %u", sdp_p->debug_str, prof_num, level); } sdp_p->conf_p->num_invalid_param++; @@ -2395,11 +2360,11 @@ sdp_bw_data_t* sdp_find_bw_line (void *sdp_ptr, u16 level, u16 inst_num) sdp_bw_data_t *bw_data_p; sdp_mca_t *mca_p; int bw_attr_count=0; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (NULL); } - + if (level == SDP_SESSION_LEVEL) { bw_p = &(sdp_p->bw); } else { @@ -2411,8 +2376,8 @@ sdp_bw_data_t* sdp_find_bw_line (void *sdp_ptr, u16 level, u16 inst_num) bw_p = &(mca_p->bw); } - for (bw_data_p = bw_p->bw_data_list; - bw_data_p != NULL; + for (bw_data_p = bw_p->bw_data_list; + bw_data_p != NULL; bw_data_p = bw_data_p->next_p) { bw_attr_count++; if (bw_attr_count == inst_num) { @@ -2434,7 +2399,7 @@ sdp_bw_data_t* sdp_find_bw_line (void *sdp_ptr, u16 level, u16 inst_num) * src_level The level in the src sdp from where to get the * attributes. * dst_level The level in the dst sdp where to put the - * attributes. + * attributes. * Returns: SDP_SUCCESS Attributes were successfully copied. */ sdp_result_e sdp_copy_all_bw_lines (void *src_sdp_ptr, void *dst_sdp_ptr, @@ -2456,8 +2421,8 @@ sdp_result_e sdp_copy_all_bw_lines (void *src_sdp_ptr, void *dst_sdp_ptr, if (sdp_verify_sdp_ptr(dst_sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - - /* Find src bw list */ + + /* Find src bw list */ if (src_level == SDP_SESSION_LEVEL) { src_bw_p = &(src_sdp_p->bw); } else { @@ -2472,7 +2437,7 @@ sdp_result_e sdp_copy_all_bw_lines (void *src_sdp_ptr, void *dst_sdp_ptr, src_bw_p = &(mca_p->bw); } - /* Find dst bw list */ + /* Find dst bw list */ if (dst_level == SDP_SESSION_LEVEL) { dst_bw_p = &(dst_sdp_p->bw); } else { @@ -2500,15 +2465,15 @@ sdp_result_e sdp_copy_all_bw_lines (void *src_sdp_ptr, void *dst_sdp_ptr, /* * Enqueue the sdp_bw_data_t instance at the end of the list of - * sdp_bw_data_t instances. + * sdp_bw_data_t instances. */ if (dst_bw_p->bw_data_list == NULL) { dst_bw_p->bw_data_list = new_bw_data_p; } else { - for (bw_data_p = dst_bw_p->bw_data_list; + for (bw_data_p = dst_bw_p->bw_data_list; bw_data_p->next_p != NULL; bw_data_p = bw_data_p->next_p) { - + /*sa_ignore EMPTYLOOP*/ ; /* Do nothing. */ } @@ -2524,13 +2489,13 @@ sdp_result_e sdp_copy_all_bw_lines (void *src_sdp_ptr, void *dst_sdp_ptr, } /* Function: sdp_get_bw_modifier - * Description: Returns the bandwidth modifier parameter from the b= + * Description: Returns the bandwidth modifier parameter from the b= * line. If no bw modifier has been set , * SDP_BW_MODIFIER_UNSUPPORTED will be returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level The level from which to get the bw modifier. - * inst_num instance number of bw line at that level. The first - * instance has a inst_num of 1 and so on. + * inst_num instance number of bw line at that level. The first + * instance has a inst_num of 1 and so on. * Returns: Valid modifer value or SDP_BW_MODIFIER_UNSUPPORTED. */ sdp_bw_modifier_e sdp_get_bw_modifier (void *sdp_ptr, u16 level, u16 inst_num) @@ -2541,23 +2506,23 @@ sdp_bw_modifier_e sdp_get_bw_modifier (void *sdp_ptr, u16 level, u16 inst_num) if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_BW_MODIFIER_UNSUPPORTED); } - + bw_data_p = sdp_find_bw_line(sdp_p, level, inst_num); if (bw_data_p) { return (bw_data_p->bw_modifier); } else { return (SDP_BW_MODIFIER_UNSUPPORTED); - } + } } /* Function: sdp_get_bw_value - * Description: Returns the bandwidth value parameter from the b= - * line. + * Description: Returns the bandwidth value parameter from the b= + * line. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level The level from which to get the bw value. - * inst_num instance number of bw line at the level. The first - * instance has a inst_num of 1 and so on. + * inst_num instance number of bw line at the level. The first + * instance has a inst_num of 1 and so on. * Returns: A valid numerical bw value or SDP_INVALID_VALUE. */ int32 sdp_get_bw_value (void *sdp_ptr, u16 level, u16 inst_num) @@ -2568,7 +2533,7 @@ int32 sdp_get_bw_value (void *sdp_ptr, u16 level, u16 inst_num) if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - + bw_data_p = sdp_find_bw_line(sdp_p, level, inst_num); if (bw_data_p) { @@ -2593,11 +2558,11 @@ int32 sdp_get_num_bw_lines (void *sdp_ptr, u16 level) sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_bw_t *bw_p; sdp_mca_t *mca_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - + if (level == SDP_SESSION_LEVEL) { bw_p = &(sdp_p->bw); } else { @@ -2617,14 +2582,14 @@ int32 sdp_get_num_bw_lines (void *sdp_ptr, u16 level) * * To specify bandwidth parameters at any level, a bw line must first be * added at that level using this function. After this addition, you can set - * the properties of the added bw line by using sdp_set_bw(). + * the properties of the added bw line by using sdp_set_bw(). * * Note carefully though, that since there can be multiple instances of bw - * lines at any level, you must specify the instance number when setting - * or getting the properties of a bw line at any level. + * lines at any level, you must specify the instance number when setting + * or getting the properties of a bw line at any level. * * This function returns within the inst_num variable, the instance number - * of the created bw_line at that level. The instance number is 1-based. + * of the created bw_line at that level. The instance number is 1-based. * For example: * v=0 #Session Level * o=mhandley 2890844526 2890842807 IN IP4 126.16.64.4 @@ -2638,10 +2603,10 @@ int32 sdp_get_num_bw_lines (void *sdp_ptr, u16 level) * b=TIAS:8480 # instance number 2 * m=audio 1234 RTP/AVP 0 101 102 # 2nd Media level * b=AS:20 # instance number 1 - * + * * Parameters: * sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to create the bw line. + * level The level to create the bw line. * bw_modifier The Type of bandwidth, CT, AS or TIAS. * *inst_num This memory is set with the instance number of the newly * created bw line instance. @@ -2655,11 +2620,11 @@ sdp_result_e sdp_add_new_bw_line (void *sdp_ptr, u16 level, sdp_bw_modifier_e bw sdp_bw_data_t *bw_data_p = NULL; *inst_num = 0; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - + if (level == SDP_SESSION_LEVEL) { bw_p = &(sdp_p->bw); } else { @@ -2691,26 +2656,26 @@ sdp_result_e sdp_add_new_bw_line (void *sdp_ptr, u16 level, sdp_bw_modifier_e bw new_bw_data_p->next_p = NULL; new_bw_data_p->bw_modifier = SDP_BW_MODIFIER_UNSUPPORTED; new_bw_data_p->bw_val = 0; - + /* * Enqueue the sdp_bw_data_t instance at the end of the list of - * sdp_bw_data_t instances. + * sdp_bw_data_t instances. */ if (bw_p->bw_data_list == NULL) { bw_p->bw_data_list = new_bw_data_p; } else { - for (bw_data_p = bw_p->bw_data_list; + for (bw_data_p = bw_p->bw_data_list; bw_data_p->next_p != NULL; bw_data_p = bw_data_p->next_p) { /*sa_ignore EMPTYLOOP*/ ; /* Do nothing. */ } - + bw_data_p->next_p = new_bw_data_p; } *inst_num = ++bw_p->bw_data_count; - + return (SDP_SUCCESS); } @@ -2718,9 +2683,9 @@ sdp_result_e sdp_add_new_bw_line (void *sdp_ptr, u16 level, sdp_bw_modifier_e bw * sdp_delete_bw_line * * Deletes the bw line instance at the specified level. - * + * * sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to delete the bw line. + * level The level to delete the bw line. * inst_num The instance of the bw line to delete. */ sdp_result_e sdp_delete_bw_line (void *sdp_ptr, u16 level, u16 inst_num) @@ -2731,11 +2696,11 @@ sdp_result_e sdp_delete_bw_line (void *sdp_ptr, u16 level, u16 inst_num) sdp_bw_data_t *bw_data_p = NULL; sdp_bw_data_t *prev_bw_data_p = NULL; int bw_data_count = 0; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - + if (level == SDP_SESSION_LEVEL) { bw_p = &(sdp_p->bw); } else { @@ -2760,7 +2725,7 @@ sdp_result_e sdp_delete_bw_line (void *sdp_ptr, u16 level, u16 inst_num) if (bw_data_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - SDP_ERROR("%s bw line instance %d not found.", + SDP_ERROR("%s bw line instance %d not found.", sdp_p->debug_str, inst_num); } sdp_p->conf_p->num_invalid_param++; @@ -2770,10 +2735,10 @@ sdp_result_e sdp_delete_bw_line (void *sdp_ptr, u16 level, u16 inst_num) if (prev_bw_data_p == NULL) { bw_p->bw_data_list = bw_data_p->next_p; } else { - prev_bw_data_p->next_p = bw_data_p->next_p; + prev_bw_data_p->next_p = bw_data_p->next_p; } bw_p->bw_data_count--; - + SDP_FREE(bw_data_p); return (SDP_SUCCESS); } @@ -2786,11 +2751,11 @@ sdp_result_e sdp_delete_bw_line (void *sdp_ptr, u16 level, u16 inst_num) * * Parameters: * sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to at which the bw line resides. + * level The level to at which the bw line resides. * inst_num The instance number of the bw line that is to be set. * bw_modifier The Type of bandwidth, CT, AS or TIAS. * bw_val Numerical bandwidth value. - * + * * NOTE: Before calling this function to set the bw line, the bw line must * be added using sdp_add_new_bw_line at the required level. */ @@ -2804,7 +2769,7 @@ sdp_result_e sdp_set_bw (void *sdp_ptr, u16 level, u16 inst_num, return (SDP_INVALID_SDP_PTR); } - if ((bw_modifier < SDP_BW_MODIFIER_AS) || + if ((bw_modifier < SDP_BW_MODIFIER_AS) || (bw_modifier >= SDP_MAX_BW_MODIFIER_VAL)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s Invalid bw modifier type: %d.", @@ -2813,7 +2778,7 @@ sdp_result_e sdp_set_bw (void *sdp_ptr, u16 level, u16 inst_num, sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } - + bw_data_p = sdp_find_bw_line(sdp_p, level, inst_num); if (bw_data_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -2830,7 +2795,7 @@ sdp_result_e sdp_set_bw (void *sdp_ptr, u16 level, u16 inst_num, } /* Function: sdp_get_mid_value - * Description: Returns the mid value parameter from the a= mid: line. + * Description: Returns the mid value parameter from the a= mid: line. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level SDP_MEDIA_LEVEL * Returns: mid value. @@ -2839,11 +2804,11 @@ int32 sdp_get_mid_value (void *sdp_ptr, u16 level) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_mca_t *mca_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - + mca_p = sdp_find_media_level(sdp_p, level); if (mca_p == NULL) { sdp_p->conf_p->num_invalid_param++; @@ -2853,7 +2818,7 @@ int32 sdp_get_mid_value (void *sdp_ptr, u16 level) } /* Function: sdp_set_mid_value - * Description: Sets the value of the mid value for the + * Description: Sets the value of the mid value for the * a= mid: line. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level SDP_MEDIA_LEVEL @@ -2864,11 +2829,11 @@ sdp_result_e sdp_set_mid_value (void *sdp_ptr, u16 level, u32 mid_val) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_mca_t *mca_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - + mca_p = sdp_find_media_level(sdp_p, level); if (mca_p == NULL) { sdp_p->conf_p->num_invalid_param++; diff --git a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr.c b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr.c index 41309826d5dc..cd14dcaca6db 100644 --- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr.c +++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include @@ -47,14 +12,75 @@ #include "sdp_base64.h" #include "mozilla/Assertions.h" +/* + * Macro for sdp_build_attr_fmtp + * Adds name-value pair where value is char* + */ +#define FMTP_BUILD_STRING(condition, name, value) \ + if ((condition)) { \ + sdp_append_name_and_string(fs, (name), (value), semicolon); \ + semicolon = TRUE; \ + } + +/* + * Macro for sdp_build_attr_fmtp + * Adds name-value pair where value is unsigned + */ +#define FMTP_BUILD_UNSIGNED(condition, name, value) \ + if ((condition)) { \ + sdp_append_name_and_unsigned(fs, (name), (value), semicolon); \ + semicolon = TRUE; \ + } + +/* + * Macro for sdp_build_attr_fmtp + * Adds flag string on condition + */ +#define FMTP_BUILD_FLAG(condition, name) \ + if ((condition)) { \ + if (semicolon) { \ + flex_string_append(fs, ";"); \ + } \ + flex_string_append(fs, name); \ + semicolon = TRUE; \ + } + +/* + * Helper function for adding nv-pair where value is string. + */ +static void sdp_append_name_and_string(flex_string *fs, + const char *name, + const char *value, + tinybool semicolon) +{ + flex_string_sprintf(fs, "%s%s=%s", + semicolon ? ";" : "", + name, + value); +} + +/* + * Helper function for adding nv-pair where value is unsigned. + */ +static void sdp_append_name_and_unsigned(flex_string *fs, + const char *name, + unsigned int value, + tinybool semicolon) +{ + flex_string_sprintf(fs, "%s%s=%u", + semicolon ? ";" : "", + name, + value); +} + /* Function: sdp_parse_attribute * Description: Figure out the type of attribute and call the appropriate - * parsing routine. If parsing errors are encountered, + * parsing routine. If parsing errors are encountered, * warnings will be printed and the attribute will be ignored. * Unrecognized/invalid attributes do not cause overall parsing * errors. All errors detected are noted as warnings. * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * ptr Pointer to the attribute string to parse. */ sdp_result_e sdp_parse_attribute (sdp_t *sdp_p, u16 level, const char *ptr) @@ -114,14 +140,14 @@ sdp_result_e sdp_parse_attribute (sdp_t *sdp_p, u16 level, const char *ptr) } if (attr_p->type == SDP_ATTR_INVALID) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - SDP_WARN("%s Warning: Unrecognized attribute (%s) ", + SDP_WARN("%s Warning: Unrecognized attribute (%s) ", sdp_p->debug_str, tmp); } sdp_free_attr(attr_p); return (SDP_SUCCESS); } - /* If this is an X-cpar or cpar attribute, set the flag. The attribute + /* If this is an X-cpar or cpar attribute, set the flag. The attribute * type will be changed by the parse. */ if ((attr_p->type == SDP_ATTR_X_CPAR) || (attr_p->type == SDP_ATTR_CPAR)) { @@ -139,7 +165,7 @@ sdp_result_e sdp_parse_attribute (sdp_t *sdp_p, u16 level, const char *ptr) } /* If this was an X-cpar/cpar attribute, it was hooked into the X-cap/cdsc - * structure, so we're finished. + * structure, so we're finished. */ if (xcpar_flag == TRUE) { return (result); @@ -148,7 +174,7 @@ sdp_result_e sdp_parse_attribute (sdp_t *sdp_p, u16 level, const char *ptr) /* Add the attribute in the appropriate place. */ if (level == SDP_SESSION_LEVEL) { for (next_attr_p = sdp_p->sess_attrs_p; next_attr_p != NULL; - prev_attr_p = next_attr_p, + prev_attr_p = next_attr_p, next_attr_p = next_attr_p->next_p) { ; /* Empty for */ } @@ -157,9 +183,9 @@ sdp_result_e sdp_parse_attribute (sdp_t *sdp_p, u16 level, const char *ptr) } else { prev_attr_p->next_p = attr_p; } - } else { + } else { for (next_attr_p = mca_p->media_attrs_p; next_attr_p != NULL; - prev_attr_p = next_attr_p, + prev_attr_p = next_attr_p, next_attr_p = next_attr_p->next_p) { ; /* Empty for */ } @@ -174,12 +200,11 @@ sdp_result_e sdp_parse_attribute (sdp_t *sdp_p, u16 level, const char *ptr) } /* Build all of the attributes defined for the specified level. */ -sdp_result_e sdp_build_attribute (sdp_t *sdp_p, u16 level, char **ptr, u16 len) +sdp_result_e sdp_build_attribute (sdp_t *sdp_p, u16 level, flex_string *fs) { sdp_attr_t *attr_p; sdp_mca_t *mca_p=NULL; sdp_result_e result; - char *endbuf_p; if (level == SDP_SESSION_LEVEL) { attr_p = sdp_p->sess_attrs_p; @@ -193,45 +218,40 @@ sdp_result_e sdp_build_attribute (sdp_t *sdp_p, u16 level, char **ptr, u16 len) /* Re-initialize the current capability number for this new level. */ sdp_p->cur_cap_num = 1; - /* Find ptr to the end of the buf for recalculating len remaining. */ - endbuf_p = *ptr + len; - - /* Build all of the attributes for this level. Note that if there + /* Build all of the attributes for this level. Note that if there * is a problem building an attribute, we don't fail but just ignore it.*/ while (attr_p != NULL) { if (attr_p->type >= SDP_MAX_ATTR_TYPES) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - SDP_WARN("%s Invalid attribute type to build (%u)", + SDP_WARN("%s Invalid attribute type to build (%u)", sdp_p->debug_str, attr_p->type); } } else { - result = sdp_attr[attr_p->type].build_func(sdp_p, attr_p, - ptr, (u16)(endbuf_p - *ptr)); - /* If we ran out of buffer space, though, we must error out */ - /* FIX - re-enable this assert after we check the results from snprintfs in the build_funcs */ - /* MOZ_ASSERT(endbuf_p - *ptr > 0); */ - if (endbuf_p - *ptr <= 0) - return (SDP_POTENTIAL_SDP_OVERFLOW); + result = sdp_attr[attr_p->type].build_func(sdp_p, attr_p, fs); - if (result == SDP_SUCCESS) { - if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { - SDP_PRINT("%s Built a=%s attribute line", sdp_p->debug_str, - sdp_get_attr_name(attr_p->type)); - } + if (result != SDP_SUCCESS) { + SDP_ERROR("%s error building attribute %d", __FUNCTION__, result); + return result; + } + + if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { + SDP_PRINT("%s Built a=%s attribute line", sdp_p->debug_str, + sdp_get_attr_name(attr_p->type)); } } attr_p = attr_p->next_p; } - return (SDP_SUCCESS); + return SDP_SUCCESS; } -sdp_result_e sdp_parse_attr_simple_string (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_simple_string (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { sdp_result_e result; - ptr = sdp_getnextstrtok(ptr, attr_p->attr.string_val, sizeof(attr_p->attr.string_val), " \t", &result); + ptr = sdp_getnextstrtok(ptr, attr_p->attr.string_val, + sizeof(attr_p->attr.string_val), " \t", &result); if (result != SDP_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { @@ -243,25 +263,23 @@ sdp_result_e sdp_parse_attr_simple_string (sdp_t *sdp_p, sdp_attr_t *attr_p, } else { if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Parsed a=%s, %s", sdp_p->debug_str, - sdp_get_attr_name(attr_p->type), + sdp_get_attr_name(attr_p->type), attr_p->attr.string_val); } return (SDP_SUCCESS); } } -sdp_result_e sdp_build_attr_simple_string (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) +sdp_result_e sdp_build_attr_simple_string (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs) { - char *endbuf_p = *ptr + len; + flex_string_sprintf(fs, "a=%s:%s\r\n", sdp_attr[attr_p->type].name, + attr_p->attr.string_val); - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr),0), "a=%s:%s\r\n", sdp_attr[attr_p->type].name, - attr_p->attr.string_val); - - return (SDP_SUCCESS); + return SDP_SUCCESS; } -sdp_result_e sdp_parse_attr_simple_u32 (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_simple_u32 (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { sdp_result_e result; @@ -284,18 +302,16 @@ sdp_result_e sdp_parse_attr_simple_u32 (sdp_t *sdp_p, sdp_attr_t *attr_p, } } -sdp_result_e sdp_build_attr_simple_u32 (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) +sdp_result_e sdp_build_attr_simple_u32 (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs) { - char *endbuf_p = *ptr + len; + flex_string_sprintf(fs, "a=%s:%u\r\n", sdp_attr[attr_p->type].name, + attr_p->attr.u32_val); - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr),0), "a=%s:%u\r\n", sdp_attr[attr_p->type].name, - attr_p->attr.u32_val); - - return (SDP_SUCCESS); + return SDP_SUCCESS; } -sdp_result_e sdp_parse_attr_simple_bool (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_simple_bool (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { sdp_result_e result; @@ -327,46 +343,37 @@ sdp_result_e sdp_parse_attr_simple_bool (sdp_t *sdp_p, sdp_attr_t *attr_p, } } -sdp_result_e sdp_build_attr_simple_bool (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) +sdp_result_e sdp_build_attr_simple_bool (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs) { - char *endbuf_p; + flex_string_sprintf(fs, "a=%s:%s\r\n", sdp_attr[attr_p->type].name, + attr_p->attr.boolean_val ? "1" : "0"); - /* Find ptr to the end of the buf for recalculating len remaining. */ - endbuf_p = *ptr + len; - - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr),0), "a=%s:", sdp_attr[attr_p->type].name); - len = endbuf_p - *ptr; - - if (attr_p->attr.boolean_val == TRUE) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr),0), "1\r\n"); - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr),0), "0\r\n"); - } - return (SDP_SUCCESS); + return SDP_SUCCESS; } /* * sdp_parse_attr_maxprate * - * This function parses maxprate attribute lines. The ABNF for this a= + * This function parses maxprate attribute lines. The ABNF for this a= * line is: * max-p-rate-def = "a" "=" "maxprate" ":" packet-rate CRLF * packet-rate = 1*DIGIT ["." 1*DIGIT] * * Returns: * SDP_INVALID_PARAMETER - If we are unable to parse the string OR if - * packet-rate is not in the right format as per + * packet-rate is not in the right format as per * the ABNF. * * SDP_SUCCESS - If we are able to successfully parse the a= line. */ -sdp_result_e sdp_parse_attr_maxprate (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_maxprate (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { sdp_result_e result; - ptr = sdp_getnextstrtok(ptr, attr_p->attr.string_val, sizeof(attr_p->attr.string_val), " \t", &result); + ptr = sdp_getnextstrtok(ptr, attr_p->attr.string_val, + sizeof(attr_p->attr.string_val), " \t", &result); if (result != SDP_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { @@ -378,7 +385,7 @@ sdp_result_e sdp_parse_attr_maxprate (sdp_t *sdp_p, sdp_attr_t *attr_p, } else { if (!sdp_validate_maxprate(attr_p->attr.string_val)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - SDP_ERROR("%s is not a valid maxprate value.", + SDP_ERROR("%s is not a valid maxprate value.", attr_p->attr.string_val); } sdp_p->conf_p->num_invalid_param++; @@ -387,7 +394,7 @@ sdp_result_e sdp_parse_attr_maxprate (sdp_t *sdp_p, sdp_attr_t *attr_p, if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Parsed a=%s, %s", sdp_p->debug_str, - sdp_get_attr_name(attr_p->type), + sdp_get_attr_name(attr_p->type), attr_p->attr.string_val); } return (SDP_SUCCESS); @@ -416,7 +423,8 @@ static void sdp_attr_fmtp_no_value(sdp_t *sdp, char *param_name) * */ -static void sdp_attr_fmtp_invalid_value(sdp_t *sdp, char *param_name, char* param_value) +static void sdp_attr_fmtp_invalid_value(sdp_t *sdp, char *param_name, + char* param_value) { if (sdp->debug_flag[SDP_DEBUG_WARNINGS]) { SDP_WARN("%s Warning: Invalid %s: %s specified for fmtp attribute", @@ -428,9 +436,9 @@ static void sdp_attr_fmtp_invalid_value(sdp_t *sdp, char *param_name, char* para /* Note: The fmtp attribute formats currently handled are: * fmtp: ,... * fmtp: [annexa=yes/no] [annexb=yes/no] [bitrate=] - * [QCIF =] [CIF =] [MaxBR = ] one or more + * [QCIF =] [CIF =] [MaxBR = ] one or more * Other FMTP params as per H.263, H.263+, H.264 codec support. - * Note -"value" is a numeric value > 0 and each event is a + * Note -"value" is a numeric value > 0 and each event is a * single number or a range separated by a '-'. * Example: fmtp:101 1,3-15,20 * Video codecs have annexes that can be listed in the following legal formats: @@ -440,7 +448,7 @@ static void sdp_attr_fmtp_invalid_value(sdp_t *sdp, char *param_name, char* para * */ -sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { u16 i; @@ -468,14 +476,14 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, u16 par_width=0; u16 cpcf=0; u16 iter=0; - + ulong l_val = 0; char* strtok_state; unsigned long strtoul_result; char* strtoul_end; /* Find the payload type number. */ - attr_p->attr.fmtp.payload_num = (u16)sdp_getnextnumtok(ptr, &ptr, + attr_p->attr.fmtp.payload_num = (u16)sdp_getnextnumtok(ptr, &ptr, " \t", &result1); if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "payload type"); @@ -486,7 +494,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, fmtp_p->parameter_add = TRUE; fmtp_p->flag = 0; - /* + /* * set default value of packetization mode and level-asymmetry-allowed. If * remote sdp does not specify any value for these two parameters, then the * default value will be assumed for remote sdp. If remote sdp does specify @@ -496,9 +504,9 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, fmtp_p->level_asymmetry_allowed = SDP_DEFAULT_LEVEL_ASYMMETRY_ALLOWED_VALUE; /* BEGIN - a typical macro fn to replace '/' with ';' from fmtp line*/ - /* This ugly replacement of '/' with ';' is only done because - * econf/MS client sends in this wierd /illegal format. - * fmtp parameters MUST be separated by ';' + /* This ugly replacement of '/' with ';' is only done because + * econf/MS client sends in this wierd /illegal format. + * fmtp parameters MUST be separated by ';' */ temp_ptr = cpr_strdup(ptr); if (temp_ptr == NULL) { @@ -531,7 +539,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; if (cpr_strncasecmp(tok,sdp_fmtp_codec_param_val[0].name, @@ -548,12 +556,12 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_attr_fmtp_invalid_value(sdp_p, "annexb", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } + } codec_info_found = TRUE; - + } else if (cpr_strncasecmp(tmp, sdp_fmtp_codec_param[0].name, sdp_fmtp_codec_param[0].strlen) == 0) { - + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); if (result1 != SDP_SUCCESS) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); @@ -562,7 +570,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; if (cpr_strncasecmp(tok,sdp_fmtp_codec_param_val[0].name, @@ -579,9 +587,9 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_attr_fmtp_invalid_value(sdp_p, "annexa", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } + } codec_info_found = TRUE; - + } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[2].name, sdp_fmtp_codec_param[2].strlen) == 0) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); @@ -592,7 +600,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; @@ -608,7 +616,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->bitrate = (u32) strtoul_result; codec_info_found = TRUE; - + } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[41].name, sdp_fmtp_codec_param[41].strlen) == 0) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); @@ -754,7 +762,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; @@ -781,7 +789,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; @@ -808,7 +816,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; temp=PL_strtok_r(tok, ",", &strtok_state); iter++; @@ -856,7 +864,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; temp=PL_strtok_r(tok, ":", &strtok_state); if (temp) { @@ -899,7 +907,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; temp=PL_strtok_r(tok, ".", &strtok_state); if ( temp != NULL ) { @@ -931,7 +939,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; @@ -939,7 +947,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, strtoul_result = strtoul(tok, &strtoul_end, 10); if (errno || tok == strtoul_end || strtoul_result == 0 || strtoul_result > USHRT_MAX) { - sdp_attr_fmtp_invalid_value(sdp_p, "bpp", tok); + sdp_attr_fmtp_invalid_value(sdp_p, "bpp", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } @@ -957,7 +965,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; @@ -983,7 +991,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; @@ -1010,7 +1018,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; @@ -1026,12 +1034,12 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->level = (short) strtoul_result; - codec_info_found = TRUE; + codec_info_found = TRUE; } if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[16].name, sdp_fmtp_codec_param[16].strlen) == 0) { fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->is_interlace = TRUE; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[17].name, sdp_fmtp_codec_param[17].strlen) == 0) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); @@ -1086,7 +1094,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_p->conf_p->num_invalid_param++; SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } + } fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->packetization_mode = (int16) strtoul_result; @@ -1101,7 +1109,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; @@ -1116,7 +1124,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->interleaving_depth = (u16) strtoul_result; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[21].name, sdp_fmtp_codec_param[21].strlen) == 0) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); @@ -1127,14 +1135,14 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; if (sdp_checkrange(sdp_p, tok, &l_val) == TRUE) { fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->deint_buf_req = (u32) l_val; fmtp_p->flag |= SDP_DEINT_BUF_REQ_FLAG; - codec_info_found = TRUE; + codec_info_found = TRUE; } else { sdp_attr_fmtp_invalid_value(sdp_p, "deint_buf_req", tok); SDP_FREE(temp_ptr); @@ -1150,7 +1158,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; @@ -1165,7 +1173,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->max_don_diff = (u32) strtoul_result; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[23].name, sdp_fmtp_codec_param[23].strlen) == 0) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); @@ -1176,14 +1184,14 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; if (sdp_checkrange(sdp_p, tok, &l_val) == TRUE) { fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->init_buf_time = (u32) l_val; fmtp_p->flag |= SDP_INIT_BUF_TIME_FLAG; - codec_info_found = TRUE; + codec_info_found = TRUE; } else { sdp_attr_fmtp_invalid_value(sdp_p, "init_buf_time", tok); SDP_FREE(temp_ptr); @@ -1199,7 +1207,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; @@ -1214,7 +1222,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->max_mbps = (u32) strtoul_result; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[25].name, sdp_fmtp_codec_param[25].strlen) == 0) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); @@ -1225,7 +1233,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; @@ -1239,7 +1247,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, } fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->max_fs = (u32) strtoul_result; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[26].name, sdp_fmtp_codec_param[26].strlen) == 0) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); @@ -1250,7 +1258,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; @@ -1264,7 +1272,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, } fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->max_cpb = (u32) strtoul_result; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[27].name, sdp_fmtp_codec_param[27].strlen) == 0) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); @@ -1275,7 +1283,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; @@ -1289,7 +1297,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, } fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->max_dpb = (u32) strtoul_result; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[28].name, sdp_fmtp_codec_param[28].strlen) == 0) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); @@ -1300,7 +1308,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; @@ -1314,7 +1322,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, } fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->max_br = (u32) strtoul_result; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[29].name, sdp_fmtp_codec_param[29].strlen) == 0) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); @@ -1325,7 +1333,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; @@ -1338,7 +1346,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, fmtp_p->redundant_pic_cap = FALSE; } - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[30].name, sdp_fmtp_codec_param[30].strlen) == 0) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); @@ -1349,14 +1357,14 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; if (sdp_checkrange(sdp_p, tok, &l_val) == TRUE) { fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->deint_buf_cap = (u32) l_val; fmtp_p->flag |= SDP_DEINT_BUF_CAP_FLAG; - codec_info_found = TRUE; + codec_info_found = TRUE; } else { sdp_attr_fmtp_invalid_value(sdp_p, "deint_buf_cap", tok); SDP_FREE(temp_ptr); @@ -1372,14 +1380,14 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; if (sdp_checkrange(sdp_p, tok, &l_val) == TRUE) { fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->max_rcmd_nalu_size = (u32) l_val; fmtp_p->flag |= SDP_MAX_RCMD_NALU_SIZE_FLAG; - codec_info_found = TRUE; + codec_info_found = TRUE; } else { sdp_attr_fmtp_invalid_value(sdp_p, "max_rcmd_nalu_size", tok); SDP_FREE(temp_ptr); @@ -1395,7 +1403,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; @@ -1416,32 +1424,32 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, fmtp_p->parameter_add = FALSE; } - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[33].name, sdp_fmtp_codec_param[33].strlen) == 0) { fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->annex_d = TRUE; + fmtp_p->annex_d = TRUE; codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[34].name, sdp_fmtp_codec_param[34].strlen) == 0) { fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->annex_f = TRUE; - codec_info_found = TRUE; + fmtp_p->annex_f = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[35].name, sdp_fmtp_codec_param[35].strlen) == 0) { fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->annex_i = TRUE; - codec_info_found = TRUE; + fmtp_p->annex_i = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[36].name, sdp_fmtp_codec_param[36].strlen) == 0) { fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->annex_j = TRUE; - codec_info_found = TRUE; + fmtp_p->annex_j = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[37].name, sdp_fmtp_codec_param[36].strlen) == 0) { fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->annex_t = TRUE; - codec_info_found = TRUE; + fmtp_p->annex_t = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[38].name, sdp_fmtp_codec_param[38].strlen) == 0) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); @@ -1452,7 +1460,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; @@ -1466,7 +1474,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, } fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->annex_k_val = (u16) strtoul_result; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[39].name, sdp_fmtp_codec_param[39].strlen) == 0) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); @@ -1477,7 +1485,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; @@ -1491,7 +1499,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, } fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->annex_n_val = (u16) strtoul_result; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[40].name, sdp_fmtp_codec_param[40].strlen) == 0) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); @@ -1502,7 +1510,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } fmtp_p->annex_p_val_picture_resize = 0; fmtp_p->annex_p_val_warp = 0; tok = tmp; @@ -1528,7 +1536,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, } fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[42].name, sdp_fmtp_codec_param[42].strlen) == 0) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); @@ -1539,7 +1547,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } + } tok = tmp; tok++; @@ -1748,28 +1756,28 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, temp=PL_strtok_r(tmp, ";", &strtok_state); if (temp) { if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { - SDP_PRINT("%s Annexes are possibly there for this fmtp %s tmp: %s line\n", + SDP_PRINT("%s Annexes are possibly there for this fmtp %s tmp: %s line\n", sdp_p->debug_str, fmtp_ptr, tmp); } while (temp != NULL) { if (strchr(temp, 'D') !=NULL) { attr_p->attr.fmtp.annex_d = TRUE; - } + } if (strchr(temp, 'F') !=NULL) { attr_p->attr.fmtp.annex_f = TRUE; - } + } if (strchr(temp, 'I') !=NULL) { attr_p->attr.fmtp.annex_i = TRUE; - } + } if (strchr(temp, 'J') !=NULL) { attr_p->attr.fmtp.annex_j = TRUE; - } + } if (strchr(temp, 'T') !=NULL) { attr_p->attr.fmtp.annex_t = TRUE; - } + } temp=PL_strtok_r(NULL, ";", &strtok_state); } - } /* if (temp) */ + } /* if (temp) */ done = TRUE; } fmtp_ptr++; @@ -1779,9 +1787,9 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, } /* while - done loop*/ if (codec_info_found) { - + if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { - SDP_PRINT("%s Parsed a=%s, payload type %u, bitrate %lu, mode %u QCIF = %u, CIF = %u, MAXBR= %u, SQCIF=%u, CIF4= %u, CIF16=%u, CUSTOM=%u,%u,%u , PAR=%u:%u,CPCF=%u, BPP=%u, HRD=%u \n", + SDP_PRINT("%s Parsed a=%s, payload type %u, bitrate %lu, mode %u QCIF = %u, CIF = %u, MAXBR= %u, SQCIF=%u, CIF4= %u, CIF16=%u, CUSTOM=%u,%u,%u , PAR=%u:%u,CPCF=%u, BPP=%u, HRD=%u \n", sdp_p->debug_str, sdp_get_attr_name(attr_p->type), attr_p->attr.fmtp.payload_num, @@ -1793,7 +1801,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.fmtp.sqcif, attr_p->attr.fmtp.cif4, attr_p->attr.fmtp.cif16, - attr_p->attr.fmtp.custom_x,attr_p->attr.fmtp.custom_y, + attr_p->attr.fmtp.custom_x,attr_p->attr.fmtp.custom_y, attr_p->attr.fmtp.custom_mpi, attr_p->attr.fmtp.par_width, attr_p->attr.fmtp.par_height, @@ -1804,14 +1812,14 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { - SDP_PRINT("%s Parsed a=%s, payload type %u,PROFILE=%u,LEVEL=%u, INTERLACE - %s", + SDP_PRINT("%s Parsed a=%s, payload type %u,PROFILE=%u,LEVEL=%u, INTERLACE - %s", sdp_p->debug_str, sdp_get_attr_name(attr_p->type), attr_p->attr.fmtp.payload_num, attr_p->attr.fmtp.profile, attr_p->attr.fmtp.level, attr_p->attr.fmtp.is_interlace ? "YES":"NO"); - } + } if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Parsed H.264 attributes: profile-level-id=%s, parameter-sets=%s, packetization-mode=%d level-asymmetry-allowed=%d interleaving-depth=%d deint-buf-req=%lu max-don-diff=%lu, init_buf-time=%lu\n", @@ -1845,10 +1853,10 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_PRINT("%s Parsed annexes are : D=%d F=%d I=%d J=%d T=%d, K=%d N=%d P=%d,%d\n", sdp_p->debug_str, attr_p->attr.fmtp.annex_d, - attr_p->attr.fmtp.annex_f, attr_p->attr.fmtp.annex_i, - attr_p->attr.fmtp.annex_j, attr_p->attr.fmtp.annex_t, - attr_p->attr.fmtp.annex_k_val, - attr_p->attr.fmtp.annex_n_val, + attr_p->attr.fmtp.annex_f, attr_p->attr.fmtp.annex_i, + attr_p->attr.fmtp.annex_j, attr_p->attr.fmtp.annex_t, + attr_p->attr.fmtp.annex_k_val, + attr_p->attr.fmtp.annex_n_val, attr_p->attr.fmtp.annex_p_val_picture_resize, attr_p->attr.fmtp.annex_p_val_warp); @@ -1860,7 +1868,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, fmtp_ptr = src_ptr; tmp[0] = '\0'; } - + for (i=0; !done; i++) { fmtp_p->fmtp_format = SDP_FMTP_NTE; /* Look for comma separated events */ @@ -1871,10 +1879,10 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, } /* Now look for '-' separated range */ ptr2 = tmp; - low_val = (u8)sdp_getnextnumtok(ptr2, (const char **)&ptr2, + low_val = (u8)sdp_getnextnumtok(ptr2, (const char **)&ptr2, "- \t", &result1); if (*ptr2 == '-') { - high_val = (u8)sdp_getnextnumtok(ptr2, (const char **)&ptr2, + high_val = (u8)sdp_getnextnumtok(ptr2, (const char **)&ptr2, "- \t", &result2); } else { high_val = low_val; @@ -1919,597 +1927,187 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, return (SDP_SUCCESS); } -sdp_result_e sdp_build_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, char **ptr, - u16 len) +sdp_result_e sdp_build_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs) { - u16 event_id; - u32 mask; - u32 mapword; - u8 min = 0; - u8 max = 0; - tinybool range_start = FALSE; - tinybool range_end = FALSE; - tinybool semicolon = FALSE; - char *endbuf_p; - sdp_fmtp_t *fmtp_p; - /* Find ptr to the end of the buf for recalculating len remaining. */ - endbuf_p = *ptr + len; + u16 event_id; + u32 mask; + u32 mapword; + u8 min = 0; + u8 max = 0; + tinybool range_start = FALSE; + tinybool range_end = FALSE; + tinybool semicolon = FALSE; + sdp_fmtp_t *fmtp_p; - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%u ", sdp_attr[attr_p->type].name, - attr_p->attr.fmtp.payload_num); - len = endbuf_p - *ptr; + flex_string_sprintf(fs, "a=%s:%u ", + sdp_attr[attr_p->type].name, + attr_p->attr.fmtp.payload_num); - fmtp_p = &(attr_p->attr.fmtp); - switch (fmtp_p->fmtp_format) { - case SDP_FMTP_MODE: - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "mode=%u",attr_p->attr.fmtp.mode); - break; - - case SDP_FMTP_CODEC_INFO: - if (fmtp_p->bitrate > 0) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "bitrate=%u",attr_p->attr.fmtp.bitrate); - semicolon = TRUE; - } - if (fmtp_p->annexa_required) { - if (fmtp_p->annexa) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";annexa=yes"); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "annexa=yes"); - semicolon = TRUE; - } - } else { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";annexa=no");; - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "annexa=no"); - semicolon = TRUE; - } - } - - } - - if (fmtp_p->annexb_required) { - if (fmtp_p->annexb) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";annexb=yes"); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "annexb=yes"); - semicolon = TRUE; - } - } else { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";annexb=no"); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "annexb=no"); - semicolon = TRUE; - } - } - } - - if (fmtp_p->qcif > 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";QCIF=%u",attr_p->attr.fmtp.qcif); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "QCIF=%u",attr_p->attr.fmtp.qcif); - semicolon = TRUE; - } - } - - if (fmtp_p->cif> 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";CIF=%u",attr_p->attr.fmtp.cif); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "CIF=%u",attr_p->attr.fmtp.cif); - semicolon = TRUE; - } - } + fmtp_p = &(attr_p->attr.fmtp); + switch (fmtp_p->fmtp_format) { + case SDP_FMTP_MODE: + sdp_append_name_and_unsigned(fs, "mode", fmtp_p->mode, FALSE); + break; - if (fmtp_p->maxbr > 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";MAXBR=%u",attr_p->attr.fmtp.maxbr); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "MAXBR=%u",attr_p->attr.fmtp.maxbr); - semicolon = TRUE; - } - } - - if (fmtp_p->sqcif > 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";SQCIF=%u",attr_p->attr.fmtp.sqcif); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "SQCIF=%u",attr_p->attr.fmtp.sqcif); - semicolon = TRUE; - } - } + case SDP_FMTP_CODEC_INFO: + FMTP_BUILD_UNSIGNED(fmtp_p->bitrate > 0, "bitrate", fmtp_p->bitrate) - if (fmtp_p->cif4 > 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";CIF4=%u",attr_p->attr.fmtp.cif4); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "CIF4=%u",attr_p->attr.fmtp.cif4); - semicolon = TRUE; - } - } + FMTP_BUILD_STRING(fmtp_p->annexa_required, + "annexa", (fmtp_p->annexa ? "yes" : "no")) - if (fmtp_p->cif16 > 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";CIF16=%u",attr_p->attr.fmtp.cif16); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "CIF16=%u",attr_p->attr.fmtp.cif16); - semicolon = TRUE; - } - } + FMTP_BUILD_STRING(fmtp_p->annexb_required, + "annexb", (fmtp_p->annexa ? "yes" : "no")) - if ((fmtp_p->custom_x > 0) && (fmtp_p->custom_y > 0) && - (fmtp_p->custom_mpi > 0)) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";CUSTOM=%u,%u,%u", attr_p->attr.fmtp.custom_x, attr_p->attr.fmtp.custom_y, attr_p->attr.fmtp.custom_mpi); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "CUSTOM=%u,%u,%u", attr_p->attr.fmtp.custom_x, attr_p->attr.fmtp.custom_y, attr_p->attr.fmtp.custom_mpi); - semicolon = TRUE; - } - } + FMTP_BUILD_UNSIGNED(fmtp_p->qcif > 0, "QCIF", fmtp_p->qcif) - if ((fmtp_p->par_height > 0) && (fmtp_p->par_width > 0)) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";PAR=%u:%u", attr_p->attr.fmtp.par_width, attr_p->attr.fmtp.par_width); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "PAR=%u:%u", attr_p->attr.fmtp.par_width, attr_p->attr.fmtp.par_width); - semicolon = TRUE; - } - } + FMTP_BUILD_UNSIGNED(fmtp_p->cif > 0, "CIF", fmtp_p->cif) - if (fmtp_p->cpcf > 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";CPCF=%u", attr_p->attr.fmtp.cpcf); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "CPCF=%u", attr_p->attr.fmtp.cpcf); - semicolon = TRUE; - } - } + FMTP_BUILD_UNSIGNED(fmtp_p->maxbr > 0, "MAXBR", fmtp_p->maxbr) - if (fmtp_p->bpp > 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";BPP=%u", attr_p->attr.fmtp.bpp); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "BPP=%u", attr_p->attr.fmtp.bpp); - semicolon = TRUE; - } - } + FMTP_BUILD_UNSIGNED(fmtp_p->sqcif > 0, "SQCIF", fmtp_p->sqcif) - if (fmtp_p->hrd > 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";HRD=%u", attr_p->attr.fmtp.hrd); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "HRD=%u", attr_p->attr.fmtp.hrd); - semicolon = TRUE; - } - } + FMTP_BUILD_UNSIGNED(fmtp_p->cif4 > 0, "CIF4", fmtp_p->cif4) - if (fmtp_p->profile >= 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";PROFILE=%u", - attr_p->attr.fmtp.profile); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "PROFILE=%u", - attr_p->attr.fmtp.profile); - semicolon = TRUE; - } - } + FMTP_BUILD_UNSIGNED(fmtp_p->cif16 > 0, "CIF16", fmtp_p->cif16) - if (fmtp_p->level >= 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";LEVEL=%u", - attr_p->attr.fmtp.level); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "LEVEL=%u", - attr_p->attr.fmtp.level); - semicolon = TRUE; - } - } + if ((fmtp_p->custom_x > 0) && (fmtp_p->custom_y > 0) && + (fmtp_p->custom_mpi > 0)) { + flex_string_sprintf(fs, "%sCUSTOM=%u,%u,%u", + semicolon ? ";" : "", + fmtp_p->custom_x, + fmtp_p->custom_y, + fmtp_p->custom_mpi); - if (fmtp_p->is_interlace) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";INTERLACE"); - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "INTERLACE"); - } - semicolon = TRUE; - } + semicolon = TRUE; + } - if (fmtp_p->annex_d) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";D"); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "D"); - semicolon = TRUE; - } - } + if ((fmtp_p->par_height > 0) && (fmtp_p->par_width > 0)) { + flex_string_sprintf(fs, "%sPAR=%u:%u", + semicolon ? ";" : "", + fmtp_p->par_width, + fmtp_p->par_width); - if (fmtp_p->annex_f) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";F"); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "F"); - semicolon = TRUE; - } - } - if (fmtp_p->annex_i) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";I"); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "I"); - semicolon = TRUE; - } - } - if (fmtp_p->annex_j) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";J"); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "J"); - semicolon = TRUE; - } - } - if (fmtp_p->annex_t) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";T"); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "T"); - semicolon = TRUE; - } - } - if (fmtp_p->annex_k_val >0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";K=%u", - attr_p->attr.fmtp.annex_k_val); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "K=%u", - attr_p->attr.fmtp.annex_k_val); - semicolon = TRUE; - } - } - if (fmtp_p->annex_n_val >0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";N=%u", - attr_p->attr.fmtp.annex_n_val); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "N=%u", - attr_p->attr.fmtp.annex_n_val); - semicolon = TRUE; - } - } - if ((fmtp_p->annex_p_val_picture_resize > 0) && (fmtp_p->annex_p_val_warp > 0)) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";P=%d,%d", - attr_p->attr.fmtp.annex_p_val_picture_resize, - attr_p->attr.fmtp.annex_p_val_warp); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "P=%d,%d", - attr_p->attr.fmtp.annex_p_val_picture_resize, - attr_p->attr.fmtp.annex_p_val_warp); - semicolon = TRUE; - } - } + semicolon = TRUE; + } - if (fmtp_p->profile_level_id[0] != '\0') { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";profile-level-id=%s", - attr_p->attr.fmtp.profile_level_id); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "profile-level-id=%s", - attr_p->attr.fmtp.profile_level_id); - semicolon = TRUE; - } - } - - if (fmtp_p->parameter_sets[0] != '\0') { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";sprop-parameter-sets=%s", - attr_p->attr.fmtp.parameter_sets); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "sprop-parameter-sets=%s", - attr_p->attr.fmtp.parameter_sets); - semicolon = TRUE; - } - } - - if (fmtp_p->packetization_mode < SDP_MAX_PACKETIZATION_MODE_VALUE ) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";packetization-mode=%u", - attr_p->attr.fmtp.packetization_mode); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "packetization-mode=%u", - attr_p->attr.fmtp.packetization_mode); - semicolon = TRUE; - } - } - if (fmtp_p->level_asymmetry_allowed <= SDP_MAX_LEVEL_ASYMMETRY_ALLOWED_VALUE ) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";level-asymmetry-allowed=%u", - attr_p->attr.fmtp.level_asymmetry_allowed); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "level-asymmetry-allowed=%u", - attr_p->attr.fmtp.level_asymmetry_allowed); - semicolon = TRUE; - } - } - if (fmtp_p->interleaving_depth > 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";sprop-interleaving-depth=%u", - attr_p->attr.fmtp.interleaving_depth); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "sprop-interleaving-depth=%u", - attr_p->attr.fmtp.interleaving_depth); - semicolon = TRUE; - } - } - if (fmtp_p->flag & SDP_DEINT_BUF_REQ_FLAG) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";sprop-deint-buf-req=%u", - attr_p->attr.fmtp.deint_buf_req); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "sprop-deint-buf-req=%u", - attr_p->attr.fmtp.deint_buf_req); - semicolon = TRUE; - } - } - if (fmtp_p->max_don_diff > 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";sprop-max-don-diff=%u", - attr_p->attr.fmtp.max_don_diff); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "sprop-max-don-diff=%u", - attr_p->attr.fmtp.max_don_diff); - semicolon = TRUE; - } - } + FMTP_BUILD_UNSIGNED(fmtp_p->cpcf > 0, "CPCF", fmtp_p->cpcf) - if (fmtp_p->flag & SDP_INIT_BUF_TIME_FLAG) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";sprop-init-buf-time=%u", - attr_p->attr.fmtp.init_buf_time); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "sprop-init-buf-time=%u", - attr_p->attr.fmtp.init_buf_time); - semicolon = TRUE; - } - } - - if (fmtp_p->max_mbps > 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";max-mbps=%u", - attr_p->attr.fmtp.max_mbps); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "max-mbps=%u", - attr_p->attr.fmtp.max_mbps); - semicolon = TRUE; - } - } - - if (fmtp_p->max_fs > 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";max-fs=%u", - attr_p->attr.fmtp.max_fs); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "max-fs=%u", - attr_p->attr.fmtp.max_fs); - semicolon = TRUE; - } - } - - if (fmtp_p->max_cpb > 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";max-cpb=%u", - attr_p->attr.fmtp.max_cpb); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "max-cpb=%u", - attr_p->attr.fmtp.max_cpb); - semicolon = TRUE; - } - } - - if (fmtp_p->max_dpb > 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";max-dpb=%u", - attr_p->attr.fmtp.max_dpb); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "max-dpb=%u", - attr_p->attr.fmtp.max_dpb); - semicolon = TRUE; - } - } - - if (fmtp_p->max_br > 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";max-br=%u", - attr_p->attr.fmtp.max_br); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "max-br=%u", - attr_p->attr.fmtp.max_br); - semicolon = TRUE; - } - } - - if (fmtp_p->redundant_pic_cap > 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";redundant-pic-cap=%u", - attr_p->attr.fmtp.redundant_pic_cap); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "redundant-pic-cap=%u", - attr_p->attr.fmtp.redundant_pic_cap); - semicolon = TRUE; - } - } - - if (fmtp_p->flag & SDP_DEINT_BUF_CAP_FLAG) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";deint-buf-cap=%u", - attr_p->attr.fmtp.deint_buf_cap); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "deint-buf-cap=%u", - attr_p->attr.fmtp.deint_buf_cap); - semicolon = TRUE; - } - } - - if (fmtp_p->flag & SDP_MAX_RCMD_NALU_SIZE_FLAG) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";max-rcmd-nalu-size=%u", - attr_p->attr.fmtp.max_rcmd_nalu_size); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "max-rcmd-nalu-size=%u", - attr_p->attr.fmtp.max_rcmd_nalu_size); - semicolon = TRUE; - } - } - - if (fmtp_p->parameter_add == FALSE) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";parameter-add=%u", - attr_p->attr.fmtp.parameter_add); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "parameter-add=%u", - attr_p->attr.fmtp.parameter_add); - semicolon = TRUE; - } - } + FMTP_BUILD_UNSIGNED(fmtp_p->bpp > 0, "BPP", fmtp_p->bpp) - if (fmtp_p->maxaveragebitrate > 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";maxaveragebitrate=%u",attr_p->attr.fmtp.maxaveragebitrate); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "maxaveragebitrate=%u",attr_p->attr.fmtp.maxaveragebitrate); - semicolon = TRUE; - } - } + FMTP_BUILD_UNSIGNED(fmtp_p->hrd > 0, "HRD", fmtp_p->hrd) - if (fmtp_p->usedtx <= 1) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";usedtx=%u",attr_p->attr.fmtp.usedtx); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "usedtx=%u",attr_p->attr.fmtp.usedtx); - semicolon = TRUE; - } - } + FMTP_BUILD_UNSIGNED(fmtp_p->profile >= 0, "PROFILE", fmtp_p->profile) - if (fmtp_p->stereo <= 1) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";stereo=%u",attr_p->attr.fmtp.stereo); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "stereo=%u",attr_p->attr.fmtp.stereo); - semicolon = TRUE; - } - } + FMTP_BUILD_UNSIGNED(fmtp_p->level >= 0, "LEVEL", fmtp_p->level) - if (fmtp_p->useinbandfec <= 1) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";useinbandfec=%u",attr_p->attr.fmtp.useinbandfec); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "useinbandfec=%u",attr_p->attr.fmtp.useinbandfec); - semicolon = TRUE; - } - } + FMTP_BUILD_FLAG(fmtp_p->is_interlace, "INTERLACE") - if (fmtp_p->maxcodedaudiobandwidth[0] != '\0') { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";maxcodedaudiobandwidth=%s", - attr_p->attr.fmtp.maxcodedaudiobandwidth); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "maxcodedaudiobandwidth=%s", - attr_p->attr.fmtp.maxcodedaudiobandwidth); - semicolon = TRUE; - } - } + FMTP_BUILD_FLAG(fmtp_p->annex_d, "D") - if (fmtp_p->cbr <= 1) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";cbr=%u",attr_p->attr.fmtp.cbr); - semicolon = TRUE; - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "cbr=%u",attr_p->attr.fmtp.cbr); - semicolon = TRUE; - } - } + FMTP_BUILD_FLAG(fmtp_p->annex_f, "F") - break; + FMTP_BUILD_FLAG(fmtp_p->annex_i, "I") - case SDP_FMTP_DATACHANNEL: + FMTP_BUILD_FLAG(fmtp_p->annex_j, "J") - if (fmtp_p->protocol[0] != '\0') { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";protocol=%s", - attr_p->attr.fmtp.protocol); - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "protocol=%s", - attr_p->attr.fmtp.protocol); - semicolon = TRUE; - } - } + FMTP_BUILD_FLAG(fmtp_p->annex_t, "T") - if (fmtp_p->streams > 0) { - if (semicolon) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ";streams=%u",attr_p->attr.fmtp.streams); - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "streams=%u",attr_p->attr.fmtp.streams); - semicolon = TRUE; - } - } + FMTP_BUILD_UNSIGNED(fmtp_p->annex_k_val > 0, + "K", fmtp_p->annex_k_val) + + FMTP_BUILD_UNSIGNED(fmtp_p->annex_n_val > 0, + "N", fmtp_p->annex_n_val) + + if ((fmtp_p->annex_p_val_picture_resize > 0) && + (fmtp_p->annex_p_val_warp > 0)) { + flex_string_sprintf(fs, "%sP=%d:%d", + semicolon ? ";" : "", + fmtp_p->annex_p_val_picture_resize, + fmtp_p->annex_p_val_warp); + + semicolon = TRUE; + } + + FMTP_BUILD_STRING(strlen(fmtp_p->profile_level_id) > 0, + "profile-level-id", fmtp_p->profile_level_id) + + FMTP_BUILD_STRING(strlen(fmtp_p->parameter_sets) > 0, + "sprop-parameter-sets", fmtp_p->parameter_sets) + + FMTP_BUILD_UNSIGNED( + fmtp_p->packetization_mode < SDP_MAX_PACKETIZATION_MODE_VALUE, + "packetization-mode", fmtp_p->packetization_mode) + + FMTP_BUILD_UNSIGNED( + fmtp_p->level_asymmetry_allowed <= + SDP_MAX_LEVEL_ASYMMETRY_ALLOWED_VALUE, + "level-asymmetry-allowed", fmtp_p->level_asymmetry_allowed) + + FMTP_BUILD_UNSIGNED(fmtp_p->interleaving_depth > 0, + "sprop-interleaving-depth", fmtp_p->interleaving_depth) + + FMTP_BUILD_UNSIGNED(fmtp_p->flag & SDP_DEINT_BUF_REQ_FLAG, + "sprop-deint-buf-req", fmtp_p->deint_buf_req) + + FMTP_BUILD_UNSIGNED(fmtp_p->max_don_diff > 0, + "sprop-max-don-diff", fmtp_p->max_don_diff) + + FMTP_BUILD_UNSIGNED(fmtp_p->flag & SDP_INIT_BUF_TIME_FLAG, + "sprop-init-buf-time", fmtp_p->init_buf_time) + + FMTP_BUILD_UNSIGNED(fmtp_p->max_mbps > 0, + "max-mbps", fmtp_p->max_mbps) + + FMTP_BUILD_UNSIGNED(fmtp_p->max_fs > 0, "max-fs", fmtp_p->max_fs) + + FMTP_BUILD_UNSIGNED(fmtp_p->max_cpb > 0, "max-cpb", fmtp_p->max_cpb) + + FMTP_BUILD_UNSIGNED(fmtp_p->max_dpb > 0, "max-dpb", fmtp_p->max_dpb) + + FMTP_BUILD_UNSIGNED(fmtp_p->max_br > 0, "max-br", fmtp_p->max_br) + + FMTP_BUILD_UNSIGNED(fmtp_p->redundant_pic_cap > 0, + "redundant-pic-cap", fmtp_p->redundant_pic_cap) + + FMTP_BUILD_UNSIGNED(fmtp_p->flag & SDP_DEINT_BUF_CAP_FLAG, + "deint-buf-cap", fmtp_p->deint_buf_cap) + + FMTP_BUILD_UNSIGNED(fmtp_p->flag & SDP_MAX_RCMD_NALU_SIZE_FLAG, + "max-rcmd-naFMTP_BUILD_FLlu-size", fmtp_p->max_rcmd_nalu_size) + + FMTP_BUILD_UNSIGNED(fmtp_p->parameter_add > 0, + "parameter-add", fmtp_p->parameter_add) + + FMTP_BUILD_UNSIGNED(fmtp_p->maxaveragebitrate > 0, + "maxaveragebitrate", fmtp_p->maxaveragebitrate) + + FMTP_BUILD_UNSIGNED(fmtp_p->usedtx <= 1, "usedtx", fmtp_p->usedtx) + + FMTP_BUILD_UNSIGNED(fmtp_p->stereo <= 1, "stereo", fmtp_p->stereo) + + FMTP_BUILD_UNSIGNED(fmtp_p->useinbandfec <= 1, + "useinbandfec", fmtp_p->useinbandfec) + + FMTP_BUILD_STRING(strlen(fmtp_p->maxcodedaudiobandwidth) > 0, + "maxcodedaudiobandwidth", fmtp_p->maxcodedaudiobandwidth) + + FMTP_BUILD_UNSIGNED(fmtp_p->cbr <= 1, "cbr", fmtp_p->cbr) + + break; + + case SDP_FMTP_DATACHANNEL: + FMTP_BUILD_STRING(strlen(fmtp_p->protocol) > 0, + "protocol", fmtp_p->protocol) + + FMTP_BUILD_UNSIGNED(fmtp_p->streams > 0, "streams", fmtp_p->streams) + + break; + + case SDP_FMTP_NTE: + default: + break; + } - break; - - case SDP_FMTP_NTE: - default: - break; - } - for(event_id = 0, mapword = 0, mask = SDP_NE_BIT_0; event_id <= fmtp_p->maxval; event_id++, mapword = event_id/SDP_NE_BITS_PER_WORD ) { @@ -2545,24 +2143,24 @@ sdp_result_e sdp_build_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, char **ptr, if (range_end) { range_start = range_end = FALSE; - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "%u", min); + flex_string_sprintf(fs, "%u", min); if (min != max) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "-%u", max); + flex_string_sprintf(fs, "-%u", max); } if (max != fmtp_p->maxval) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ","); + flex_string_append(fs, ","); } } } - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "\r\n"); + flex_string_append(fs, "\r\n"); - return (SDP_SUCCESS); + return SDP_SUCCESS; } -sdp_result_e sdp_parse_attr_direction (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_direction (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { /* No parameters to parse. */ @@ -2574,18 +2172,14 @@ sdp_result_e sdp_parse_attr_direction (sdp_t *sdp_p, sdp_attr_t *attr_p, return (SDP_SUCCESS); } -sdp_result_e sdp_build_attr_direction (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) +sdp_result_e sdp_build_attr_direction (sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs) { - char *endbuf_p = *ptr + len; + flex_string_sprintf(fs, "a=%s\r\n", sdp_get_attr_name(attr_p->type)); - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s\r\n", - sdp_get_attr_name(attr_p->type)); - - return (SDP_SUCCESS); + return SDP_SUCCESS; } -sdp_result_e sdp_parse_attr_qos (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_qos (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { int i; @@ -2611,7 +2205,7 @@ sdp_result_e sdp_parse_attr_qos (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (attr_p->attr.qos.strength == SDP_QOS_STRENGTH_UNKNOWN) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - SDP_WARN("%s Warning: QOS strength tag unrecognized (%s)", + SDP_WARN("%s Warning: QOS strength tag unrecognized (%s)", sdp_p->debug_str, tmp); } sdp_p->conf_p->num_invalid_param++; @@ -2637,7 +2231,7 @@ sdp_result_e sdp_parse_attr_qos (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (attr_p->attr.qos.direction == SDP_QOS_DIR_UNKNOWN) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - SDP_WARN("%s Warning: QOS direction unrecognized (%s)", + SDP_WARN("%s Warning: QOS direction unrecognized (%s)", sdp_p->debug_str, tmp); } sdp_p->conf_p->num_invalid_param++; @@ -2662,7 +2256,7 @@ sdp_result_e sdp_parse_attr_qos (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { - SDP_PRINT("%s Parsed a=%s, strength %s, direction %s, confirm %s", + SDP_PRINT("%s Parsed a=%s, strength %s, direction %s, confirm %s", sdp_p->debug_str, sdp_get_attr_name(attr_p->type), sdp_get_qos_strength_name(attr_p->attr.qos.strength), sdp_get_qos_direction_name(attr_p->attr.qos.direction), @@ -2672,35 +2266,23 @@ sdp_result_e sdp_parse_attr_qos (sdp_t *sdp_p, sdp_attr_t *attr_p, return (SDP_SUCCESS); } -sdp_result_e sdp_build_attr_qos (sdp_t *sdp_p, sdp_attr_t *attr_p, char **ptr, - u16 len) +sdp_result_e sdp_build_attr_qos (sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs) { - char *endbuf_p; + flex_string_sprintf(fs, "a=%s:%s %s%s\r\n", sdp_attr[attr_p->type].name, + sdp_get_qos_strength_name(attr_p->attr.qos.strength), + sdp_get_qos_direction_name(attr_p->attr.qos.direction), + attr_p->attr.qos.confirm ? " confirm" : ""); - /* Find ptr to the end of the buf for recalculating len remaining. */ - endbuf_p = *ptr + len; - - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%s %s", - sdp_attr[attr_p->type].name, - sdp_get_qos_strength_name(attr_p->attr.qos.strength), - sdp_get_qos_direction_name(attr_p->attr.qos.direction)); - - if (attr_p->attr.qos.confirm == TRUE) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), " confirm\r\n"); - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "\r\n"); - } - - return (SDP_SUCCESS); + return SDP_SUCCESS; } -sdp_result_e sdp_parse_attr_curr (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_curr (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { int i; sdp_result_e result; char tmp[SDP_MAX_STRING_LEN]; - + /* Find the curr type tag. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { @@ -2718,16 +2300,16 @@ sdp_result_e sdp_parse_attr_curr (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.curr.type = (sdp_curr_type_e)i; } } - + if (attr_p->attr.curr.type != SDP_CURR_QOS_TYPE) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { SDP_WARN("%s Warning: Unknown curr type.", sdp_p->debug_str); } sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); + return (SDP_INVALID_PARAMETER); } - + /* Check qos status type */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { @@ -2745,7 +2327,7 @@ sdp_result_e sdp_parse_attr_curr (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.curr.status_type = (sdp_qos_status_types_e)i; } } - + /* Find the qos direction. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); @@ -2766,7 +2348,7 @@ sdp_result_e sdp_parse_attr_curr (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (attr_p->attr.curr.direction == SDP_QOS_DIR_UNKNOWN) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - SDP_WARN("%s Warning: QOS direction unrecognized (%s)", + SDP_WARN("%s Warning: QOS direction unrecognized (%s)", sdp_p->debug_str, tmp); } sdp_p->conf_p->num_invalid_param++; @@ -2774,7 +2356,7 @@ sdp_result_e sdp_parse_attr_curr (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { - SDP_PRINT("%s Parsed a=%s, type %s status type %s, direction %s", + SDP_PRINT("%s Parsed a=%s, type %s status type %s, direction %s", sdp_p->debug_str, sdp_get_attr_name(attr_p->type), sdp_get_curr_type_name(attr_p->attr.curr.type), sdp_get_qos_status_type_name(attr_p->attr.curr.status_type), @@ -2784,32 +2366,24 @@ sdp_result_e sdp_parse_attr_curr (sdp_t *sdp_p, sdp_attr_t *attr_p, return (SDP_SUCCESS); } -sdp_result_e sdp_build_attr_curr (sdp_t *sdp_p, sdp_attr_t *attr_p, char **ptr, - u16 len) +sdp_result_e sdp_build_attr_curr (sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs) { - char *endbuf_p; + flex_string_sprintf(fs, "a=%s:%s %s %s\r\n", + sdp_attr[attr_p->type].name, + sdp_get_curr_type_name(attr_p->attr.curr.type), + sdp_get_qos_status_type_name(attr_p->attr.curr.status_type), + sdp_get_qos_direction_name(attr_p->attr.curr.direction)); - /* Find ptr to the end of the buf for recalculating len remaining. */ - endbuf_p = *ptr + len; - - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%s %s %s", - sdp_attr[attr_p->type].name, - sdp_get_curr_type_name(attr_p->attr.curr.type), - sdp_get_qos_status_type_name(attr_p->attr.curr.status_type), - sdp_get_qos_direction_name(attr_p->attr.curr.direction)); - - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "\r\n"); - - return (SDP_SUCCESS); + return SDP_SUCCESS; } -sdp_result_e sdp_parse_attr_des (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_des (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { int i; sdp_result_e result; char tmp[SDP_MAX_STRING_LEN]; - + /* Find the curr type tag. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { @@ -2827,16 +2401,16 @@ sdp_result_e sdp_parse_attr_des (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.des.type = (sdp_des_type_e)i; } } - + if (attr_p->attr.des.type != SDP_DES_QOS_TYPE) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { SDP_WARN("%s Warning: Unknown conf type.", sdp_p->debug_str); } sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); + return (SDP_INVALID_PARAMETER); } - + /* Find the strength tag. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { @@ -2856,13 +2430,13 @@ sdp_result_e sdp_parse_attr_des (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (attr_p->attr.des.strength == SDP_QOS_STRENGTH_UNKNOWN) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - SDP_WARN("%s Warning: QOS strength tag unrecognized (%s)", + SDP_WARN("%s Warning: QOS strength tag unrecognized (%s)", sdp_p->debug_str, tmp); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } - + /* Check qos status type */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { @@ -2880,7 +2454,7 @@ sdp_result_e sdp_parse_attr_des (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.des.status_type = (sdp_qos_status_types_e)i; } } - + /* Find the qos direction. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); @@ -2901,7 +2475,7 @@ sdp_result_e sdp_parse_attr_des (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (attr_p->attr.des.direction == SDP_QOS_DIR_UNKNOWN) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - SDP_WARN("%s Warning: QOS direction unrecognized (%s)", + SDP_WARN("%s Warning: QOS direction unrecognized (%s)", sdp_p->debug_str, tmp); } sdp_p->conf_p->num_invalid_param++; @@ -2909,7 +2483,7 @@ sdp_result_e sdp_parse_attr_des (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { - SDP_PRINT("%s Parsed a=%s, type %s strength %s status type %s, direction %s", + SDP_PRINT("%s Parsed a=%s, type %s strength %s status type %s, direction %s", sdp_p->debug_str, sdp_get_attr_name(attr_p->type), sdp_get_des_type_name(attr_p->attr.des.type), sdp_get_qos_strength_name(attr_p->attr.qos.strength), @@ -2921,33 +2495,25 @@ sdp_result_e sdp_parse_attr_des (sdp_t *sdp_p, sdp_attr_t *attr_p, } -sdp_result_e sdp_build_attr_des (sdp_t *sdp_p, sdp_attr_t *attr_p, char **ptr, - u16 len) +sdp_result_e sdp_build_attr_des (sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs) { - char *endbuf_p; + flex_string_sprintf(fs, "a=%s:%s %s %s %s\r\n", + sdp_attr[attr_p->type].name, + sdp_get_curr_type_name((sdp_curr_type_e)attr_p->attr.des.type), + sdp_get_qos_strength_name(attr_p->attr.des.strength), + sdp_get_qos_status_type_name(attr_p->attr.des.status_type), + sdp_get_qos_direction_name(attr_p->attr.des.direction)); - /* Find ptr to the end of the buf for recalculating len remaining. */ - endbuf_p = *ptr + len; - - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%s %s %s %s", - sdp_attr[attr_p->type].name, - sdp_get_curr_type_name((sdp_curr_type_e)attr_p->attr.des.type), - sdp_get_qos_strength_name(attr_p->attr.des.strength), - sdp_get_qos_status_type_name(attr_p->attr.des.status_type), - sdp_get_qos_direction_name(attr_p->attr.des.direction)); - - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "\r\n"); - - return (SDP_SUCCESS); + return SDP_SUCCESS; } -sdp_result_e sdp_parse_attr_conf (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_conf (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { int i; sdp_result_e result; char tmp[SDP_MAX_STRING_LEN]; - + /* Find the curr type tag. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { @@ -2965,16 +2531,16 @@ sdp_result_e sdp_parse_attr_conf (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.conf.type = (sdp_conf_type_e)i; } } - + if (attr_p->attr.conf.type != SDP_CONF_QOS_TYPE) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { SDP_WARN("%s Warning: Unknown conf type.", sdp_p->debug_str); } sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); + return (SDP_INVALID_PARAMETER); } - + /* Check qos status type */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { @@ -2992,7 +2558,7 @@ sdp_result_e sdp_parse_attr_conf (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.conf.status_type = (sdp_qos_status_types_e)i; } } - + /* Find the qos direction. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); @@ -3013,7 +2579,7 @@ sdp_result_e sdp_parse_attr_conf (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (attr_p->attr.conf.direction == SDP_QOS_DIR_UNKNOWN) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - SDP_WARN("%s Warning: QOS direction unrecognized (%s)", + SDP_WARN("%s Warning: QOS direction unrecognized (%s)", sdp_p->debug_str, tmp); } sdp_p->conf_p->num_invalid_param++; @@ -3021,7 +2587,7 @@ sdp_result_e sdp_parse_attr_conf (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { - SDP_PRINT("%s Parsed a=%s, type %s status type %s, direction %s", + SDP_PRINT("%s Parsed a=%s, type %s status type %s, direction %s", sdp_p->debug_str, sdp_get_attr_name(attr_p->type), sdp_get_conf_type_name(attr_p->attr.conf.type), sdp_get_qos_status_type_name(attr_p->attr.conf.status_type), @@ -3031,23 +2597,15 @@ sdp_result_e sdp_parse_attr_conf (sdp_t *sdp_p, sdp_attr_t *attr_p, return (SDP_SUCCESS); } -sdp_result_e sdp_build_attr_conf (sdp_t *sdp_p, sdp_attr_t *attr_p, char **ptr, - u16 len) +sdp_result_e sdp_build_attr_conf (sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs) { - char *endbuf_p; + flex_string_sprintf(fs, "a=%s:%s %s %s\r\n", + sdp_attr[attr_p->type].name, + sdp_get_conf_type_name(attr_p->attr.conf.type), + sdp_get_qos_status_type_name(attr_p->attr.conf.status_type), + sdp_get_qos_direction_name(attr_p->attr.conf.direction)); - /* Find ptr to the end of the buf for recalculating len remaining. */ - endbuf_p = *ptr + len; - - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%s %s %s", - sdp_attr[attr_p->type].name, - sdp_get_conf_type_name(attr_p->attr.conf.type), - sdp_get_qos_status_type_name(attr_p->attr.conf.status_type), - sdp_get_qos_direction_name(attr_p->attr.conf.direction)); - - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "\r\n"); - - return (SDP_SUCCESS); + return SDP_SUCCESS; } /* @@ -3055,7 +2613,7 @@ sdp_result_e sdp_build_attr_conf (sdp_t *sdp_p, sdp_attr_t *attr_p, char **ptr, * the only difference being the keyword "rtpmap" vs "sprtmap". The * rtpmap field in the sdp_attr_t is used to store both mappings. */ -sdp_result_e sdp_parse_attr_transport_map (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_transport_map (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { sdp_result_e result; @@ -3066,7 +2624,7 @@ sdp_result_e sdp_parse_attr_transport_map (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.transport_map.num_chan = 1; /* Find the payload type number. */ - attr_p->attr.transport_map.payload_num = + attr_p->attr.transport_map.payload_num = (u16)sdp_getnextnumtok(ptr, &ptr, " \t", &result); if (result != SDP_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { @@ -3079,7 +2637,7 @@ sdp_result_e sdp_parse_attr_transport_map (sdp_t *sdp_p, sdp_attr_t *attr_p, } /* Find the encoding name. */ - ptr = sdp_getnextstrtok(ptr, attr_p->attr.transport_map.encname, + ptr = sdp_getnextstrtok(ptr, attr_p->attr.transport_map.encname, sizeof(attr_p->attr.transport_map.encname), "/ \t", &result); if (result != SDP_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { @@ -3092,7 +2650,7 @@ sdp_result_e sdp_parse_attr_transport_map (sdp_t *sdp_p, sdp_attr_t *attr_p, } /* Find the clockrate. */ - attr_p->attr.transport_map.clockrate = + attr_p->attr.transport_map.clockrate = sdp_getnextnumtok(ptr, &ptr, "/ \t", &result); if (result != SDP_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { @@ -3102,11 +2660,11 @@ sdp_result_e sdp_parse_attr_transport_map (sdp_t *sdp_p, sdp_attr_t *attr_p, } attr_p->attr.transport_map.clockrate = 8000; } - + /* Find the number of channels, if specified. This is optional. */ if (*ptr == '/') { /* If a '/' exists, expect something valid beyond it. */ - attr_p->attr.transport_map.num_chan = + attr_p->attr.transport_map.num_chan = (u16)sdp_getnextnumtok(ptr, &ptr, "/ \t", &result); if (result != SDP_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { @@ -3138,31 +2696,28 @@ sdp_result_e sdp_parse_attr_transport_map (sdp_t *sdp_p, sdp_attr_t *attr_p, * the only difference being the keyword "rtpmap" vs "sprtmap". The * rtpmap field in the sdp_attr_t is used for both mappings. */ -sdp_result_e sdp_build_attr_transport_map (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) +sdp_result_e sdp_build_attr_transport_map (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs) { - char *endbuf_p; + if (attr_p->attr.transport_map.num_chan == 1) { + flex_string_sprintf(fs, "a=%s:%u %s/%u\r\n", + sdp_attr[attr_p->type].name, + attr_p->attr.transport_map.payload_num, + attr_p->attr.transport_map.encname, + attr_p->attr.transport_map.clockrate); + } else { + flex_string_sprintf(fs, "a=%s:%u %s/%u/%u\r\n", + sdp_attr[attr_p->type].name, + attr_p->attr.transport_map.payload_num, + attr_p->attr.transport_map.encname, + attr_p->attr.transport_map.clockrate, + attr_p->attr.transport_map.num_chan); + } - /* Find ptr to the end of the buf for recalculating len remaining. */ - endbuf_p = *ptr + len; - - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%u %s/%u", - sdp_attr[attr_p->type].name, - attr_p->attr.transport_map.payload_num, - attr_p->attr.transport_map.encname, - attr_p->attr.transport_map.clockrate); - - if (attr_p->attr.transport_map.num_chan != 1) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "/%u\r\n", - attr_p->attr.transport_map.num_chan); - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "\r\n"); - } - - return (SDP_SUCCESS); + return SDP_SUCCESS; } -sdp_result_e sdp_parse_attr_subnet (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_subnet (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { int i; @@ -3183,7 +2738,7 @@ sdp_result_e sdp_parse_attr_subnet (sdp_t *sdp_p, sdp_attr_t *attr_p, } attr_p->attr.subnet.nettype = SDP_NT_UNSUPPORTED; for (i=0; i < SDP_MAX_NETWORK_TYPES; i++) { - if (cpr_strncasecmp(tmp, sdp_nettype[i].name, + if (cpr_strncasecmp(tmp, sdp_nettype[i].name, sdp_nettype[i].strlen) == 0) { type_found = TRUE; } @@ -3236,7 +2791,7 @@ sdp_result_e sdp_parse_attr_subnet (sdp_t *sdp_p, sdp_attr_t *attr_p, } /* Find the subnet address. */ - ptr = sdp_getnextstrtok(ptr, attr_p->attr.subnet.addr, + ptr = sdp_getnextstrtok(ptr, attr_p->attr.subnet.addr, sizeof(attr_p->attr.subnet.addr), " \t", &result); if (result != SDP_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { @@ -3250,8 +2805,8 @@ sdp_result_e sdp_parse_attr_subnet (sdp_t *sdp_p, sdp_attr_t *attr_p, if (*slash_ptr == '/') { *slash_ptr++ = '\0'; /* If the '/' exists, expect a valid prefix to follow. */ - attr_p->attr.subnet.prefix = sdp_getnextnumtok(slash_ptr, - (const char **)&slash_ptr, + attr_p->attr.subnet.prefix = sdp_getnextnumtok(slash_ptr, + (const char **)&slash_ptr, " \t", &result); if (result != SDP_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { @@ -3279,28 +2834,28 @@ sdp_result_e sdp_parse_attr_subnet (sdp_t *sdp_p, sdp_attr_t *attr_p, return (SDP_SUCCESS); } -sdp_result_e sdp_build_attr_subnet (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) +sdp_result_e sdp_build_attr_subnet (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs) { - char *endbuf_p; + if (attr_p->attr.subnet.prefix == SDP_INVALID_VALUE) { + flex_string_sprintf(fs, "a=%s:%s %s %s\r\n", + sdp_attr[attr_p->type].name, + sdp_get_network_name(attr_p->attr.subnet.nettype), + sdp_get_address_name(attr_p->attr.subnet.addrtype), + attr_p->attr.subnet.addr); + } else { + flex_string_sprintf(fs, "a=%s:%s %s %s/%u\r\n", + sdp_attr[attr_p->type].name, + sdp_get_network_name(attr_p->attr.subnet.nettype), + sdp_get_address_name(attr_p->attr.subnet.addrtype), + attr_p->attr.subnet.addr, + (ushort)attr_p->attr.subnet.prefix); + } - /* Find ptr to the end of the buf for recalculating len remaining. */ - endbuf_p = *ptr + len; - - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%s %s %s", sdp_attr[attr_p->type].name, - sdp_get_network_name(attr_p->attr.subnet.nettype), - sdp_get_address_name(attr_p->attr.subnet.addrtype), - attr_p->attr.subnet.addr); - - if (attr_p->attr.subnet.prefix != SDP_INVALID_VALUE) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "/%u", (ushort)attr_p->attr.subnet.prefix); - } - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "\r\n"); - - return (SDP_SUCCESS); + return SDP_SUCCESS; } -sdp_result_e sdp_parse_attr_t38_ratemgmt (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_t38_ratemgmt (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { int i; @@ -3334,19 +2889,17 @@ sdp_result_e sdp_parse_attr_t38_ratemgmt (sdp_t *sdp_p, sdp_attr_t *attr_p, return (SDP_SUCCESS); } -sdp_result_e sdp_build_attr_t38_ratemgmt (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) +sdp_result_e sdp_build_attr_t38_ratemgmt (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs) { - char *endbuf_p = *ptr + len; + flex_string_sprintf(fs, "a=%s:%s\r\n", + sdp_attr[attr_p->type].name, + sdp_get_t38_ratemgmt_name(attr_p->attr.t38ratemgmt)); - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%s\r\n", - sdp_attr[attr_p->type].name, - sdp_get_t38_ratemgmt_name(attr_p->attr.t38ratemgmt)); - - return (SDP_SUCCESS); + return SDP_SUCCESS; } -sdp_result_e sdp_parse_attr_t38_udpec (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_t38_udpec (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { int i; @@ -3380,19 +2933,17 @@ sdp_result_e sdp_parse_attr_t38_udpec (sdp_t *sdp_p, sdp_attr_t *attr_p, return (SDP_SUCCESS); } -sdp_result_e sdp_build_attr_t38_udpec (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) +sdp_result_e sdp_build_attr_t38_udpec (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs) { - char *endbuf_p = *ptr + len; + flex_string_sprintf(fs, "a=%s:%s\r\n", + sdp_attr[attr_p->type].name, + sdp_get_t38_udpec_name(attr_p->attr.t38udpec)); - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%s\r\n", - sdp_attr[attr_p->type].name, - sdp_get_t38_udpec_name(attr_p->attr.t38udpec)); - - return (SDP_SUCCESS); + return SDP_SUCCESS; } -sdp_result_e sdp_parse_attr_pc_codec (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_pc_codec (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { u16 i; @@ -3428,29 +2979,24 @@ sdp_result_e sdp_parse_attr_pc_codec (sdp_t *sdp_p, sdp_attr_t *attr_p, return (SDP_SUCCESS); } -sdp_result_e sdp_build_attr_pc_codec (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) +sdp_result_e sdp_build_attr_pc_codec (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs) { - u16 i; - char *endbuf_p; + int i; - /* Find ptr to the end of the buf for recalculating len remaining. */ - endbuf_p = *ptr + len; + flex_string_sprintf(fs, "a=%s: ", sdp_attr[attr_p->type].name); - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s: ", sdp_attr[attr_p->type].name); + for (i=0; i < attr_p->attr.pccodec.num_payloads; i++) { + flex_string_sprintf(fs, "%u ", attr_p->attr.pccodec.payload_type[i]); + } - for (i=0; i < attr_p->attr.pccodec.num_payloads; i++) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "%u ", - attr_p->attr.pccodec.payload_type[i]); - } + flex_string_append(fs, "\r\n"); - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "\r\n"); - - return (SDP_SUCCESS); + return SDP_SUCCESS; } -sdp_result_e sdp_parse_attr_cap (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_cap (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { u16 i; @@ -3467,7 +3013,7 @@ sdp_result_e sdp_parse_attr_cap (sdp_t *sdp_p, sdp_attr_t *attr_p, * from this point until we process the next valid X-cap/cdsc attr. */ sdp_p->cap_valid = FALSE; - /* Allocate resource for new capability. Note that the capability + /* Allocate resource for new capability. Note that the capability * uses the same structure used for media lines. */ cap_p = sdp_alloc_mca(); @@ -3484,13 +3030,13 @@ sdp_result_e sdp_parse_attr_cap (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_WARN("%s Warning: Capability not specified for %s, " "unable to parse.", sdp_p->debug_str, sdp_get_attr_name(attr_p->type)); - + } SDP_FREE(cap_p); sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } - + /* Find the media type. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { @@ -3512,7 +3058,7 @@ sdp_result_e sdp_parse_attr_cap (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (cap_p->media == SDP_MEDIA_UNSUPPORTED) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - SDP_WARN("%s Warning: Media type unsupported (%s).", + SDP_WARN("%s Warning: Media type unsupported (%s).", sdp_p->debug_str, tmp); } SDP_FREE(cap_p); @@ -3549,7 +3095,7 @@ sdp_result_e sdp_parse_attr_cap (sdp_t *sdp_p, sdp_attr_t *attr_p, return (SDP_INVALID_PARAMETER); } - /* Find payload formats. AAL2 X-cap lines allow multiple + /* Find payload formats. AAL2 X-cap lines allow multiple * transport/profile types per line, so these are handled differently. */ if ((cap_p->transport == SDP_TRANSPORT_AAL2_ITU) || @@ -3576,36 +3122,31 @@ sdp_result_e sdp_parse_attr_cap (sdp_t *sdp_p, sdp_attr_t *attr_p, } attr_p->attr.cap_p = cap_p; - /* - * This capability attr is valid. We can now handle X-cpar or - * cpar attrs. + /* + * This capability attr is valid. We can now handle X-cpar or + * cpar attrs. */ sdp_p->cap_valid = TRUE; sdp_p->last_cap_inst++; if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Parsed %s media type %s, Transport %s, " - "Num payloads %u", sdp_p->debug_str, - sdp_get_attr_name(attr_p->type), + "Num payloads %u", sdp_p->debug_str, + sdp_get_attr_name(attr_p->type), sdp_get_media_name(cap_p->media), - sdp_get_transport_name(cap_p->transport), + sdp_get_transport_name(cap_p->transport), cap_p->num_payloads); } return (SDP_SUCCESS); } -sdp_result_e sdp_build_attr_cap (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) +sdp_result_e sdp_build_attr_cap (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs) { u16 i, j; - char *endbuf_p; sdp_mca_t *cap_p; - sdp_result_e result; sdp_media_profiles_t *profile_p; - /* Find ptr to the end of the buf for recalculating len remaining. */ - endbuf_p = *ptr + len; - /* Get a pointer to the capability structure. */ cap_p = attr_p->attr.cap_p; @@ -3633,11 +3174,8 @@ sdp_result_e sdp_build_attr_cap (sdp_t *sdp_p, sdp_attr_t *attr_p, return (SDP_SUCCESS); } - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s: %u ", sdp_attr[attr_p->type].name, - sdp_p->cur_cap_num); - - /* Build the media type */ - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "%s ", sdp_get_media_name(cap_p->media)); + flex_string_sprintf(fs, "a=%s: %u %s ", sdp_attr[attr_p->type].name, + sdp_p->cur_cap_num, sdp_get_media_name(cap_p->media)); /* If the X-cap line has AAL2 profiles, build them differently. */ if ((cap_p->transport == SDP_TRANSPORT_AAL2_ITU) || @@ -3645,49 +3183,48 @@ sdp_result_e sdp_build_attr_cap (sdp_t *sdp_p, sdp_attr_t *attr_p, (cap_p->transport == SDP_TRANSPORT_AAL2_CUSTOM)) { profile_p = cap_p->media_profiles_p; for (i=0; i < profile_p->num_profiles; i++) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "%s", + flex_string_sprintf(fs, "%s", sdp_get_transport_name(profile_p->profile[i])); for (j=0; j < profile_p->num_payloads[i]; j++) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), " %u", + flex_string_sprintf(fs, " %u", profile_p->payload_type[i][j]); } - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), " "); + flex_string_append(fs, " "); } - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "\n"); + + flex_string_append(fs, "\r\n"); if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Built m= media line", sdp_p->debug_str); } - return (SDP_SUCCESS); + return SDP_SUCCESS; } /* Build the transport name */ - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "%s", - sdp_get_transport_name(cap_p->transport)); + flex_string_sprintf(fs, "%s", sdp_get_transport_name(cap_p->transport)); /* Build the format lists */ for (i=0; i < cap_p->num_payloads; i++) { if (cap_p->payload_indicator[i] == SDP_PAYLOAD_ENUM) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), " %s", + flex_string_sprintf(fs, " %s", sdp_get_payload_name((sdp_payload_e)cap_p->payload_type[i])); } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), " %u", cap_p->payload_type[i]); + flex_string_sprintf(fs, " %u", cap_p->payload_type[i]); } } - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "\r\n"); + + flex_string_append(fs, "\r\n"); /* Increment the current capability number for the next X-cap/cdsc attr. */ sdp_p->cur_cap_num += cap_p->num_payloads; sdp_p->last_cap_type = attr_p->type; /* Build any X-cpar/cpar attributes associated with this X-cap/cdsc line. */ - result = sdp_build_attr_cpar(sdp_p, cap_p->media_attrs_p, ptr, len); - - return (result); + return sdp_build_attr_cpar(sdp_p, cap_p->media_attrs_p, fs); } -sdp_result_e sdp_parse_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { u16 i; @@ -3721,7 +3258,7 @@ sdp_result_e sdp_parse_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { SDP_WARN("%s Warning: %s attribute specified with no " "prior %s attribute", sdp_p->debug_str, - sdp_get_attr_name(attr_p->type), + sdp_get_attr_name(attr_p->type), (attr_p->type == SDP_ATTR_CPAR)? (sdp_get_attr_name(SDP_ATTR_CDSC)) : (sdp_get_attr_name(SDP_ATTR_X_CAP)) ); @@ -3730,18 +3267,18 @@ sdp_result_e sdp_parse_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, return (SDP_INVALID_PARAMETER); } - /* + /* * Ensure there is no mixed syntax like CDSC followed by X-CPAR * or X-CAP followed by CPAR. */ - if (((cap_attr_p->type == SDP_ATTR_CDSC) && - (attr_p->type == SDP_ATTR_X_CPAR)) || - ( (cap_attr_p->type == SDP_ATTR_X_CAP) && + if (((cap_attr_p->type == SDP_ATTR_CDSC) && + (attr_p->type == SDP_ATTR_X_CPAR)) || + ( (cap_attr_p->type == SDP_ATTR_X_CAP) && (attr_p->type == SDP_ATTR_CPAR)) ) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { SDP_WARN("%s Warning: %s attribute inconsistent with " "prior %s attribute", sdp_p->debug_str, - sdp_get_attr_name(attr_p->type), + sdp_get_attr_name(attr_p->type), sdp_get_attr_name(cap_attr_p->type)); } sdp_p->conf_p->num_invalid_param++; @@ -3751,12 +3288,12 @@ sdp_result_e sdp_parse_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, /* a= is the only token we handle in an X-cpar/cpar attribute. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), "= \t", &result); - + if ((result != SDP_SUCCESS) || (tmp[0] != 'a') || (tmp[1] != '\0')) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { SDP_WARN("%s Warning: Invalid token type (%s) in %s " "attribute, unable to parse", sdp_p->debug_str, tmp, - sdp_get_attr_name(attr_p->type)); + sdp_get_attr_name(attr_p->type)); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -3783,13 +3320,13 @@ sdp_result_e sdp_parse_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s No attribute type specified for %s " "attribute, unable to parse.", sdp_p->debug_str, - sdp_get_attr_name(attr_p->type)); + sdp_get_attr_name(attr_p->type)); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } - /* Reset the type of the attribute from X-cpar/cpar to whatever the + /* Reset the type of the attribute from X-cpar/cpar to whatever the * specified type is. */ attr_p->type = SDP_ATTR_INVALID; attr_p->next_p = NULL; @@ -3802,7 +3339,7 @@ sdp_result_e sdp_parse_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { SDP_WARN("%s Warning: Unrecognized attribute (%s) for %s" " attribute, unable to parse.", sdp_p->debug_str, tmp, - sdp_get_attr_name(attr_p->type)); + sdp_get_attr_name(attr_p->type)); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -3845,10 +3382,9 @@ sdp_result_e sdp_parse_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, return (SDP_SUCCESS); } -sdp_result_e sdp_build_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) +sdp_result_e sdp_build_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs) { - char *endbuf_p; sdp_result_e result; const char *cpar_name; @@ -3856,30 +3392,21 @@ sdp_result_e sdp_build_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, if (sdp_p->last_cap_type == SDP_ATTR_CDSC) { cpar_name = sdp_get_attr_name(SDP_ATTR_CPAR); } else { - /* + /* * Default to X-CPAR if anything else. This is the backward * compatible value. */ cpar_name = sdp_get_attr_name(SDP_ATTR_X_CPAR); } - /* Find ptr to the end of the buf for recalculating len remaining. */ - endbuf_p = *ptr + len; - while (attr_p != NULL) { if (attr_p->type >= SDP_MAX_ATTR_TYPES) { - SDP_WARN("%s Invalid attribute type to build (%u)", + SDP_WARN("%s Invalid attribute type to build (%u)", sdp_p->debug_str, attr_p->type); } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s: ", cpar_name); + flex_string_sprintf(fs, "a=%s: ", cpar_name); - result = sdp_attr[attr_p->type].build_func(sdp_p, attr_p, - ptr, (u16)(endbuf_p - *ptr)); - /* If we ran out of buffer space, though, we must error out */ - /* FIX - re-enable this assert after we check the result from snprintf above */ - /* MOZ_ASSERT(endbuf_p - *ptr > 0); */ - if (endbuf_p - *ptr <= 0) - return (SDP_POTENTIAL_SDP_OVERFLOW); + result = sdp_attr[attr_p->type].build_func(sdp_p, attr_p, fs); if (result == SDP_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { @@ -3895,7 +3422,7 @@ sdp_result_e sdp_build_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, return (SDP_SUCCESS); } -sdp_result_e sdp_parse_attr_rtr (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_rtr (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { sdp_result_e result; @@ -3927,28 +3454,24 @@ sdp_result_e sdp_parse_attr_rtr (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Parsed a=%s, %s", sdp_p->debug_str, - sdp_get_attr_name(attr_p->type), + sdp_get_attr_name(attr_p->type), tmp); } return (SDP_SUCCESS); } } -sdp_result_e sdp_build_attr_rtr (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) +sdp_result_e sdp_build_attr_rtr (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs) { - char *endbuf_p = *ptr + len; + flex_string_sprintf(fs, "a=%s%s\r\n", + sdp_attr[attr_p->type].name, + attr_p->attr.rtr.confirm ? ":confirm" : ""); - if (attr_p->attr.rtr.confirm){ - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%s\r\n", sdp_attr[attr_p->type].name, - "confirm"); - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s\r\n", sdp_attr[attr_p->type].name); - } - return (SDP_SUCCESS); + return SDP_SUCCESS; } -sdp_result_e sdp_parse_attr_comediadir (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_comediadir (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { int i; @@ -3974,7 +3497,7 @@ sdp_result_e sdp_parse_attr_comediadir (sdp_t *sdp_p, sdp_attr_t *attr_p, } attr_p->attr.comediadir.role = SDP_MEDIADIR_ROLE_UNSUPPORTED; for (i=0; i < SDP_MAX_MEDIADIR_ROLES; i++) { - if (cpr_strncasecmp(tmp, sdp_mediadir_role[i].name, + if (cpr_strncasecmp(tmp, sdp_mediadir_role[i].name, sdp_mediadir_role[i].strlen) == 0) { type_found = TRUE; attr_p->attr.comediadir.role = (sdp_mediadir_role_e)i; @@ -4012,7 +3535,7 @@ sdp_result_e sdp_parse_attr_comediadir (sdp_t *sdp_p, sdp_attr_t *attr_p, } attr_p->attr.comediadir.conn_info.nettype = SDP_NT_UNSUPPORTED; for (i=0; i < SDP_MAX_NETWORK_TYPES; i++) { - if (cpr_strncasecmp(tmp, sdp_nettype[i].name, + if (cpr_strncasecmp(tmp, sdp_nettype[i].name, sdp_nettype[i].strlen) == 0) { type_found = TRUE; } @@ -4062,7 +3585,7 @@ sdp_result_e sdp_parse_attr_comediadir (sdp_t *sdp_p, sdp_attr_t *attr_p, } /* Find the conninfo address. */ - ptr = sdp_getnextstrtok(ptr, attr_p->attr.comediadir.conn_info.conn_addr, + ptr = sdp_getnextstrtok(ptr, attr_p->attr.comediadir.conn_info.conn_addr, sizeof(attr_p->attr.comediadir.conn_info.conn_addr), " \t", &result); if (result != SDP_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { @@ -4073,7 +3596,7 @@ sdp_result_e sdp_parse_attr_comediadir (sdp_t *sdp_p, sdp_attr_t *attr_p, } /* Find the src port info , if any */ - attr_p->attr.comediadir.src_port = sdp_getnextnumtok(ptr, &ptr, " \t", + attr_p->attr.comediadir.src_port = sdp_getnextnumtok(ptr, &ptr, " \t", &result); if (result != SDP_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { @@ -4099,22 +3622,15 @@ sdp_result_e sdp_parse_attr_comediadir (sdp_t *sdp_p, sdp_attr_t *attr_p, return (SDP_SUCCESS); } -sdp_result_e -sdp_build_attr_comediadir (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) +sdp_result_e +sdp_build_attr_comediadir (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs) { - char *endbuf_p; + flex_string_sprintf(fs, "a=%s:%s\r\n", + sdp_attr[attr_p->type].name, + sdp_get_mediadir_role_name(attr_p->attr.comediadir.role)); - /* Find ptr to the end of the buf for recalculating len remaining. */ - endbuf_p = *ptr + len; - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%s", - sdp_attr[attr_p->type].name, - sdp_get_mediadir_role_name(attr_p->attr. - comediadir.role)); - - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "\r\n"); - - return (SDP_SUCCESS); + return SDP_SUCCESS; } sdp_result_e sdp_parse_attr_silencesupp (sdp_t *sdp_p, sdp_attr_t *attr_p, @@ -4185,7 +3701,7 @@ sdp_result_e sdp_parse_attr_silencesupp (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (attr_p->attr.silencesupp.pref == SDP_SILENCESUPP_PREF_UNKNOWN) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - SDP_WARN("%s Warning: silenceSupp pref unrecognized (%s)", + SDP_WARN("%s Warning: silenceSupp pref unrecognized (%s)", sdp_p->debug_str, tmp); } sdp_p->conf_p->num_invalid_param++; @@ -4211,7 +3727,7 @@ sdp_result_e sdp_parse_attr_silencesupp (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (attr_p->attr.silencesupp.siduse == SDP_SILENCESUPP_SIDUSE_UNKNOWN) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - SDP_WARN("%s Warning: silenceSupp sidUse unrecognized (%s)", + SDP_WARN("%s Warning: silenceSupp sidUse unrecognized (%s)", sdp_p->debug_str, tmp); } sdp_p->conf_p->num_invalid_param++; @@ -4257,38 +3773,32 @@ sdp_result_e sdp_parse_attr_silencesupp (sdp_t *sdp_p, sdp_attr_t *attr_p, } sdp_result_e sdp_build_attr_silencesupp (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) + flex_string *fs) { - char *endbuf_p; + char temp_timer_string[11]; + char temp_fxnslevel_string[11]; - /* Find ptr to the end of the buf for recalculating len remaining. */ - endbuf_p = *ptr + len; + if (attr_p->attr.silencesupp.timer_null) { + snprintf(temp_timer_string, sizeof(temp_timer_string), "-"); + } else { + snprintf(temp_timer_string, sizeof(temp_timer_string), "%u", attr_p->attr.silencesupp.timer); + } - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%s ", - sdp_attr[attr_p->type].name, - (attr_p->attr.silencesupp.enabled ? "on" : "off")); + if (attr_p->attr.silencesupp.fxnslevel_null) { + snprintf(temp_fxnslevel_string, sizeof(temp_fxnslevel_string), "-"); + } else { + snprintf(temp_fxnslevel_string, sizeof(temp_fxnslevel_string), "%u", attr_p->attr.silencesupp.fxnslevel); + } - if (attr_p->attr.silencesupp.timer_null) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "-"); - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "%u", attr_p->attr.silencesupp.timer); - } + flex_string_sprintf(fs, "a=%s:%s %s %s %s %s\r\n", + sdp_attr[attr_p->type].name, + (attr_p->attr.silencesupp.enabled ? "on" : "off"), + temp_timer_string, + sdp_get_silencesupp_pref_name(attr_p->attr.silencesupp.pref), + sdp_get_silencesupp_siduse_name(attr_p->attr.silencesupp.siduse), + temp_fxnslevel_string); - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), " %s %s ", - sdp_get_silencesupp_pref_name( - attr_p->attr.silencesupp.pref), - sdp_get_silencesupp_siduse_name( - attr_p->attr.silencesupp.siduse)); - - if (attr_p->attr.silencesupp.fxnslevel_null) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "-"); - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "%u", attr_p->attr.silencesupp.fxnslevel); - } - - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "\r\n"); - - return (SDP_SUCCESS); + return SDP_SUCCESS; } /* @@ -4308,15 +3818,15 @@ tinybool sdp_parse_context_crypto_suite(char * str, sdp_attr_t *attr_p, sdp_t * int i; - /* Check crypto suites */ + /* Check crypto suites */ for(i=0; iattr.srtp_context.suite = sdp_srtp_crypto_suite_array[i].crypto_suite_val; - attr_p->attr.srtp_context.master_key_size_bytes = + attr_p->attr.srtp_context.master_key_size_bytes = sdp_srtp_crypto_suite_array[i].key_size_bytes; - attr_p->attr.srtp_context.master_salt_size_bytes = + attr_p->attr.srtp_context.master_salt_size_bytes = sdp_srtp_crypto_suite_array[i].salt_size_bytes; - return TRUE; /* There is a succesful match so exit */ + return TRUE; /* There is a succesful match so exit */ } } /* couldn't find a matching crypto suite */ @@ -4329,8 +3839,8 @@ tinybool sdp_parse_context_crypto_suite(char * str, sdp_attr_t *attr_p, sdp_t * } -sdp_result_e sdp_build_attr_srtpcontext (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) +sdp_result_e sdp_build_attr_srtpcontext (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs) { #define MAX_BASE64_ENCODE_SIZE_BYTES 60 int output_len = MAX_BASE64_ENCODE_SIZE_BYTES; @@ -4339,20 +3849,19 @@ sdp_result_e sdp_build_attr_srtpcontext (sdp_t *sdp_p, sdp_attr_t *attr_p, unsigned char base64_encoded_data[MAX_BASE64_ENCODE_SIZE_BYTES]; unsigned char base64_encoded_input[MAX_BASE64_ENCODE_SIZE_BYTES]; base64_result_t status; - char *endbuf_p = *ptr + len; output_len = MAX_BASE64_ENCODE_SIZE_BYTES; /* Append master and salt keys */ - bcopy(attr_p->attr.srtp_context.master_key, base64_encoded_input, - key_size ); + bcopy(attr_p->attr.srtp_context.master_key, base64_encoded_input, + key_size ); bcopy(attr_p->attr.srtp_context.master_salt, base64_encoded_input + key_size, salt_size ); if ((status = base64_encode(base64_encoded_input, key_size + salt_size, base64_encoded_data, &output_len)) != BASE64_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - SDP_ERROR("%s Error: Failure to Base64 Encoded data (%s) ", + SDP_ERROR("%s Error: Failure to Base64 Encoded data (%s) ", sdp_p->debug_str, BASE64_RESULT_TO_STRING(status)); } return (SDP_INVALID_PARAMETER); @@ -4360,12 +3869,12 @@ sdp_result_e sdp_build_attr_srtpcontext (sdp_t *sdp_p, sdp_attr_t *attr_p, *(base64_encoded_data + output_len) = '\0'; - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%s inline:%s||\r\n", - sdp_attr[attr_p->type].name, - sdp_srtp_context_crypto_suite[attr_p->attr.srtp_context.suite].name, - base64_encoded_data); + flex_string_sprintf(fs, "a=%s:%s inline:%s||\r\n", + sdp_attr[attr_p->type].name, + sdp_srtp_context_crypto_suite[attr_p->attr.srtp_context.suite].name, + base64_encoded_data); - return (SDP_SUCCESS); + return SDP_SUCCESS; } /* @@ -4437,46 +3946,36 @@ sdp_result_e sdp_parse_attr_mptime ( sdp_result_e sdp_build_attr_mptime ( sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, - u16 len) + flex_string *fs) { - u16 i; - char *endbuf_p; + int i; - /* - * Find the pointer to the end of the buffer - * for recalculating the length remaining. - */ - endbuf_p = *ptr + len; + flex_string_sprintf(fs, "a=%s:", sdp_attr[attr_p->type].name); - /* - * Write out the fixed part of the sdp line. - */ - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:", sdp_attr[attr_p->type].name); - - /* - * Run the list of mptime parameter values and write each one - * to the sdp line. Replace zeros with hyphens. - */ - for (i=0; iattr.mptime.num_intervals; i++) { - if (attr_p->attr.mptime.intervals[i]==0) { - *ptr += snprintf(*ptr,MAX((endbuf_p - *ptr), 0),"-"); - } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "%s%u", (i==0)?"":" ", attr_p->attr.mptime.intervals[i]); - } + /* + * Run the list of mptime parameter values and write each one + * to the sdp line. Replace zeros with hyphens. + */ + for (i=0; i < attr_p->attr.mptime.num_intervals; i++) { + if (i > 0) { + flex_string_append(fs, " "); } - /* - * Close out the line. - */ - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "\r\n"); + if (attr_p->attr.mptime.intervals[i] == 0) { + flex_string_append(fs, "-"); + } else { + flex_string_sprintf(fs, "%u", attr_p->attr.mptime.intervals[i]); + } + } - return SDP_SUCCESS; + flex_string_append(fs, "\r\n"); + + return SDP_SUCCESS; } -sdp_result_e sdp_parse_attr_x_sidin (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_x_sidin (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { sdp_result_e result; @@ -4501,24 +4000,23 @@ sdp_result_e sdp_parse_attr_x_sidin (sdp_t *sdp_p, sdp_attr_t *attr_p, if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Parsed a=%s, %s", sdp_p->debug_str, - sdp_get_attr_name(attr_p->type), + sdp_get_attr_name(attr_p->type), attr_p->attr.stream_data.x_sidin); } return (SDP_SUCCESS); } -sdp_result_e sdp_build_attr_x_sidin (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) +sdp_result_e sdp_build_attr_x_sidin (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs) { - char *endbuf_p = *ptr + len; + flex_string_sprintf(fs, "a=%s:%s\r\n", + sdp_attr[attr_p->type].name, + attr_p->attr.stream_data.x_sidin); - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%s\r\n", - sdp_attr[attr_p->type].name, - attr_p->attr.stream_data.x_sidin); - return (SDP_SUCCESS); + return SDP_SUCCESS; } -sdp_result_e sdp_parse_attr_x_sidout (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_x_sidout (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { sdp_result_e result; @@ -4543,25 +4041,24 @@ sdp_result_e sdp_parse_attr_x_sidout (sdp_t *sdp_p, sdp_attr_t *attr_p, if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Parsed a=%s, %s", sdp_p->debug_str, - sdp_get_attr_name(attr_p->type), + sdp_get_attr_name(attr_p->type), attr_p->attr.stream_data.x_sidout); } return (SDP_SUCCESS); } -sdp_result_e sdp_build_attr_x_sidout (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) +sdp_result_e sdp_build_attr_x_sidout (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs) { - char *endbuf_p = *ptr + len; + flex_string_sprintf(fs, "a=%s:%s\r\n", + sdp_attr[attr_p->type].name, + attr_p->attr.stream_data.x_sidout); - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%s\r\n", - sdp_attr[attr_p->type].name, - attr_p->attr.stream_data.x_sidout); - return (SDP_SUCCESS); + return SDP_SUCCESS; } -sdp_result_e sdp_parse_attr_x_confid (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_x_confid (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { sdp_result_e result; @@ -4571,7 +4068,7 @@ sdp_result_e sdp_parse_attr_x_confid (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_PRINT("%s Parsing a=%s", sdp_p->debug_str, sdp_get_attr_name(attr_p->type)); } - + /* Find the X-confid value */ ptr = sdp_getnextstrtok(ptr, attr_p->attr.stream_data.x_confid, sizeof(attr_p->attr.stream_data.x_confid), " \t", &result); @@ -4583,34 +4080,35 @@ sdp_result_e sdp_parse_attr_x_confid (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } - + if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Parsed a=%s, %s", sdp_p->debug_str, - sdp_get_attr_name(attr_p->type), + sdp_get_attr_name(attr_p->type), attr_p->attr.stream_data.x_confid); } return (SDP_SUCCESS); } -sdp_result_e sdp_build_attr_x_confid (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) +sdp_result_e sdp_build_attr_x_confid (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs) { - char *endbuf_p = *ptr + len; - - if (attr_p->attr.stream_data.x_confid[0] != '\0') { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%s\r\n", - sdp_attr[attr_p->type].name, - attr_p->attr.stream_data.x_confid); - } else { - if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { - SDP_PRINT("%s X-confid value is not set. Cannot build a=X-confid line\n", - sdp_p->debug_str); - } + if (strlen(attr_p->attr.stream_data.x_confid) <= 0) { + if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { + SDP_PRINT("%s X-confid value is not set. Cannot build a=X-confid line\n", + sdp_p->debug_str); } - return (SDP_SUCCESS); + + return SDP_INVALID_PARAMETER; + } + + flex_string_sprintf(fs, "a=%s:%s\r\n", + sdp_attr[attr_p->type].name, + attr_p->attr.stream_data.x_confid); + + return SDP_SUCCESS; } -sdp_result_e sdp_parse_attr_group (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_group (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { sdp_result_e result; @@ -4621,7 +4119,7 @@ sdp_result_e sdp_parse_attr_group (sdp_t *sdp_p, sdp_attr_t *attr_p, SDP_PRINT("%s Parsing a=%s", sdp_p->debug_str, sdp_get_attr_name(attr_p->type)); } - + /* Find the a=group: < id2> ... values */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { @@ -4632,7 +4130,7 @@ sdp_result_e sdp_parse_attr_group (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } - + attr_p->attr.stream_data.group_attr = SDP_GROUP_ATTR_UNSUPPORTED; for (i=0; i < SDP_MAX_GROUP_ATTR_VAL; i++) { if (cpr_strncasecmp(tmp, sdp_group_attr_val[i].name, @@ -4644,14 +4142,14 @@ sdp_result_e sdp_parse_attr_group (sdp_t *sdp_p, sdp_attr_t *attr_p, if (attr_p->attr.stream_data.group_attr == SDP_GROUP_ATTR_UNSUPPORTED) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - SDP_WARN("%s Warning: Group attribute type unsupported (%s).", + SDP_WARN("%s Warning: Group attribute type unsupported (%s).", sdp_p->debug_str, tmp); } } - + /* - * Scan the input line up after group: to the maximum number + * Scan the input line up after group: to the maximum number * of id available. */ attr_p->attr.stream_data.num_group_id =0; @@ -4664,10 +4162,10 @@ sdp_result_e sdp_parse_attr_group (sdp_t *sdp_p, sdp_attr_t *attr_p, } attr_p->attr.stream_data.num_group_id++; } - + if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Parsed a=%s:%s\n", sdp_p->debug_str, - sdp_get_attr_name(attr_p->type), + sdp_get_attr_name(attr_p->type), sdp_get_group_attr_name (attr_p->attr.stream_data.group_attr)); for (i=0; i < attr_p->attr.stream_data.num_group_id; i++) { SDP_PRINT("%s Parsed group line id : %d\n", sdp_p->debug_str, @@ -4677,30 +4175,28 @@ sdp_result_e sdp_parse_attr_group (sdp_t *sdp_p, sdp_attr_t *attr_p, return (SDP_SUCCESS); } -sdp_result_e sdp_build_attr_group (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) +sdp_result_e sdp_build_attr_group (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs) { - int i=0; - char *endbuf_p = *ptr + len; - - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%s", - sdp_attr[attr_p->type].name, - sdp_get_group_attr_name (attr_p->attr.stream_data.group_attr)); + int i; - for (i=0; i < attr_p->attr.stream_data.num_group_id; i++) { - if (attr_p->attr.stream_data.group_id_arr[i] > 0) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), " %u", - attr_p->attr.stream_data.group_id_arr[i]); - } + flex_string_sprintf(fs, "a=%s:%s", + sdp_attr[attr_p->type].name, + sdp_get_group_attr_name(attr_p->attr.stream_data.group_attr)); + + for (i=0; i < attr_p->attr.stream_data.num_group_id; i++) { + if (attr_p->attr.stream_data.group_id_arr[i] > 0) { + flex_string_sprintf(fs, " %u", + attr_p->attr.stream_data.group_id_arr[i]); } + } - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "\r\n"); - - return (SDP_SUCCESS); + flex_string_append(fs, "\r\n"); + return SDP_SUCCESS; } -/* Parse the source-filter attribute +/* Parse the source-filter attribute * "a=source-filter:" * = ... */ @@ -4743,7 +4239,7 @@ sdp_result_e sdp_parse_attr_source_filter (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } - + /* Find the network type */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { @@ -4795,7 +4291,7 @@ sdp_result_e sdp_parse_attr_source_filter (sdp_t *sdp_p, sdp_attr_t *attr_p, } /* Find the destination addr */ - ptr = sdp_getnextstrtok(ptr, attr_p->attr.source_filter.dest_addr, + ptr = sdp_getnextstrtok(ptr, attr_p->attr.source_filter.dest_addr, sizeof(attr_p->attr.source_filter.dest_addr), " \t", &result); if (result != SDP_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -4808,7 +4304,7 @@ sdp_result_e sdp_parse_attr_source_filter (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find the list of source address to apply the filter */ for (i = 0; i < SDP_MAX_SRC_ADDR_LIST; i++) { - ptr = sdp_getnextstrtok(ptr, attr_p->attr.source_filter.src_list[i], + ptr = sdp_getnextstrtok(ptr, attr_p->attr.source_filter.src_list[i], sizeof(attr_p->attr.source_filter.src_list[i]), " \t", &result); if (result != SDP_SUCCESS) { break; @@ -4828,29 +4324,28 @@ sdp_result_e sdp_parse_attr_source_filter (sdp_t *sdp_p, sdp_attr_t *attr_p, } sdp_result_e sdp_build_source_filter (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) + flex_string *fs) { - int i = 0; - char *endbuf_p = *ptr + len; + int i; - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%s %s %s %s", - sdp_get_attr_name(attr_p->type), - sdp_get_src_filter_mode_name(attr_p->attr.source_filter.mode), - sdp_get_network_name(attr_p->attr.source_filter.nettype), - sdp_get_address_name(attr_p->attr.source_filter.addrtype), - attr_p->attr.source_filter.dest_addr); + flex_string_sprintf(fs, "a=%s:%s %s %s %s", + sdp_get_attr_name(attr_p->type), + sdp_get_src_filter_mode_name(attr_p->attr.source_filter.mode), + sdp_get_network_name(attr_p->attr.source_filter.nettype), + sdp_get_address_name(attr_p->attr.source_filter.addrtype), + attr_p->attr.source_filter.dest_addr); - for (i = 0; i < attr_p->attr.source_filter.num_src_addr; i++) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0)," %s", - attr_p->attr.source_filter.src_list[i]); - } + for (i = 0; i < attr_p->attr.source_filter.num_src_addr; i++) { + flex_string_append(fs, " "); + flex_string_append(fs, attr_p->attr.source_filter.src_list[i]); + } - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "\r\n"); + flex_string_append(fs, "\r\n"); - return (SDP_SUCCESS); + return SDP_SUCCESS; } -/* Parse the rtcp-unicast attribute +/* Parse the rtcp-unicast attribute * "a=rtcp-unicast:" */ sdp_result_e sdp_parse_attr_rtcp_unicast (sdp_t *sdp_p, sdp_attr_t *attr_p, @@ -4863,7 +4358,7 @@ sdp_result_e sdp_parse_attr_rtcp_unicast (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.u32_val = SDP_RTCP_UNICAST_MODE_NOT_PRESENT; memset(tmp, 0, sizeof(tmp)); - + ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { @@ -4892,26 +4387,24 @@ sdp_result_e sdp_parse_attr_rtcp_unicast (sdp_t *sdp_p, sdp_attr_t *attr_p, } sdp_result_e sdp_build_attr_rtcp_unicast (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) + flex_string *fs) { - char *endbuf_p = *ptr + len; + if (attr_p->attr.u32_val >= SDP_RTCP_MAX_UNICAST_MODE) { + return SDP_INVALID_PARAMETER; + } - if (attr_p->attr.u32_val >= SDP_RTCP_MAX_UNICAST_MODE) { - return (SDP_INVALID_PARAMETER); - } - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%s\r\n", - sdp_get_attr_name(attr_p->type), - sdp_get_rtcp_unicast_mode_name( - (sdp_rtcp_unicast_mode_e)attr_p->attr.u32_val)); + flex_string_sprintf(fs, "a=%s:%s\r\n", + sdp_get_attr_name(attr_p->type), + sdp_get_rtcp_unicast_mode_name((sdp_rtcp_unicast_mode_e)attr_p->attr.u32_val)); - return (SDP_SUCCESS); + return SDP_SUCCESS; } /* * store_sdescriptions_mki_or_lifetime * - * Verifies the syntax of the MKI or lifetime parameter and stores + * Verifies the syntax of the MKI or lifetime parameter and stores * it in the sdescriptions attribute struct. * * Inputs: @@ -4922,15 +4415,15 @@ sdp_result_e sdp_build_attr_rtcp_unicast (sdp_t *sdp_p, sdp_attr_t *attr_p, * Outputs: * Return TRUE all is good otherwise FALSE for error. */ - -tinybool -store_sdescriptions_mki_or_lifetime (char *buf, sdp_attr_t *attr_p) + +tinybool +store_sdescriptions_mki_or_lifetime (char *buf, sdp_attr_t *attr_p) { - + tinybool result; u16 mkiLen; char mkiValue[SDP_SRTP_MAX_MKI_SIZE_BYTES]; - + /* MKI has a colon */ if (strstr(buf, ":")) { result = verify_sdescriptions_mki(buf, mkiValue, &mkiLen); @@ -4939,7 +4432,7 @@ store_sdescriptions_mki_or_lifetime (char *buf, sdp_attr_t *attr_p) sstrncpy((char*)attr_p->attr.srtp_context.mki, mkiValue, SDP_SRTP_MAX_MKI_SIZE_BYTES); } - + } else { result = verify_sdescriptions_lifetime(buf); if (result) { @@ -4947,7 +4440,7 @@ store_sdescriptions_mki_or_lifetime (char *buf, sdp_attr_t *attr_p) SDP_SRTP_MAX_LIFETIME_BYTES); } } - + return result; } @@ -4957,28 +4450,28 @@ store_sdescriptions_mki_or_lifetime (char *buf, sdp_attr_t *attr_p) * * This routine parses the srtp key-params pointed to by str. * - * key-params = ":" + * key-params = ":" * key-method = "inline" / key-method-ext [note V9 only supports 'inline'] - * key-info = srtp-key-info - * srtp-key-info = key-salt ["|" lifetime] ["|" mki] - * key-salt = 1*(base64) ; binary key and salt values - * ; concatenated together, and then - * ; base64 encoded [section 6.8 of - * ; RFC2046] - * - * lifetime = ["2^"] 1*(DIGIT) - * mki = mki-value ":" mki-length - * mki-value = 1*DIGIT - * mki-length = 1*3DIGIT ; range 1..128. + * key-info = srtp-key-info + * srtp-key-info = key-salt ["|" lifetime] ["|" mki] + * key-salt = 1*(base64) ; binary key and salt values + * ; concatenated together, and then + * ; base64 encoded [section 6.8 of + * ; RFC2046] + * + * lifetime = ["2^"] 1*(DIGIT) + * mki = mki-value ":" mki-length + * mki-value = 1*DIGIT + * mki-length = 1*3DIGIT ; range 1..128. * * Inputs: str - pointer to beginning of key-params and assumes * null terminated string. */ - - -tinybool -sdp_parse_sdescriptions_key_param (const char *str, sdp_attr_t *attr_p, - sdp_t *sdp_p) + + +tinybool +sdp_parse_sdescriptions_key_param (const char *str, sdp_attr_t *attr_p, + sdp_t *sdp_p) { char buf[SDP_MAX_STRING_LEN], base64decodeData[SDP_MAX_STRING_LEN]; @@ -4989,7 +4482,7 @@ sdp_parse_sdescriptions_key_param (const char *str, sdp_attr_t *attr_p, keySize, saltSize; base64_result_t status; - + ptr = str; if (cpr_strncasecmp(ptr, "inline:", 7) != 0) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -4998,7 +4491,7 @@ sdp_parse_sdescriptions_key_param (const char *str, sdp_attr_t *attr_p, sdp_p->conf_p->num_invalid_param++; return FALSE; } - + /* advance pass the inline key word */ ptr = ptr + 7; ptr = sdp_getnextstrtok(ptr, buf, sizeof(buf), "|", &result); @@ -5010,51 +4503,51 @@ sdp_parse_sdescriptions_key_param (const char *str, sdp_attr_t *attr_p, /* The key is base64 encoded composed of the master key concatenated with the * master salt. */ - status = base64_decode((unsigned char *)buf, strlen(buf), + status = base64_decode((unsigned char *)buf, strlen(buf), (unsigned char *)base64decodeData, &len); - + if (status != BASE64_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s key-salt error decoding buffer: %s", sdp_p->debug_str, BASE64_RESULT_TO_STRING(status)); } return FALSE; - + } - + keySize = attr_p->attr.srtp_context.master_key_size_bytes; saltSize = attr_p->attr.srtp_context.master_salt_size_bytes; - + if (len != keySize + saltSize) { - + if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s key-salt size doesn't match: (%d, %d, %d)", sdp_p->debug_str, len, keySize, saltSize); } return(FALSE); - + } - + bcopy(base64decodeData, attr_p->attr.srtp_context.master_key, keySize); - + bcopy(base64decodeData + keySize, attr_p->attr.srtp_context.master_salt, saltSize); - + /* Used only for MGCP */ SDP_SRTP_CONTEXT_SET_MASTER_KEY (attr_p->attr.srtp_context.selection_flags); SDP_SRTP_CONTEXT_SET_MASTER_SALT (attr_p->attr.srtp_context.selection_flags); - + } else if (store_sdescriptions_mki_or_lifetime(buf, attr_p) == FALSE) { return FALSE; } - + /* if we haven't reached the end of line, get the next token */ ptr = sdp_getnextstrtok(ptr, buf, sizeof(buf), "|", &result); } - + /* if we didn't find the key, error out */ if (keyFound == FALSE) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -5063,9 +4556,9 @@ sdp_parse_sdescriptions_key_param (const char *str, sdp_attr_t *attr_p, sdp_p->conf_p->num_invalid_param++; return FALSE; } - + return TRUE; - + } /* @@ -5078,96 +4571,93 @@ sdp_parse_sdescriptions_key_param (const char *str, sdp_attr_t *attr_p, * Where key-params = inline: ["|"lifetime] ["|" MKI:length] * The key and salt is base64 encoded and lifetime and MKI/length are optional. */ - + sdp_result_e -sdp_build_attr_sdescriptions (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) +sdp_build_attr_sdescriptions (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs) { - + unsigned char base64_encoded_data[MAX_BASE64_STRING_LEN]; unsigned char base64_encoded_input[MAX_BASE64_STRING_LEN]; int keySize, saltSize, outputLen; base64_result_t status; - char *endbuf_p = *ptr + len; - + keySize = attr_p->attr.srtp_context.master_key_size_bytes; saltSize = attr_p->attr.srtp_context.master_salt_size_bytes; - + /* concatenate the master key + salt then base64 encode it */ - bcopy(attr_p->attr.srtp_context.master_key, + bcopy(attr_p->attr.srtp_context.master_key, base64_encoded_input, keySize); - - bcopy(attr_p->attr.srtp_context.master_salt, + + bcopy(attr_p->attr.srtp_context.master_salt, base64_encoded_input + keySize, saltSize); - - outputLen = MAX_BASE64_STRING_LEN; + + outputLen = MAX_BASE64_STRING_LEN; status = base64_encode(base64_encoded_input, keySize + saltSize, base64_encoded_data, &outputLen); - + if (status != BASE64_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - SDP_ERROR("%s Error: Failure to Base64 Encoded data (%s) ", + SDP_ERROR("%s Error: Failure to Base64 Encoded data (%s) ", sdp_p->debug_str, BASE64_RESULT_TO_STRING(status)); } return (SDP_INVALID_PARAMETER); - + } - + base64_encoded_data[outputLen] = 0; - - /* lifetime and MKI parameters are optional. Only inlcude them if + + /* lifetime and MKI parameters are optional. Only inlcude them if * they were set. */ - - - if (attr_p->attr.srtp_context.master_key_lifetime[0] != 0 && + + + if (attr_p->attr.srtp_context.master_key_lifetime[0] != 0 && attr_p->attr.srtp_context.mki[0] != 0) { - - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%d %s inline:%s|%s|%s:%d\r\n", - sdp_attr[attr_p->type].name, - attr_p->attr.srtp_context.tag, - sdp_srtp_context_crypto_suite[attr_p->attr.srtp_context.suite].name, - base64_encoded_data, - attr_p->attr.srtp_context.master_key_lifetime, - attr_p->attr.srtp_context.mki, - attr_p->attr.srtp_context.mki_size_bytes); - - return SDP_SUCCESS; - + flex_string_sprintf(fs, "a=%s:%d %s inline:%s|%s|%s:%d\r\n", + sdp_attr[attr_p->type].name, + attr_p->attr.srtp_context.tag, + sdp_srtp_context_crypto_suite[attr_p->attr.srtp_context.suite].name, + base64_encoded_data, + attr_p->attr.srtp_context.master_key_lifetime, + attr_p->attr.srtp_context.mki, + attr_p->attr.srtp_context.mki_size_bytes); + + return SDP_SUCCESS; } - + /* if we get here, either lifetime is populated and mki and is not or mki is populated * and lifetime is not or neither is populated */ - + if (attr_p->attr.srtp_context.master_key_lifetime[0] != 0) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%d %s inline:%s|%s\r\n", - sdp_attr[attr_p->type].name, - attr_p->attr.srtp_context.tag, - sdp_srtp_context_crypto_suite[attr_p->attr.srtp_context.suite].name, - base64_encoded_data, - attr_p->attr.srtp_context.master_key_lifetime); - + flex_string_sprintf(fs, "a=%s:%d %s inline:%s|%s\r\n", + sdp_attr[attr_p->type].name, + attr_p->attr.srtp_context.tag, + sdp_srtp_context_crypto_suite[attr_p->attr.srtp_context.suite].name, + base64_encoded_data, + attr_p->attr.srtp_context.master_key_lifetime); + } else if (attr_p->attr.srtp_context.mki[0] != 0) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%d %s inline:%s|%s:%d\r\n", - sdp_attr[attr_p->type].name, - attr_p->attr.srtp_context.tag, - sdp_srtp_context_crypto_suite[attr_p->attr.srtp_context.suite].name, - base64_encoded_data, - attr_p->attr.srtp_context.mki, - attr_p->attr.srtp_context.mki_size_bytes); - + flex_string_sprintf(fs, "a=%s:%d %s inline:%s|%s:%d\r\n", + sdp_attr[attr_p->type].name, + attr_p->attr.srtp_context.tag, + sdp_srtp_context_crypto_suite[attr_p->attr.srtp_context.suite].name, + base64_encoded_data, + attr_p->attr.srtp_context.mki, + attr_p->attr.srtp_context.mki_size_bytes); + } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "a=%s:%d %s inline:%s\r\n", - sdp_attr[attr_p->type].name, - attr_p->attr.srtp_context.tag, - sdp_srtp_context_crypto_suite[attr_p->attr.srtp_context.suite].name, - base64_encoded_data); - + flex_string_sprintf(fs, "a=%s:%d %s inline:%s\r\n", + sdp_attr[attr_p->type].name, + attr_p->attr.srtp_context.tag, + sdp_srtp_context_crypto_suite[attr_p->attr.srtp_context.suite].name, + base64_encoded_data); + } - + return SDP_SUCCESS; } @@ -5179,9 +4669,9 @@ sdp_build_attr_sdescriptions (sdp_t *sdp_p, sdp_attr_t *attr_p, * Parses Session Description for Protocol Security Descriptions * version 2 or version 9. Grammar is of the form: * - * a=crypto: [] + * a=crypto: [] * - * Note session-params is not supported and will not be parsed. + * Note session-params is not supported and will not be parsed. * Version 2 does not contain a tag. * * Inputs: @@ -5191,7 +4681,7 @@ sdp_build_attr_sdescriptions (sdp_t *sdp_p, sdp_attr_t *attr_p, * vtype - version type */ -sdp_result_e +sdp_result_e sdp_parse_attr_srtp (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr, sdp_attr_e vtype) { @@ -5199,18 +4689,18 @@ sdp_parse_attr_srtp (sdp_t *sdp_p, sdp_attr_t *attr_p, char tmp[SDP_MAX_STRING_LEN]; sdp_result_e result = SDP_FAILURE; int k = 0; - + /* initialize only the optional parameters */ attr_p->attr.srtp_context.master_key_lifetime[0] = 0; attr_p->attr.srtp_context.mki[0] = 0; - + /* used only for MGCP */ SDP_SRTP_CONTEXT_SET_ENCRYPT_AUTHENTICATE (attr_p->attr.srtp_context.selection_flags); - + /* get the tag only if we are version 9 */ if (vtype == SDP_ATTR_SDESCRIPTIONS) { - attr_p->attr.srtp_context.tag = + attr_p->attr.srtp_context.tag = sdp_getnextnumtok(ptr, &ptr, " \t", &result); if (result != SDP_SUCCESS) { @@ -5220,10 +4710,10 @@ sdp_parse_attr_srtp (sdp_t *sdp_p, sdp_attr_t *attr_p, } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); - + } } - + /* get the crypto suite */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { @@ -5233,14 +4723,14 @@ sdp_parse_attr_srtp (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } - + if (!sdp_parse_context_crypto_suite(tmp, attr_p, sdp_p)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s Unsupported crypto suite", sdp_p->debug_str); } return (SDP_INVALID_PARAMETER); } - + ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -5249,14 +4739,14 @@ sdp_parse_attr_srtp (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } - + if (!sdp_parse_sdescriptions_key_param(tmp, attr_p, sdp_p)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s Failed to parse key-params", sdp_p->debug_str); } return (SDP_INVALID_PARAMETER); - } - + } + /* if there are session parameters, scan the session parameters * into tmp until we reach end of line. Currently the sdp parser * does not parse session parameters but if they are present, @@ -5269,27 +4759,27 @@ sdp_parse_attr_srtp (sdp_t *sdp_p, sdp_attr_t *attr_p, while (*ptr && *ptr != '\n' && *ptr != '\r' && k < SDP_MAX_STRING_LEN) { tmp[k++] = *ptr++; } - + if ((k) && (k < SDP_MAX_STRING_LEN)) { tmp[k] = 0; attr_p->attr.srtp_context.session_parameters = cpr_strdup(tmp); } - - return SDP_SUCCESS; - + + return SDP_SUCCESS; + } /* Parses crypto attribute based on the sdescriptions version * 9 grammar. * */ - -sdp_result_e + +sdp_result_e sdp_parse_attr_sdescriptions (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { - return sdp_parse_attr_srtp(sdp_p, attr_p, ptr, + return sdp_parse_attr_srtp(sdp_p, attr_p, ptr, SDP_ATTR_SDESCRIPTIONS); } @@ -5298,27 +4788,21 @@ sdp_parse_attr_sdescriptions (sdp_t *sdp_p, sdp_attr_t *attr_p, * 2 grammar. * */ - + sdp_result_e sdp_parse_attr_srtpcontext (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { - - return sdp_parse_attr_srtp(sdp_p, attr_p, ptr, - SDP_ATTR_SRTP_CONTEXT); + + return sdp_parse_attr_srtp(sdp_p, attr_p, ptr, + SDP_ATTR_SRTP_CONTEXT); } -sdp_result_e sdp_build_attr_from_str (sdp_t *sdp_p, const char *str, - char **ptr, u16 len) -{ - *ptr += snprintf(*ptr, len, "a=%s\r\n", str); - - return (SDP_SUCCESS); -} - sdp_result_e sdp_build_attr_ice_attr (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) { - return sdp_build_attr_from_str(sdp_p, attr_p->attr.ice_attr, ptr, len); + flex_string *fs) { + flex_string_sprintf(fs, "a=%s\r\n", attr_p->attr.ice_attr); + + return SDP_SUCCESS; } @@ -5335,11 +4819,11 @@ sdp_result_e sdp_parse_attr_ice_attr (sdp_t *sdp_p, sdp_attr_t *attr_p, const ch sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } - + /* We need the attr= here. This is pretty gross. */ snprintf(attr_p->attr.ice_attr, sizeof(attr_p->attr.ice_attr), "%s:%s", sdp_get_attr_name(attr_p->type), tmp); - + if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Parsed a=%s, %s", sdp_p->debug_str, sdp_get_attr_name(attr_p->type), tmp); } @@ -5372,8 +4856,10 @@ sdp_result_e sdp_parse_attr_fingerprint_attr (sdp_t *sdp_p, sdp_attr_t *attr_p, } sdp_result_e sdp_build_attr_rtcp_mux_attr (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len) { - return sdp_build_attr_from_str(sdp_p, "rtcp-mux", ptr, len); + flex_string *fs) { + flex_string_append(fs, "a=rtcp-mux\r\n"); + + return SDP_SUCCESS; } sdp_result_e sdp_parse_attr_rtcp_mux_attr (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { diff --git a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr_access.c b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr_access.c index c7775f9a5cfd..dab87b10d2be 100644 --- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr_access.c +++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr_access.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "sdp_os_defs.h" #include "sdp.h" @@ -44,7 +9,7 @@ /* Attribute access routines are all defined by the following parameters. * * sdp_ptr The SDP handle returned by sdp_init_description. - * level The level the attribute is defined. Can be either + * level The level the attribute is defined. Can be either * SDP_SESSION_LEVEL or 0-n specifying a media line level. * inst_num The instance number of the attribute. Multiple instances * of a particular attribute may exist at each level and so @@ -72,20 +37,20 @@ */ /* Attribute handling: - * + * * There are two basic types of attributes handled by the SDP library, * those defined by a= token lines, and those embedded with a=X-cpar lines. * The handling for each of these is described here. - * + * * Simple (non X-cpar attributes): * - * Attributes not embedded in a=X-cpar lines are referenced by level and + * Attributes not embedded in a=X-cpar lines are referenced by level and * instance number. For these attributes the capability number is always * set to zero. * * An application will typically process these attributes in one of two ways. - * With the first method, the application can determine the total number - * of attributes defined at a given level and process them one at a time. + * With the first method, the application can determine the total number + * of attributes defined at a given level and process them one at a time. * For each attribute, the application will query the library to find out * what type of attribute it is and which instance within that type. The * application can then process this particular attribute referencing it @@ -99,7 +64,7 @@ * X-cpar attribute processing: * * X-cpar attributes can contain embedded attributes. They are associated - * with X-cap attribute lines. An example of X-cap and X-cpar attributes + * with X-cap attribute lines. An example of X-cap and X-cpar attributes * found in an SDP is as follows: * * v=0 @@ -120,38 +85,38 @@ * a=X-cap: 7 audio RTP/AVP 100 101 * a=X-cpar: a=rtpmap:100 g.711/8000 * a=X-cpar: a=rtpmap:101 g.729/8000 - * + * * X-cap attributes can be defined at the SESSION_LEVEL or any media level. - * An X-cap attr is defined by the level and instance number just like - * other attributes. In the example above, X-cap attrs are defined at + * An X-cap attr is defined by the level and instance number just like + * other attributes. In the example above, X-cap attrs are defined at * media level 1 and there are four instances at that level. - * + * * The X-cpar attributes can also be referenced by level and instance number. - * However, the embedded attribute within an X-cpar attribute must be + * However, the embedded attribute within an X-cpar attribute must be * referenced by level, instance number, and capability number. This is * because the X-cpar attribute is associated with a particular X-cap/ - * capability. + * capability. * For all attributes that are not embedded within an X-cpar attribute, the * cap_num should be referenced as zero. But for X-cpar attributes, the * cap_num is specified to be one of the capability numbers of the previous * X-cap line. The number of capabilities specified in an X-cap line is - * equal to the number of payloads. Thus, in this example, the first X-cap + * equal to the number of payloads. Thus, in this example, the first X-cap * attr instance specifies capabilities 1-4, the second specifies capability * 5, the third capability 6, and the fourth capabilities 7-8. * - * X-cpar attributes can be processed with methods similar to the two + * X-cpar attributes can be processed with methods similar to the two * previously mentioned. For each X-cap attribute, the application can * use one of two methods to process the X-cpar attributes. First, it - * can query the total number of X-cpar attributes associated with a + * can query the total number of X-cpar attributes associated with a * given X-cap attribute. The X-cap attribute is here defined by a level - * and a capability number. In the example above, the total number of + * and a capability number. In the example above, the total number of * attributes defined is as follows: * level 1, cap_num 1 - total attrs: 3 * level 1, cap_num 5 - total attrs: 0 * level 1, cap_num 6 - total attrs: 0 * level 1, cap_num 7 - total attrs: 2 - * - * Note that if the application queried the number of attributes for + * + * Note that if the application queried the number of attributes for * cap_num 2, 3, or 4, it would also return 3 attrs, and for cap_num * 8 the library would return 2. * @@ -159,18 +124,18 @@ * that capability, it can again query the embedded attribute type and * instance. For example, sdp_get_attr_type would return the following: * level 1, cap_num 1, attr 1 -> attr type fmtp, instance 1 - * level 1, cap_num 1, attr 2 -> attr type rtpmap, instance 1 + * level 1, cap_num 1, attr 2 -> attr type rtpmap, instance 1 * level 1, cap_num 1, attr 3 -> attr type fmtp, instance 2 * level 1, cap_num 7, attr 1 -> attr type rtpmap, instance 1 * level 1, cap_num 7, attr 2 -> attr type rtpmap, instance 2 - * + * * The individual embedded attributes can then be accessed by level, * cap_num, and instance number. * * With the second method for handling X-cpar attributes, the application * determines the types of attributes it is interested in. It can then - * query the SDP library to determine the number of attributes of that - * type found for that level and cap_num, and then process each one at + * query the SDP library to determine the number of attributes of that + * type found for that level and cap_num, and then process each one at * a time. e.g., calling sdp_attr_num_instances would give: * level 1, cap_num 1, attr_type fmtp -> two instances * level 1, cap_num 1, attr_type rtpmap -> one instance @@ -182,9 +147,9 @@ /* Function: sdp_add_new_attr * Description: Add a new attribute of the specified type at the given * level and capability level or base attribute if cap_num - * is zero. + * is zero. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * attr_type The type of attribute to add. @@ -213,9 +178,9 @@ sdp_result_e sdp_add_new_attr (void *sdp_ptr, u16 level, u8 cap_num, return (SDP_INVALID_SDP_PTR); } - if ((cap_num != 0) && + if ((cap_num != 0) && ((attr_type == SDP_ATTR_X_CAP) || (attr_type == SDP_ATTR_X_CPAR) || - (attr_type == SDP_ATTR_X_SQN) || (attr_type == SDP_ATTR_CDSC) || + (attr_type == SDP_ATTR_X_SQN) || (attr_type == SDP_ATTR_CDSC) || (attr_type == SDP_ATTR_CPAR) || (attr_type == SDP_ATTR_SQN))) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { SDP_WARN("%s Warning: Invalid attribute type for X-cpar/cdsc " @@ -225,7 +190,7 @@ sdp_result_e sdp_add_new_attr (void *sdp_ptr, u16 level, u8 cap_num, return (SDP_INVALID_PARAMETER); } - /* Some attributes are valid only under media level */ + /* Some attributes are valid only under media level */ if (level == SDP_SESSION_LEVEL) { switch (attr_type) { case SDP_ATTR_RTCP: @@ -247,7 +212,7 @@ sdp_result_e sdp_add_new_attr (void *sdp_ptr, u16 level, u8 cap_num, new_attr_p->next_p = NULL; /* Initialize the new attribute structure */ - if ((new_attr_p->type == SDP_ATTR_X_CAP) || + if ((new_attr_p->type == SDP_ATTR_X_CAP) || (new_attr_p->type == SDP_ATTR_CDSC)) { new_attr_p->attr.cap_p = (sdp_mca_t *)SDP_MALLOC(sizeof(sdp_mca_t)); if (new_attr_p->attr.cap_p == NULL) { @@ -267,7 +232,7 @@ sdp_result_e sdp_add_new_attr (void *sdp_ptr, u16 level, u8 cap_num, fmtp_p->bitrate = 0; fmtp_p->cif = 0; fmtp_p->qcif = 0; - fmtp_p->profile = SDP_INVALID_VALUE; + fmtp_p->profile = SDP_INVALID_VALUE; fmtp_p->level = SDP_INVALID_VALUE; fmtp_p->parameter_add = TRUE; for (i=0; i < SDP_NE_NUM_BMAP_WORDS; i++) { @@ -279,7 +244,7 @@ sdp_result_e sdp_add_new_attr (void *sdp_ptr, u16 level, u8 cap_num, } else if (new_attr_p->type == SDP_ATTR_DIRECTION) { comediadir_p = &(new_attr_p->attr.comediadir); comediadir_p->role = SDP_MEDIADIR_ROLE_PASSIVE; - comediadir_p->conn_info_present = FALSE; + comediadir_p->conn_info_present = FALSE; } else if (new_attr_p->type == SDP_ATTR_MPTIME) { sdp_mptime_t *mptime = &(new_attr_p->attr.mptime); mptime->num_intervals = 0; @@ -413,7 +378,7 @@ void sdp_copy_attr_fields (sdp_attr_t *src_attr_p, sdp_attr_t *dst_attr_p) dst_attr_p->attr.qos.direction = src_attr_p->attr.qos.direction; dst_attr_p->attr.qos.confirm = src_attr_p->attr.qos.confirm; break; - + case SDP_ATTR_CURR: dst_attr_p->attr.curr.type = src_attr_p->attr.curr.type; dst_attr_p->attr.curr.direction = src_attr_p->attr.curr.direction; @@ -425,8 +390,8 @@ void sdp_copy_attr_fields (sdp_attr_t *src_attr_p, sdp_attr_t *dst_attr_p) dst_attr_p->attr.des.status_type = src_attr_p->attr.des.status_type; dst_attr_p->attr.des.strength = src_attr_p->attr.des.strength; break; - - + + case SDP_ATTR_CONF: dst_attr_p->attr.conf.type = src_attr_p->attr.conf.type; dst_attr_p->attr.conf.direction = src_attr_p->attr.conf.direction; @@ -460,44 +425,44 @@ void sdp_copy_attr_fields (sdp_attr_t *src_attr_p, sdp_attr_t *dst_attr_p) dst_attr_p->attr.fmtp.cpcf = src_attr_p->attr.fmtp.cpcf; dst_attr_p->attr.fmtp.bpp = src_attr_p->attr.fmtp.bpp; dst_attr_p->attr.fmtp.hrd = src_attr_p->attr.fmtp.hrd; - + dst_attr_p->attr.fmtp.profile = src_attr_p->attr.fmtp.profile; dst_attr_p->attr.fmtp.level = src_attr_p->attr.fmtp.level; dst_attr_p->attr.fmtp.is_interlace = src_attr_p->attr.fmtp.is_interlace; - - sstrncpy(dst_attr_p->attr.fmtp.profile_level_id, + + sstrncpy(dst_attr_p->attr.fmtp.profile_level_id, src_attr_p->attr.fmtp.profile_level_id, SDP_MAX_STRING_LEN+1); - sstrncpy(dst_attr_p->attr.fmtp.parameter_sets, + sstrncpy(dst_attr_p->attr.fmtp.parameter_sets, src_attr_p->attr.fmtp.parameter_sets, SDP_MAX_STRING_LEN+1); dst_attr_p->attr.fmtp.deint_buf_req = src_attr_p->attr.fmtp.deint_buf_req; - dst_attr_p->attr.fmtp.max_don_diff = + dst_attr_p->attr.fmtp.max_don_diff = src_attr_p->attr.fmtp.max_don_diff; dst_attr_p->attr.fmtp.init_buf_time = src_attr_p->attr.fmtp.init_buf_time; dst_attr_p->attr.fmtp.packetization_mode = src_attr_p->attr.fmtp.packetization_mode; - dst_attr_p->attr.fmtp.flag = + dst_attr_p->attr.fmtp.flag = src_attr_p->attr.fmtp.flag; - + dst_attr_p->attr.fmtp.max_mbps = src_attr_p->attr.fmtp.max_mbps; - dst_attr_p->attr.fmtp.max_fs = src_attr_p->attr.fmtp.max_fs; + dst_attr_p->attr.fmtp.max_fs = src_attr_p->attr.fmtp.max_fs; dst_attr_p->attr.fmtp.max_cpb = src_attr_p->attr.fmtp.max_cpb; dst_attr_p->attr.fmtp.max_dpb = src_attr_p->attr.fmtp.max_dpb; dst_attr_p->attr.fmtp.max_br = src_attr_p->attr.fmtp.max_br; - dst_attr_p->attr.fmtp.redundant_pic_cap = - src_attr_p->attr.fmtp.redundant_pic_cap; + dst_attr_p->attr.fmtp.redundant_pic_cap = + src_attr_p->attr.fmtp.redundant_pic_cap; dst_attr_p->attr.fmtp.deint_buf_cap = src_attr_p->attr.fmtp.deint_buf_cap; - dst_attr_p->attr.fmtp.max_rcmd_nalu_size = - src_attr_p->attr.fmtp.max_rcmd_nalu_size; + dst_attr_p->attr.fmtp.max_rcmd_nalu_size = + src_attr_p->attr.fmtp.max_rcmd_nalu_size; dst_attr_p->attr.fmtp.interleaving_depth = src_attr_p->attr.fmtp.interleaving_depth; - dst_attr_p->attr.fmtp.parameter_add = + dst_attr_p->attr.fmtp.parameter_add = src_attr_p->attr.fmtp.parameter_add; - + dst_attr_p->attr.fmtp.annex_d = src_attr_p->attr.fmtp.annex_d; dst_attr_p->attr.fmtp.annex_f = src_attr_p->attr.fmtp.annex_f; dst_attr_p->attr.fmtp.annex_i = src_attr_p->attr.fmtp.annex_i; @@ -505,16 +470,16 @@ void sdp_copy_attr_fields (sdp_attr_t *src_attr_p, sdp_attr_t *dst_attr_p) dst_attr_p->attr.fmtp.annex_t = src_attr_p->attr.fmtp.annex_t; dst_attr_p->attr.fmtp.annex_k_val = src_attr_p->attr.fmtp.annex_k_val; dst_attr_p->attr.fmtp.annex_n_val = src_attr_p->attr.fmtp.annex_n_val; - dst_attr_p->attr.fmtp.annex_p_val_picture_resize = + dst_attr_p->attr.fmtp.annex_p_val_picture_resize = src_attr_p->attr.fmtp.annex_p_val_picture_resize; dst_attr_p->attr.fmtp.annex_p_val_warp = src_attr_p->attr.fmtp.annex_p_val_warp; - + dst_attr_p->attr.fmtp.annexb_required = src_attr_p->attr.fmtp.annexb_required; dst_attr_p->attr.fmtp.annexa_required = src_attr_p->attr.fmtp.annexa_required; - dst_attr_p->attr.fmtp.fmtp_format + dst_attr_p->attr.fmtp.fmtp_format = src_attr_p->attr.fmtp.fmtp_format; for (i=0; i < SDP_NE_NUM_BMAP_WORDS; i++) { @@ -523,13 +488,13 @@ void sdp_copy_attr_fields (sdp_attr_t *src_attr_p, sdp_attr_t *dst_attr_p) break; case SDP_ATTR_RTPMAP: - dst_attr_p->attr.transport_map.payload_num = + dst_attr_p->attr.transport_map.payload_num = src_attr_p->attr.transport_map.payload_num; - dst_attr_p->attr.transport_map.clockrate = + dst_attr_p->attr.transport_map.clockrate = src_attr_p->attr.transport_map.clockrate; - dst_attr_p->attr.transport_map.num_chan = + dst_attr_p->attr.transport_map.num_chan = src_attr_p->attr.transport_map.num_chan; - sstrncpy(dst_attr_p->attr.transport_map.encname, + sstrncpy(dst_attr_p->attr.transport_map.encname, src_attr_p->attr.transport_map.encname, SDP_MAX_STRING_LEN+1); break; @@ -551,10 +516,10 @@ void sdp_copy_attr_fields (sdp_attr_t *src_attr_p, sdp_attr_t *dst_attr_p) break; case SDP_ATTR_X_PC_CODEC: - dst_attr_p->attr.pccodec.num_payloads = + dst_attr_p->attr.pccodec.num_payloads = src_attr_p->attr.pccodec.num_payloads; for (i=0; i < src_attr_p->attr.pccodec.num_payloads; i++) { - dst_attr_p->attr.pccodec.payload_type[i] = + dst_attr_p->attr.pccodec.payload_type[i] = src_attr_p->attr.pccodec.payload_type[i]; } break; @@ -565,7 +530,7 @@ void sdp_copy_attr_fields (sdp_attr_t *src_attr_p, sdp_attr_t *dst_attr_p) src_attr_p->attr.comediadir.role; if (src_attr_p->attr.comediadir.conn_info.nettype) { - dst_attr_p->attr.comediadir.conn_info_present = TRUE; + dst_attr_p->attr.comediadir.conn_info_present = TRUE; dst_attr_p->attr.comediadir.conn_info.nettype = src_attr_p->attr.comediadir.conn_info.nettype; dst_attr_p->attr.comediadir.conn_info.addrtype = @@ -615,15 +580,15 @@ void sdp_copy_attr_fields (sdp_attr_t *src_attr_p, sdp_attr_t *dst_attr_p) src_attr_p->attr.stream_data.group_attr; dst_attr_p->attr.stream_data.num_group_id = src_attr_p->attr.stream_data.num_group_id; - + for (i=0; i < src_attr_p->attr.stream_data.num_group_id; i++) { - dst_attr_p->attr.stream_data.group_id_arr[i] = + dst_attr_p->attr.stream_data.group_id_arr[i] = src_attr_p->attr.stream_data.group_id_arr[i]; } break; case SDP_ATTR_SOURCE_FILTER: - dst_attr_p->attr.source_filter.mode = + dst_attr_p->attr.source_filter.mode = src_attr_p->attr.source_filter.mode; dst_attr_p->attr.source_filter.nettype = src_attr_p->attr.source_filter.nettype; @@ -637,7 +602,7 @@ void sdp_copy_attr_fields (sdp_attr_t *src_attr_p, sdp_attr_t *dst_attr_p) src_attr_p->attr.source_filter.src_list[i], SDP_MAX_STRING_LEN+1); } - dst_attr_p->attr.source_filter.num_src_addr = + dst_attr_p->attr.source_filter.num_src_addr = src_attr_p->attr.source_filter.num_src_addr; break; @@ -645,46 +610,46 @@ void sdp_copy_attr_fields (sdp_attr_t *src_attr_p, sdp_attr_t *dst_attr_p) case SDP_ATTR_SDESCRIPTIONS: /* Tag parameter is not valid for version 2 sdescriptions */ if (src_attr_p->type == SDP_ATTR_SDESCRIPTIONS) { - dst_attr_p->attr.srtp_context.tag = + dst_attr_p->attr.srtp_context.tag = src_attr_p->attr.srtp_context.tag; } - + dst_attr_p->attr.srtp_context.selection_flags = src_attr_p->attr.srtp_context.selection_flags; - + dst_attr_p->attr.srtp_context.suite = src_attr_p->attr.srtp_context.suite; - + dst_attr_p->attr.srtp_context.master_key_size_bytes = src_attr_p->attr.srtp_context.master_key_size_bytes; - + dst_attr_p->attr.srtp_context.master_salt_size_bytes = src_attr_p->attr.srtp_context.master_salt_size_bytes; - + bcopy(src_attr_p->attr.srtp_context.master_key, dst_attr_p->attr.srtp_context.master_key, SDP_SRTP_MAX_KEY_SIZE_BYTES); - + bcopy(src_attr_p->attr.srtp_context.master_salt, dst_attr_p->attr.srtp_context.master_salt, SDP_SRTP_MAX_SALT_SIZE_BYTES); - - + + sstrncpy((char*)dst_attr_p->attr.srtp_context.master_key_lifetime, (char*)src_attr_p->attr.srtp_context.master_key_lifetime, SDP_SRTP_MAX_LIFETIME_BYTES); - + sstrncpy((char*)dst_attr_p->attr.srtp_context.mki, (char*)src_attr_p->attr.srtp_context.mki, SDP_SRTP_MAX_MKI_SIZE_BYTES); - + dst_attr_p->attr.srtp_context.mki_size_bytes = src_attr_p->attr.srtp_context.mki_size_bytes; - + if (src_attr_p->attr.srtp_context.session_parameters) { dst_attr_p->attr.srtp_context.session_parameters = cpr_strdup(src_attr_p->attr.srtp_context.session_parameters); } - + break; default: @@ -701,16 +666,16 @@ void sdp_copy_attr_fields (sdp_attr_t *src_attr_p, sdp_attr_t *dst_attr_p) * copied. * Description: Add a new attribute of the specified type at the given * level and capability level or base attribute if cap_num - * is zero. + * is zero. * Parameters: src_sdp_ptr The source SDP handle. * dst_sdp_ptr The dest SDP handle. * src_level The level of the source attribute. * dst_level The level of the source attribute. * src_cap_num The src capability number associated with the - * attribute if any. + * attribute if any. * dst_cap_num The dst capability number associated with the * attribute if any. Note that src and dst - * cap_num must both be zero or both be non-zero. + * cap_num must both be zero or both be non-zero. * src_attr_type The type of source attribute. This cannot * be SDP_ATTR_X_CAP or SDP_ATTR_X_CPAR. * src_inst_num The instance number of the source attr. @@ -742,7 +707,7 @@ sdp_result_e sdp_copy_attr (void *src_sdp_ptr, void *dst_sdp_ptr, return (SDP_INVALID_PARAMETER); } - /* Cannot copy X_CAP/CDSC attributes directly using this routine. + /* Cannot copy X_CAP/CDSC attributes directly using this routine. * You also can't copy X_CPAR/CPAR attributes by specifying them directly, * but you can copy them by giving the corresponding cap_num. */ if ((src_attr_type == SDP_ATTR_X_CAP) || @@ -753,7 +718,7 @@ sdp_result_e sdp_copy_attr (void *src_sdp_ptr, void *dst_sdp_ptr, return (SDP_INVALID_PARAMETER); } - src_attr_p = sdp_find_attr(src_sdp_p, src_level, src_cap_num, + src_attr_p = sdp_find_attr(src_sdp_p, src_level, src_cap_num, src_attr_type, src_inst_num); if (src_attr_p == NULL) { if (src_sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -820,7 +785,7 @@ sdp_result_e sdp_copy_attr (void *src_sdp_ptr, void *dst_sdp_ptr, new_attr_p->attr.qos.direction = src_attr_p->attr.qos.direction; new_attr_p->attr.qos.confirm = src_attr_p->attr.qos.confirm; break; - + case SDP_ATTR_CURR: new_attr_p->attr.curr.type = src_attr_p->attr.curr.type; new_attr_p->attr.curr.direction = src_attr_p->attr.curr.direction; @@ -832,7 +797,7 @@ sdp_result_e sdp_copy_attr (void *src_sdp_ptr, void *dst_sdp_ptr, new_attr_p->attr.des.status_type = src_attr_p->attr.des.status_type; new_attr_p->attr.des.strength = src_attr_p->attr.des.strength; break; - + case SDP_ATTR_CONF: new_attr_p->attr.conf.type = src_attr_p->attr.conf.type; new_attr_p->attr.conf.direction = src_attr_p->attr.conf.direction; @@ -869,40 +834,40 @@ sdp_result_e sdp_copy_attr (void *src_sdp_ptr, void *dst_sdp_ptr, new_attr_p->attr.fmtp.profile = src_attr_p->attr.fmtp.profile; new_attr_p->attr.fmtp.level = src_attr_p->attr.fmtp.level; new_attr_p->attr.fmtp.is_interlace = src_attr_p->attr.fmtp.is_interlace; - - sstrncpy(new_attr_p->attr.fmtp.profile_level_id, + + sstrncpy(new_attr_p->attr.fmtp.profile_level_id, src_attr_p->attr.fmtp.profile_level_id, SDP_MAX_STRING_LEN+1); - sstrncpy(new_attr_p->attr.fmtp.parameter_sets, + sstrncpy(new_attr_p->attr.fmtp.parameter_sets, src_attr_p->attr.fmtp.parameter_sets, SDP_MAX_STRING_LEN+1); new_attr_p->attr.fmtp.deint_buf_req = src_attr_p->attr.fmtp.deint_buf_req; - new_attr_p->attr.fmtp.max_don_diff = + new_attr_p->attr.fmtp.max_don_diff = src_attr_p->attr.fmtp.max_don_diff; new_attr_p->attr.fmtp.init_buf_time = src_attr_p->attr.fmtp.init_buf_time; new_attr_p->attr.fmtp.packetization_mode = src_attr_p->attr.fmtp.packetization_mode; - new_attr_p->attr.fmtp.flag = + new_attr_p->attr.fmtp.flag = src_attr_p->attr.fmtp.flag; new_attr_p->attr.fmtp.max_mbps = src_attr_p->attr.fmtp.max_mbps; - new_attr_p->attr.fmtp.max_fs = src_attr_p->attr.fmtp.max_fs; + new_attr_p->attr.fmtp.max_fs = src_attr_p->attr.fmtp.max_fs; new_attr_p->attr.fmtp.max_cpb = src_attr_p->attr.fmtp.max_cpb; new_attr_p->attr.fmtp.max_dpb = src_attr_p->attr.fmtp.max_dpb; new_attr_p->attr.fmtp.max_br = src_attr_p->attr.fmtp.max_br; - new_attr_p->attr.fmtp.redundant_pic_cap = - src_attr_p->attr.fmtp.redundant_pic_cap; + new_attr_p->attr.fmtp.redundant_pic_cap = + src_attr_p->attr.fmtp.redundant_pic_cap; new_attr_p->attr.fmtp.deint_buf_cap = src_attr_p->attr.fmtp.deint_buf_cap; new_attr_p->attr.fmtp.max_rcmd_nalu_size = - src_attr_p->attr.fmtp.max_rcmd_nalu_size; + src_attr_p->attr.fmtp.max_rcmd_nalu_size; new_attr_p->attr.fmtp.interleaving_depth = src_attr_p->attr.fmtp.interleaving_depth; - new_attr_p->attr.fmtp.parameter_add = + new_attr_p->attr.fmtp.parameter_add = src_attr_p->attr.fmtp.parameter_add; - + new_attr_p->attr.fmtp.annex_d = src_attr_p->attr.fmtp.annex_d; new_attr_p->attr.fmtp.annex_f = src_attr_p->attr.fmtp.annex_f; new_attr_p->attr.fmtp.annex_i = src_attr_p->attr.fmtp.annex_i; @@ -910,16 +875,16 @@ sdp_result_e sdp_copy_attr (void *src_sdp_ptr, void *dst_sdp_ptr, new_attr_p->attr.fmtp.annex_t = src_attr_p->attr.fmtp.annex_t; new_attr_p->attr.fmtp.annex_k_val = src_attr_p->attr.fmtp.annex_k_val; new_attr_p->attr.fmtp.annex_n_val = src_attr_p->attr.fmtp.annex_n_val; - new_attr_p->attr.fmtp.annex_p_val_picture_resize = + new_attr_p->attr.fmtp.annex_p_val_picture_resize = src_attr_p->attr.fmtp.annex_p_val_picture_resize; new_attr_p->attr.fmtp.annex_p_val_warp = src_attr_p->attr.fmtp.annex_p_val_warp; - + new_attr_p->attr.fmtp.annexb_required = src_attr_p->attr.fmtp.annexb_required; new_attr_p->attr.fmtp.annexa_required = src_attr_p->attr.fmtp.annexa_required; - new_attr_p->attr.fmtp.fmtp_format + new_attr_p->attr.fmtp.fmtp_format = src_attr_p->attr.fmtp.fmtp_format; for (i=0; i < SDP_NE_NUM_BMAP_WORDS; i++) { @@ -928,13 +893,13 @@ sdp_result_e sdp_copy_attr (void *src_sdp_ptr, void *dst_sdp_ptr, break; case SDP_ATTR_RTPMAP: - new_attr_p->attr.transport_map.payload_num = + new_attr_p->attr.transport_map.payload_num = src_attr_p->attr.transport_map.payload_num; - new_attr_p->attr.transport_map.clockrate = + new_attr_p->attr.transport_map.clockrate = src_attr_p->attr.transport_map.clockrate; - new_attr_p->attr.transport_map.num_chan = + new_attr_p->attr.transport_map.num_chan = src_attr_p->attr.transport_map.num_chan; - sstrncpy(new_attr_p->attr.transport_map.encname, + sstrncpy(new_attr_p->attr.transport_map.encname, src_attr_p->attr.transport_map.encname, SDP_MAX_STRING_LEN+1); break; @@ -956,10 +921,10 @@ sdp_result_e sdp_copy_attr (void *src_sdp_ptr, void *dst_sdp_ptr, break; case SDP_ATTR_X_PC_CODEC: - new_attr_p->attr.pccodec.num_payloads = + new_attr_p->attr.pccodec.num_payloads = src_attr_p->attr.pccodec.num_payloads; for (i=0; i < src_attr_p->attr.pccodec.num_payloads; i++) { - new_attr_p->attr.pccodec.payload_type[i] = + new_attr_p->attr.pccodec.payload_type[i] = src_attr_p->attr.pccodec.payload_type[i]; } break; @@ -970,7 +935,7 @@ sdp_result_e sdp_copy_attr (void *src_sdp_ptr, void *dst_sdp_ptr, src_attr_p->attr.comediadir.role; if (src_attr_p->attr.comediadir.conn_info.nettype) { - new_attr_p->attr.comediadir.conn_info_present = TRUE; + new_attr_p->attr.comediadir.conn_info_present = TRUE; new_attr_p->attr.comediadir.conn_info.nettype = src_attr_p->attr.comediadir.conn_info.nettype; new_attr_p->attr.comediadir.conn_info.addrtype = @@ -1002,10 +967,10 @@ sdp_result_e sdp_copy_attr (void *src_sdp_ptr, void *dst_sdp_ptr, break; case SDP_ATTR_MPTIME: - new_attr_p->attr.mptime.num_intervals = + new_attr_p->attr.mptime.num_intervals = src_attr_p->attr.mptime.num_intervals; for (i=0; i < src_attr_p->attr.mptime.num_intervals; i++) { - new_attr_p->attr.mptime.intervals[i] = + new_attr_p->attr.mptime.intervals[i] = src_attr_p->attr.mptime.intervals[i]; } break; @@ -1020,15 +985,15 @@ sdp_result_e sdp_copy_attr (void *src_sdp_ptr, void *dst_sdp_ptr, sstrncpy(new_attr_p->attr.stream_data.x_confid, src_attr_p->attr.stream_data.x_confid,SDP_MAX_STRING_LEN+1); break; - + case SDP_ATTR_GROUP: new_attr_p->attr.stream_data.group_attr = src_attr_p->attr.stream_data.group_attr; new_attr_p->attr.stream_data.num_group_id = src_attr_p->attr.stream_data.num_group_id; - + for (i=0; i < src_attr_p->attr.stream_data.num_group_id; i++) { - new_attr_p->attr.stream_data.group_id_arr[i] = + new_attr_p->attr.stream_data.group_id_arr[i] = src_attr_p->attr.stream_data.group_id_arr[i]; } break; @@ -1056,47 +1021,47 @@ sdp_result_e sdp_copy_attr (void *src_sdp_ptr, void *dst_sdp_ptr, case SDP_ATTR_SDESCRIPTIONS: /* Tag parameter is only valid for version 9 sdescriptions */ if (src_attr_type == SDP_ATTR_SDESCRIPTIONS) { - new_attr_p->attr.srtp_context.tag = + new_attr_p->attr.srtp_context.tag = src_attr_p->attr.srtp_context.tag; } - - new_attr_p->attr.srtp_context.suite = + + new_attr_p->attr.srtp_context.suite = src_attr_p->attr.srtp_context.suite; - - new_attr_p->attr.srtp_context.selection_flags = + + new_attr_p->attr.srtp_context.selection_flags = src_attr_p->attr.srtp_context.selection_flags; - + new_attr_p->attr.srtp_context.master_key_size_bytes = src_attr_p->attr.srtp_context.master_key_size_bytes; - + new_attr_p->attr.srtp_context.master_salt_size_bytes = src_attr_p->attr.srtp_context.master_salt_size_bytes; - + bcopy(src_attr_p->attr.srtp_context.master_key, new_attr_p->attr.srtp_context.master_key, SDP_SRTP_MAX_KEY_SIZE_BYTES); - + bcopy(src_attr_p->attr.srtp_context.master_salt, new_attr_p->attr.srtp_context.master_salt, SDP_SRTP_MAX_SALT_SIZE_BYTES); - - + + sstrncpy((char*)new_attr_p->attr.srtp_context.master_key_lifetime, (char*)src_attr_p->attr.srtp_context.master_key_lifetime, SDP_SRTP_MAX_LIFETIME_BYTES); - + sstrncpy((char*)new_attr_p->attr.srtp_context.mki, (char*)src_attr_p->attr.srtp_context.mki, SDP_SRTP_MAX_MKI_SIZE_BYTES); - + new_attr_p->attr.srtp_context.mki_size_bytes = src_attr_p->attr.srtp_context.mki_size_bytes; - + if (src_attr_p->attr.srtp_context.session_parameters) { new_attr_p->attr.srtp_context.session_parameters = cpr_strdup(src_attr_p->attr.srtp_context.session_parameters); } - + break; default: @@ -1147,7 +1112,7 @@ sdp_result_e sdp_copy_attr (void *src_sdp_ptr, void *dst_sdp_ptr, } else { for (prev_attr_p = cap_p->media_attrs_p; prev_attr_p->next_p != NULL; - prev_attr_p = prev_attr_p->next_p) { + prev_attr_p = prev_attr_p->next_p) { ; /* Empty for */ } prev_attr_p->next_p = new_attr_p; @@ -1240,10 +1205,10 @@ sdp_result_e sdp_copy_all_attrs (void *src_sdp_ptr, void *dst_sdp_ptr, /* Simple attr type - copy over all the attr info. */ sdp_copy_attr_fields(src_attr_p, new_attr_p); } else { - /* X-cap/cdsc attrs must be handled differently. Allocate an + /* X-cap/cdsc attrs must be handled differently. Allocate an * mca structure and copy over any X-cpar/cdsc attrs. */ - - new_attr_p->attr.cap_p = + + new_attr_p->attr.cap_p = (sdp_mca_t *)SDP_MALLOC(sizeof(sdp_mca_t)); if (new_attr_p->attr.cap_p == NULL) { sdp_free_attr(new_attr_p); @@ -1272,9 +1237,9 @@ sdp_result_e sdp_copy_all_attrs (void *src_sdp_ptr, void *dst_sdp_ptr, dst_cap_p->mid = src_cap_p->mid; for (i=0; i < SDP_MAX_PAYLOAD_TYPES; i++) { - new_attr_p->attr.cap_p->payload_indicator[i] = + new_attr_p->attr.cap_p->payload_indicator[i] = src_attr_p->attr.cap_p->payload_indicator[i]; - new_attr_p->attr.cap_p->payload_type[i] = + new_attr_p->attr.cap_p->payload_type[i] = src_attr_p->attr.cap_p->payload_type[i]; } @@ -1289,7 +1254,7 @@ sdp_result_e sdp_copy_all_attrs (void *src_sdp_ptr, void *dst_sdp_ptr, sdp_free_attr (new_attr_p); return (SDP_NO_RESOURCE); } - + /* Copy X-cpar/cpar attribute info. */ sdp_copy_attr_fields(src_cap_attr_p, new_cap_attr_p); @@ -1330,10 +1295,10 @@ sdp_result_e sdp_copy_all_attrs (void *src_sdp_ptr, void *dst_sdp_ptr, } /* Function: sdp_attr_num_instances - * Description: Get the number of attributes of the specified type at + * Description: Get the number of attributes of the specified type at * the given level and capability level. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * attr_type The type of attribute to add. @@ -1358,7 +1323,7 @@ sdp_result_e sdp_attr_num_instances (void *sdp_ptr, u16 level, u8 cap_num, rc = sdp_find_attr_list(sdp_p, level, cap_num, &attr_p, fname); if (rc == SDP_SUCCESS) { - /* Found the attr list. Count the number of attrs of the given + /* Found the attr list. Count the number of attrs of the given * type at this level. */ for (; attr_p != NULL; attr_p = attr_p->next_p) { if (attr_p->type == attr_type) { @@ -1373,10 +1338,10 @@ sdp_result_e sdp_attr_num_instances (void *sdp_ptr, u16 level, u8 cap_num, /* Function: sdp_get_total_attrs - * Description: Get the total number of attributes at the given level and + * Description: Get the total number of attributes at the given level and * capability level. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * num_attrs Pointer to a u16 in which to return the @@ -1400,7 +1365,7 @@ sdp_result_e sdp_get_total_attrs (void *sdp_ptr, u16 level, u8 cap_num, rc = sdp_find_attr_list(sdp_p, level, cap_num, &attr_p, fname); if (rc == SDP_SUCCESS) { - /* Found the attr list. Count the total number of attrs + /* Found the attr list. Count the total number of attrs * at this level. */ for (; attr_p != NULL; attr_p = attr_p->next_p) { (*num_attrs)++; @@ -1418,7 +1383,7 @@ sdp_result_e sdp_get_total_attrs (void *sdp_ptr, u16 level, u8 cap_num, * the attribute type and the instance number of that particular * type of attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * attr_num Attribute number to retrieve. This is an overall @@ -1447,7 +1412,7 @@ sdp_result_e sdp_get_attr_type (void *sdp_ptr, u16 level, u8 cap_num, if (attr_num < 1) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - SDP_ERROR("%s %s, invalid attr num specified (%u) at level %u", + SDP_ERROR("%s %s, invalid attr num specified (%u) at level %u", sdp_p->debug_str, fname, attr_num, level); } sdp_p->conf_p->num_invalid_param++; @@ -1479,21 +1444,21 @@ sdp_result_e sdp_get_attr_type (void *sdp_ptr, u16 level, u8 cap_num, /* Internal routine to free the memory associated with an attribute. * Certain attributes allocate additional memory. Free this and then - * free the attribute itself. - * Note that this routine may be called at any point (i.e., may be - * called due to a failure case) and so the additional memory - * associated with an attribute may or may not have been already + * free the attribute itself. + * Note that this routine may be called at any point (i.e., may be + * called due to a failure case) and so the additional memory + * associated with an attribute may or may not have been already * allocated. This routine should check this carefully. */ -void sdp_free_attr (sdp_attr_t *attr_p) +void sdp_free_attr (sdp_attr_t *attr_p) { sdp_mca_t *cap_p; sdp_attr_t *cpar_p; sdp_attr_t *next_cpar_p; - /* If this is an X-cap/cdsc attr, free the cap_p structure and + /* If this is an X-cap/cdsc attr, free the cap_p structure and * all X-cpar/cpar attributes. */ - if ((attr_p->type == SDP_ATTR_X_CAP) || + if ((attr_p->type == SDP_ATTR_X_CAP) || (attr_p->type == SDP_ATTR_CDSC)) { cap_p = attr_p->attr.cap_p; if (cap_p != NULL) { @@ -1518,7 +1483,7 @@ void sdp_free_attr (sdp_attr_t *attr_p) /* Function: sdp_delete_attr * Description: Delete the specified attribute from the SDP structure. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * attr_type The type of attribute to delete. @@ -1585,7 +1550,7 @@ sdp_result_e sdp_delete_attr (void *sdp_ptr, u16 level, u8 cap_num, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s Delete attribute (%s) instance %d " - "not found.", sdp_p->debug_str, + "not found.", sdp_p->debug_str, sdp_get_attr_name(attr_type), inst_num); } sdp_p->conf_p->num_invalid_param++; @@ -1638,10 +1603,10 @@ sdp_result_e sdp_delete_attr (void *sdp_ptr, u16 level, u8 cap_num, /* Function: sdp_delete_all_attrs - * Description: Delete all attributes at the specified level from + * Description: Delete all attributes at the specified level from * the SDP structure. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * Returns: SDP_SUCCESS Attributes were deleted successfully. @@ -1715,12 +1680,12 @@ sdp_result_e sdp_delete_all_attrs (void *sdp_ptr, u16 level, u8 cap_num) * filled in on return if successful. * fname String function name calling this routine. * Use for printing debug. - * Returns: SDP_SUCCESS - * SDP_INVALID_MEDIA_LEVEL - * SDP_INVALID_CAPABILITY + * Returns: SDP_SUCCESS + * SDP_INVALID_MEDIA_LEVEL + * SDP_INVALID_CAPABILITY * SDP_FAILURE */ -sdp_result_e sdp_find_attr_list (sdp_t *sdp_p, u16 level, u8 cap_num, +sdp_result_e sdp_find_attr_list (sdp_t *sdp_p, u16 level, u8 cap_num, sdp_attr_t **attr_p, char *fname) { sdp_mca_t *mca_p; @@ -1762,16 +1727,16 @@ sdp_result_e sdp_find_attr_list (sdp_t *sdp_p, u16 level, u8 cap_num, } /* Function: sdp_find_attr - * Description: Find the specified attribute in an SDP structure. + * Description: Find the specified attribute in an SDP structure. * Note: This is not an API for the application but an internal * routine used by the SDP library. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * attr_type The type of attribute to find. * inst_num The instance num of the attribute to delete. - * Range should be (1 - max num insts of this + * Range should be (1 - max num insts of this * particular type of attribute at this level). * Returns: Pointer to the attribute or NULL if not found. */ @@ -1836,11 +1801,11 @@ sdp_attr_t *sdp_find_attr (sdp_t *sdp_p, u16 level, u8 cap_num, } /* Function: sdp_find_capability - * Description: Find the specified capability attribute in an SDP structure. + * Description: Find the specified capability attribute in an SDP structure. * Note: This is not an API for the application but an internal * routine used by the SDP library. * Parameters: sdp_p The SDP handle. - * level The level to check for the capability. + * level The level to check for the capability. * cap_num The capability number to locate. * Returns: Pointer to the capability attribute or NULL if not found. */ @@ -1854,7 +1819,7 @@ sdp_attr_t *sdp_find_capability (sdp_t *sdp_p, u16 level, u8 cap_num) if (level == SDP_SESSION_LEVEL) { for (attr_p = sdp_p->sess_attrs_p; attr_p != NULL; attr_p = attr_p->next_p) { - if ((attr_p->type == SDP_ATTR_X_CAP) || + if ((attr_p->type == SDP_ATTR_X_CAP) || (attr_p->type == SDP_ATTR_CDSC)) { cap_p = attr_p->attr.cap_p; cur_cap_num += cap_p->num_payloads; @@ -1871,7 +1836,7 @@ sdp_attr_t *sdp_find_capability (sdp_t *sdp_p, u16 level, u8 cap_num) } for (attr_p = mca_p->media_attrs_p; attr_p != NULL; attr_p = attr_p->next_p) { - if ((attr_p->type == SDP_ATTR_X_CAP) || + if ((attr_p->type == SDP_ATTR_X_CAP) || (attr_p->type == SDP_ATTR_CDSC)) { cap_p = attr_p->attr.cap_p; cur_cap_num += cap_p->num_payloads; @@ -1894,17 +1859,17 @@ sdp_attr_t *sdp_find_capability (sdp_t *sdp_p, u16 level, u8 cap_num) /* Function: sdp_attr_valid(void *sdp_ptr) * Description: Returns true or false depending on whether the specified - * instance of the given attribute has been defined at the + * instance of the given attribute has been defined at the * given level. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * attr_type The attribute type to validate. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. * Returns: TRUE or FALSE. */ -tinybool sdp_attr_valid (void *sdp_ptr, sdp_attr_e attr_type, u16 level, +tinybool sdp_attr_valid (void *sdp_ptr, sdp_attr_e attr_type, u16 level, u8 cap_num, u16 inst_num) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -1931,7 +1896,7 @@ tinybool sdp_attr_valid (void *sdp_ptr, sdp_attr_e attr_type, u16 level, * and framing. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * attr_type The simple string attribute type. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -1947,9 +1912,9 @@ const char *sdp_attr_get_simple_string (void *sdp_ptr, sdp_attr_e attr_type, return (NULL); } - if ((attr_type != SDP_ATTR_BEARER) && + if ((attr_type != SDP_ATTR_BEARER) && (attr_type != SDP_ATTR_CALLED) && - (attr_type != SDP_ATTR_CONN_TYPE) && + (attr_type != SDP_ATTR_CONN_TYPE) && (attr_type != SDP_ATTR_DIALED) && (attr_type != SDP_ATTR_DIALING) && (attr_type != SDP_ATTR_FRAMING) && @@ -1969,7 +1934,7 @@ const char *sdp_attr_get_simple_string (void *sdp_ptr, sdp_attr_e attr_type, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s Attribute %s, level %u instance %u not found.", - sdp_p->debug_str, sdp_get_attr_name(attr_type), + sdp_p->debug_str, sdp_get_attr_name(attr_type), level, inst_num); } sdp_p->conf_p->num_invalid_param++; @@ -1984,13 +1949,13 @@ const char *sdp_attr_get_simple_string (void *sdp_ptr, sdp_attr_e attr_type, * routine can only be called for attributes that have just * one string parameter. The string is copied into the SDP * structure so application memory will not be referenced by - * the SDP library. + * the SDP library. * Attributes with a simple string parameter currently include: * bearer, called, connection_type, dialed, dialing, and * framing. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * attr_type The simple string attribute type. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -2009,9 +1974,9 @@ sdp_result_e sdp_attr_set_simple_string (void *sdp_ptr, sdp_attr_e attr_type, return (SDP_INVALID_SDP_PTR); } - if ((attr_type != SDP_ATTR_BEARER) && + if ((attr_type != SDP_ATTR_BEARER) && (attr_type != SDP_ATTR_CALLED) && - (attr_type != SDP_ATTR_CONN_TYPE) && + (attr_type != SDP_ATTR_CONN_TYPE) && (attr_type != SDP_ATTR_DIALED) && (attr_type != SDP_ATTR_DIALING) && (attr_type != SDP_ATTR_FRAMING) && @@ -2037,7 +2002,7 @@ sdp_result_e sdp_attr_set_simple_string (void *sdp_ptr, sdp_attr_e attr_type, sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } else { - sstrncpy(attr_p->attr.string_val, string_parm, + sstrncpy(attr_p->attr.string_val, string_parm, sizeof(attr_p->attr.string_val)); return (SDP_SUCCESS); } @@ -2049,7 +2014,7 @@ sdp_result_e sdp_attr_set_simple_string (void *sdp_ptr, sdp_attr_e attr_type, * one u32 parameter. If the given attribute is not defined, * zero will be returned. There is no way for the application * to determine if zero is the actual value or the attribute - * wasn't defined, so the application must use the + * wasn't defined, so the application must use the * sdp_attr_valid function to determine this. * Attributes with a simple u32 parameter currently include: * eecid, ptime, T38FaxVersion, T38maxBitRate, T38FaxMaxBuffer, @@ -2057,7 +2022,7 @@ sdp_result_e sdp_attr_set_simple_string (void *sdp_ptr, sdp_attr_e attr_type, * TC2PayloadBytes, TC2WindowSize, rtcp. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * attr_type The simple u32 attribute type. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -2073,10 +2038,10 @@ u32 sdp_attr_get_simple_u32 (void *sdp_ptr, sdp_attr_e attr_type, u16 level, return (0); } - if ((attr_type != SDP_ATTR_EECID) && + if ((attr_type != SDP_ATTR_EECID) && (attr_type != SDP_ATTR_PTIME) && (attr_type != SDP_ATTR_MAXPTIME) && - (attr_type != SDP_ATTR_T38_VERSION) && + (attr_type != SDP_ATTR_T38_VERSION) && (attr_type != SDP_ATTR_T38_MAXBITRATE) && (attr_type != SDP_ATTR_T38_MAXBUFFER) && (attr_type != SDP_ATTR_T38_MAXDGRAM) && @@ -2111,7 +2076,7 @@ u32 sdp_attr_get_simple_u32 (void *sdp_ptr, sdp_attr_e attr_type, u16 level, } /* Function: sdp_attr_set_simple_u32 - * Description: Sets the value of an unsigned 32-bit attribute parameter. + * Description: Sets the value of an unsigned 32-bit attribute parameter. * This routine can only be called for attributes that have just * one u32 parameter. * Attributes with a simple u32 parameter currently include: @@ -2120,7 +2085,7 @@ u32 sdp_attr_get_simple_u32 (void *sdp_ptr, sdp_attr_e attr_type, u16 level, * TC2PayloadBytes, TC2WindowSize, rtcp. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * attr_type The simple u32 attribute type. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -2128,7 +2093,7 @@ u32 sdp_attr_get_simple_u32 (void *sdp_ptr, sdp_attr_e attr_type, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_simple_u32 (void *sdp_ptr, sdp_attr_e attr_type, +sdp_result_e sdp_attr_set_simple_u32 (void *sdp_ptr, sdp_attr_e attr_type, u16 level, u8 cap_num, u16 inst_num, u32 num_parm) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -2138,10 +2103,10 @@ sdp_result_e sdp_attr_set_simple_u32 (void *sdp_ptr, sdp_attr_e attr_type, return (SDP_INVALID_SDP_PTR); } - if ((attr_type != SDP_ATTR_EECID) && + if ((attr_type != SDP_ATTR_EECID) && (attr_type != SDP_ATTR_PTIME) && (attr_type != SDP_ATTR_MAXPTIME) && - (attr_type != SDP_ATTR_T38_VERSION) && + (attr_type != SDP_ATTR_T38_VERSION) && (attr_type != SDP_ATTR_T38_MAXBITRATE) && (attr_type != SDP_ATTR_T38_MAXBUFFER) && (attr_type != SDP_ATTR_T38_MAXDGRAM) && @@ -2183,14 +2148,14 @@ sdp_result_e sdp_attr_set_simple_u32 (void *sdp_ptr, sdp_attr_e attr_type, * one boolean parameter. If the given attribute is not defined, * FALSE will be returned. There is no way for the application * to determine if FALSE is the actual value or the attribute - * wasn't defined, so the application must use the + * wasn't defined, so the application must use the * sdp_attr_valid function to determine this. * Attributes with a simple boolean parameter currently include: - * T38FaxFillBitRemoval, T38FaxTranscodingMMR, + * T38FaxFillBitRemoval, T38FaxTranscodingMMR, * T38FaxTranscodingJBIG, and TMRGwXid. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * attr_type The simple boolean attribute type. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -2206,7 +2171,7 @@ tinybool sdp_attr_get_simple_boolean (void *sdp_ptr, sdp_attr_e attr_type, return (FALSE); } - if ((attr_type != SDP_ATTR_T38_FILLBITREMOVAL) && + if ((attr_type != SDP_ATTR_T38_FILLBITREMOVAL) && (attr_type != SDP_ATTR_T38_TRANSCODINGMMR) && (attr_type != SDP_ATTR_T38_TRANSCODINGJBIG) && (attr_type != SDP_ATTR_TMRGWXID)) { @@ -2233,15 +2198,15 @@ tinybool sdp_attr_get_simple_boolean (void *sdp_ptr, sdp_attr_e attr_type, } /* Function: sdp_attr_set_simple_boolean - * Description: Sets the value of a boolean attribute parameter. + * Description: Sets the value of a boolean attribute parameter. * This routine can only be called for attributes that have just * one boolean parameter. * Attributes with a simple boolean parameter currently include: - * T38FaxFillBitRemoval, T38FaxTranscodingMMR, + * T38FaxFillBitRemoval, T38FaxTranscodingMMR, * T38FaxTranscodingJBIG, and TMRGwXid. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * attr_type The simple boolean attribute type. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -2260,7 +2225,7 @@ sdp_result_e sdp_attr_set_simple_boolean (void *sdp_ptr, sdp_attr_e attr_type, return (SDP_INVALID_SDP_PTR); } - if ((attr_type != SDP_ATTR_T38_FILLBITREMOVAL) && + if ((attr_type != SDP_ATTR_T38_FILLBITREMOVAL) && (attr_type != SDP_ATTR_T38_TRANSCODINGMMR) && (attr_type != SDP_ATTR_T38_TRANSCODINGJBIG) && (attr_type != SDP_ATTR_TMRGWXID)) { @@ -2294,10 +2259,10 @@ sdp_result_e sdp_attr_set_simple_boolean (void *sdp_ptr, sdp_attr_e attr_type, * within the maxprate attribute. * * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * inst_num The attribute instance number to set. * - * Returns a pointer to a constant char array that stores the packet-rate, + * Returns a pointer to a constant char array that stores the packet-rate, * OR null if the attribute does not exist. */ const char* @@ -2314,7 +2279,7 @@ sdp_attr_get_maxprate (void *sdp_ptr, u16 level, u16 inst_num) if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s Attribute %s, level %u instance %u not found.", - sdp_p->debug_str, sdp_get_attr_name(SDP_ATTR_MAXPRATE), + sdp_p->debug_str, sdp_get_attr_name(SDP_ATTR_MAXPRATE), level, inst_num); } sdp_p->conf_p->num_invalid_param++; @@ -2333,12 +2298,12 @@ sdp_attr_get_maxprate (void *sdp_ptr, u16 level, u16 inst_num) * * max-p-rate-def = "a" "=" "maxprate" ":" packet-rate CRLF * packet-rate = 1*DIGIT ["." 1*DIGIT] - * - * + * + * * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * inst_num The attribute instance number to set. - * string_parm A string that contains the value of packet-rate + * string_parm A string that contains the value of packet-rate * that needs to be advertised. * * Note that we use a string to set the packet-rate, so the application layer @@ -2357,7 +2322,7 @@ sdp_attr_get_maxprate (void *sdp_ptr, u16 level, u16 inst_num) * SDP_SUCCESS - If we are successfully able to set the maxprate attribute. */ sdp_result_e -sdp_attr_set_maxprate (void *sdp_ptr, u16 level, u16 inst_num, +sdp_attr_set_maxprate (void *sdp_ptr, u16 level, u16 inst_num, const char *string_parm) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -2385,18 +2350,18 @@ sdp_attr_set_maxprate (void *sdp_ptr, u16 level, u16 inst_num, return (SDP_INVALID_PARAMETER); } - sstrncpy(attr_p->attr.string_val, string_parm, + sstrncpy(attr_p->attr.string_val, string_parm, sizeof(attr_p->attr.string_val)); return (SDP_SUCCESS); } } /* Function: sdp_attr_get_t38ratemgmt - * Description: Returns the value of the t38ratemgmt attribute - * parameter specified for the given attribute. If the given - * attribute is not defined, SDP_T38_UNKNOWN_RATE is returned. + * Description: Returns the value of the t38ratemgmt attribute + * parameter specified for the given attribute. If the given + * attribute is not defined, SDP_T38_UNKNOWN_RATE is returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -2412,7 +2377,7 @@ sdp_t38_ratemgmt_e sdp_attr_get_t38ratemgmt (void *sdp_ptr, u16 level, return (SDP_T38_UNKNOWN_RATE); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_T38_RATEMGMT, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -2428,9 +2393,9 @@ sdp_t38_ratemgmt_e sdp_attr_get_t38ratemgmt (void *sdp_ptr, u16 level, /* Function: sdp_attr_set_t38ratemgmt * Description: Sets the value of the t38ratemgmt attribute parameter - * for the given attribute. + * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -2438,7 +2403,7 @@ sdp_t38_ratemgmt_e sdp_attr_get_t38ratemgmt (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_t38ratemgmt (void *sdp_ptr, u16 level, +sdp_result_e sdp_attr_set_t38ratemgmt (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, sdp_t38_ratemgmt_e t38ratemgmt) { @@ -2449,7 +2414,7 @@ sdp_result_e sdp_attr_set_t38ratemgmt (void *sdp_ptr, u16 level, return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_T38_RATEMGMT, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -2466,11 +2431,11 @@ sdp_result_e sdp_attr_set_t38ratemgmt (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_t38udpec - * Description: Returns the value of the t38udpec attribute - * parameter specified for the given attribute. If the given - * attribute is not defined, SDP_T38_UDPEC_UNKNOWN is returned. + * Description: Returns the value of the t38udpec attribute + * parameter specified for the given attribute. If the given + * attribute is not defined, SDP_T38_UDPEC_UNKNOWN is returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -2486,7 +2451,7 @@ sdp_t38_udpec_e sdp_attr_get_t38udpec (void *sdp_ptr, u16 level, return (SDP_T38_UDPEC_UNKNOWN); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_T38_UDPEC, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -2502,9 +2467,9 @@ sdp_t38_udpec_e sdp_attr_get_t38udpec (void *sdp_ptr, u16 level, /* Function: sdp_attr_set_t38udpec * Description: Sets the value of the t38ratemgmt attribute parameter - * for the given attribute. + * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -2512,7 +2477,7 @@ sdp_t38_udpec_e sdp_attr_get_t38udpec (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_t38udpec (void *sdp_ptr, u16 level, +sdp_result_e sdp_attr_set_t38udpec (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, sdp_t38_udpec_e t38udpec) { @@ -2523,7 +2488,7 @@ sdp_result_e sdp_attr_set_t38udpec (void *sdp_ptr, u16 level, return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_T38_UDPEC, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -2546,7 +2511,7 @@ sdp_result_e sdp_attr_set_t38udpec (void *sdp_ptr, u16 level, * the given level. If none of these attributes are specified, * the direction will be sendrecv by default. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * Returns: An SDP direction enum value. @@ -2599,20 +2564,20 @@ sdp_direction_e sdp_get_media_direction (void *sdp_ptr, u16 level, /* * sdp_delete_all_media_direction_attrs - * - * Deletes all the media direction attributes from a given SDP level. + * + * Deletes all the media direction attributes from a given SDP level. * Media direction attributes include: * a=sendonly * a=recvonly * a=sendrecv * a=inactive * - * This function can be used in conjunction with sdp_add_new_attr, to ensure - * that there is only one direction attribute per level. - * It can also be used to delete all attributes when the client wants to + * This function can be used in conjunction with sdp_add_new_attr, to ensure + * that there is only one direction attribute per level. + * It can also be used to delete all attributes when the client wants to * advertise the default direction, i.e. a=sendrecv. */ -sdp_result_e sdp_delete_all_media_direction_attrs (void *sdp_ptr, u16 level) +sdp_result_e sdp_delete_all_media_direction_attrs (void *sdp_ptr, u16 level) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_mca_t *mca_p; @@ -2628,11 +2593,11 @@ sdp_result_e sdp_delete_all_media_direction_attrs (void *sdp_ptr, u16 level) if (level == SDP_SESSION_LEVEL) { attr_p = sdp_p->sess_attrs_p; while (attr_p != NULL) { - if ((attr_p->type == SDP_ATTR_INACTIVE) || + if ((attr_p->type == SDP_ATTR_INACTIVE) || (attr_p->type == SDP_ATTR_SENDONLY) || (attr_p->type == SDP_ATTR_RECVONLY) || (attr_p->type == SDP_ATTR_SENDRECV)) { - + tmp_attr_p = attr_p; if (prev_attr_p == NULL) { @@ -2642,7 +2607,7 @@ sdp_result_e sdp_delete_all_media_direction_attrs (void *sdp_ptr, u16 level) } attr_p = attr_p->next_p; - sdp_free_attr(tmp_attr_p); + sdp_free_attr(tmp_attr_p); } else { prev_attr_p = attr_p; attr_p = attr_p->next_p; @@ -2656,7 +2621,7 @@ sdp_result_e sdp_delete_all_media_direction_attrs (void *sdp_ptr, u16 level) attr_p = mca_p->media_attrs_p; while (attr_p != NULL) { - if ((attr_p->type == SDP_ATTR_INACTIVE) || + if ((attr_p->type == SDP_ATTR_INACTIVE) || (attr_p->type == SDP_ATTR_SENDONLY) || (attr_p->type == SDP_ATTR_RECVONLY) || (attr_p->type == SDP_ATTR_SENDRECV)) { @@ -2704,11 +2669,11 @@ tinybool sdp_validate_qos_attr (sdp_attr_e qos_attr) /* Function: sdp_attr_get_qos_strength * Description: Returns the value of the qos attribute strength - * parameter specified for the given attribute. If the given - * attribute is not defined, SDP_QOS_STRENGTH_UNKNOWN is - * returned. + * parameter specified for the given attribute. If the given + * attribute is not defined, SDP_QOS_STRENGTH_UNKNOWN is + * returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * qos_attr The specific type of qos attribute. May be @@ -2737,7 +2702,7 @@ sdp_qos_strength_e sdp_attr_get_qos_strength (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s %s attribute, level %u instance %u " - "not found.", sdp_p->debug_str, + "not found.", sdp_p->debug_str, sdp_get_attr_name(qos_attr), level, inst_num); } sdp_p->conf_p->num_invalid_param++; @@ -2750,18 +2715,18 @@ sdp_qos_strength_e sdp_attr_get_qos_strength (void *sdp_ptr, u16 level, return (attr_p->attr.des.strength); default: return SDP_QOS_STRENGTH_UNKNOWN; - + } } } /* Function: sdp_attr_get_qos_direction * Description: Returns the value of the qos attribute direction - * parameter specified for the given attribute. If the given - * attribute is not defined, SDP_QOS_DIR_UNKNOWN is - * returned. + * parameter specified for the given attribute. If the given + * attribute is not defined, SDP_QOS_DIR_UNKNOWN is + * returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * qos_attr The specific type of qos attribute. May be @@ -2807,18 +2772,18 @@ sdp_qos_dir_e sdp_attr_get_qos_direction (void *sdp_ptr, u16 level, return (attr_p->attr.conf.direction); default: return SDP_QOS_DIR_UNKNOWN; - + } } } /* Function: sdp_attr_get_qos_status_type * Description: Returns the value of the qos attribute status_type - * parameter specified for the given attribute. If the given - * attribute is not defined, SDP_QOS_STATUS_TYPE_UNKNOWN is - * returned. + * parameter specified for the given attribute. If the given + * attribute is not defined, SDP_QOS_STATUS_TYPE_UNKNOWN is + * returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * qos_attr The specific type of qos attribute. May be @@ -2862,7 +2827,7 @@ sdp_qos_status_types_e sdp_attr_get_qos_status_type (void *sdp_ptr, u16 level, return (attr_p->attr.conf.status_type); default: return SDP_QOS_STATUS_TYPE_UNKNOWN; - + } } } @@ -2872,7 +2837,7 @@ sdp_qos_status_types_e sdp_attr_get_qos_status_type (void *sdp_ptr, u16 level, * parameter specified for the given attribute. Returns TRUE if * the confirm parameter is specified. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * qos_attr The specific type of qos attribute. May be @@ -2901,7 +2866,7 @@ tinybool sdp_attr_get_qos_confirm (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s %s attribute, level %u instance %u " - "not found.", sdp_p->debug_str, + "not found.", sdp_p->debug_str, sdp_get_attr_name(qos_attr), level, inst_num); } sdp_p->conf_p->num_invalid_param++; @@ -2912,9 +2877,9 @@ tinybool sdp_attr_get_qos_confirm (void *sdp_ptr, u16 level, } /* Function: sdp_attr_set_qos_strength - * Description: Sets the qos strength value for the specified qos attribute. + * Description: Sets the qos strength value for the specified qos attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * qos_attr The specific type of qos attribute. May be @@ -2924,7 +2889,7 @@ tinybool sdp_attr_get_qos_confirm (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_qos_strength (void *sdp_ptr, u16 level, u8 cap_num, +sdp_result_e sdp_attr_set_qos_strength (void *sdp_ptr, u16 level, u8 cap_num, sdp_attr_e qos_attr, u16 inst_num, sdp_qos_strength_e strength) { @@ -2961,18 +2926,18 @@ sdp_result_e sdp_attr_set_qos_strength (void *sdp_ptr, u16 level, u8 cap_num, return (SDP_SUCCESS); default: return (SDP_FAILURE); - + } } } /* Function: sdp_attr_get_curr_type * Description: Returns the value of the curr attribute status_type - * parameter specified for the given attribute. If the given - * attribute is not defined, SDP_CURR_UNKNOWN_TYPE is - * returned. + * parameter specified for the given attribute. If the given + * attribute is not defined, SDP_CURR_UNKNOWN_TYPE is + * returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * qos_attr The specific type of qos attribute. May be @@ -3006,11 +2971,11 @@ sdp_curr_type_e sdp_attr_get_curr_type (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_des_type * Description: Returns the value of the des attribute status_type - * parameter specified for the given attribute. If the given - * attribute is not defined, SDP_DES_UNKNOWN_TYPE is - * returned. + * parameter specified for the given attribute. If the given + * attribute is not defined, SDP_DES_UNKNOWN_TYPE is + * returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * qos_attr The specific type of qos attribute. May be @@ -3044,11 +3009,11 @@ sdp_des_type_e sdp_attr_get_des_type (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_conf_type * Description: Returns the value of the des attribute status_type - * parameter specified for the given attribute. If the given - * attribute is not defined, SDP_CONF_UNKNOWN_TYPE is - * returned. + * parameter specified for the given attribute. If the given + * attribute is not defined, SDP_CONF_UNKNOWN_TYPE is + * returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * qos_attr The specific type of qos attribute. May be @@ -3082,11 +3047,11 @@ sdp_conf_type_e sdp_attr_get_conf_type (void *sdp_ptr, u16 level, /* Function: sdp_attr_set_curr_type * Description: Returns the value of the curr attribute status_type - * parameter specified for the given attribute. If the given - * attribute is not defined, SDP_CURR_UNKNOWN_TYPE is - * returned. + * parameter specified for the given attribute. If the given + * attribute is not defined, SDP_CURR_UNKNOWN_TYPE is + * returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * qos_attr The specific type of qos attribute. May be @@ -3117,7 +3082,7 @@ sdp_result_e sdp_attr_set_curr_type (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s %s attribute, level %u instance %u " - "not found.", sdp_p->debug_str, + "not found.", sdp_p->debug_str, sdp_get_attr_name(qos_attr), level, inst_num); } sdp_p->conf_p->num_invalid_param++; @@ -3130,11 +3095,11 @@ sdp_result_e sdp_attr_set_curr_type (void *sdp_ptr, u16 level, /* Function: sdp_attr_set_des_type * Description: Sets the value of the des attribute type - * parameter specified for the given attribute. If the given - * attribute is not defined, SDP_DES_UNKNOWN_TYPE is - * returned. + * parameter specified for the given attribute. If the given + * attribute is not defined, SDP_DES_UNKNOWN_TYPE is + * returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * qos_attr The specific type of qos attribute. May be @@ -3165,7 +3130,7 @@ sdp_result_e sdp_attr_set_des_type (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s %s attribute, level %u instance %u " - "not found.", sdp_p->debug_str, + "not found.", sdp_p->debug_str, sdp_get_attr_name(qos_attr), level, inst_num); } sdp_p->conf_p->num_invalid_param++; @@ -3179,11 +3144,11 @@ sdp_result_e sdp_attr_set_des_type (void *sdp_ptr, u16 level, /* Function: sdp_attr_set_conf_type * Description: Sets the value of the conf attribute type - * parameter specified for the given attribute. If the given - * attribute is not defined, SDP_CONF_UNKNOWN_TYPE is - * returned. + * parameter specified for the given attribute. If the given + * attribute is not defined, SDP_CONF_UNKNOWN_TYPE is + * returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * qos_attr The specific type of qos attribute. May be @@ -3214,7 +3179,7 @@ sdp_result_e sdp_attr_set_conf_type (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s %s attribute, level %u instance %u " - "not found.", sdp_p->debug_str, + "not found.", sdp_p->debug_str, sdp_get_attr_name(qos_attr), level, inst_num); } sdp_p->conf_p->num_invalid_param++; @@ -3226,9 +3191,9 @@ sdp_result_e sdp_attr_set_conf_type (void *sdp_ptr, u16 level, } /* Function: sdp_attr_set_qos_direction - * Description: Sets the qos direction value for the specified qos attribute. + * Description: Sets the qos direction value for the specified qos attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * qos_attr The specific type of qos attribute. May be @@ -3238,7 +3203,7 @@ sdp_result_e sdp_attr_set_conf_type (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_qos_direction (void *sdp_ptr, u16 level, u8 cap_num, +sdp_result_e sdp_attr_set_qos_direction (void *sdp_ptr, u16 level, u8 cap_num, sdp_attr_e qos_attr, u16 inst_num, sdp_qos_dir_e direction) { @@ -3260,7 +3225,7 @@ sdp_result_e sdp_attr_set_qos_direction (void *sdp_ptr, u16 level, u8 cap_num, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s %s attribute, level %u instance %u " - "not found.", sdp_p->debug_str, + "not found.", sdp_p->debug_str, sdp_get_attr_name(qos_attr), level, inst_num); } sdp_p->conf_p->num_invalid_param++; @@ -3281,15 +3246,15 @@ sdp_result_e sdp_attr_set_qos_direction (void *sdp_ptr, u16 level, u8 cap_num, return (SDP_SUCCESS); default: return (SDP_FAILURE); - + } } } /* Function: sdp_attr_set_qos_status_type - * Description: Sets the qos status_type value for the specified qos attribute. + * Description: Sets the qos status_type value for the specified qos attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * qos_attr The specific type of qos attribute. May be @@ -3299,7 +3264,7 @@ sdp_result_e sdp_attr_set_qos_direction (void *sdp_ptr, u16 level, u8 cap_num, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_qos_status_type (void *sdp_ptr, u16 level, u8 cap_num, +sdp_result_e sdp_attr_set_qos_status_type (void *sdp_ptr, u16 level, u8 cap_num, sdp_attr_e qos_attr, u16 inst_num, sdp_qos_status_types_e status_type) { @@ -3321,7 +3286,7 @@ sdp_result_e sdp_attr_set_qos_status_type (void *sdp_ptr, u16 level, u8 cap_num, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s %s attribute, level %u instance %u " - "not found.", sdp_p->debug_str, + "not found.", sdp_p->debug_str, sdp_get_attr_name(qos_attr), level, inst_num); } sdp_p->conf_p->num_invalid_param++; @@ -3339,7 +3304,7 @@ sdp_result_e sdp_attr_set_qos_status_type (void *sdp_ptr, u16 level, u8 cap_num, return (SDP_SUCCESS); default: return (SDP_FAILURE); - + } } } @@ -3349,7 +3314,7 @@ sdp_result_e sdp_attr_set_qos_status_type (void *sdp_ptr, u16 level, u8 cap_num, * If this parameter is TRUE, the confirm parameter will be * specified when the SDP description is built. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * qos_attr The specific type of qos attribute. May be @@ -3359,7 +3324,7 @@ sdp_result_e sdp_attr_set_qos_status_type (void *sdp_ptr, u16 level, u8 cap_num, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_qos_confirm (void *sdp_ptr, u16 level, u8 cap_num, +sdp_result_e sdp_attr_set_qos_confirm (void *sdp_ptr, u16 level, u8 cap_num, sdp_attr_e qos_attr, u16 inst_num, tinybool qos_confirm) { @@ -3395,11 +3360,11 @@ sdp_result_e sdp_attr_set_qos_confirm (void *sdp_ptr, u16 level, u8 cap_num, /* Function: sdp_attr_get_subnet_nettype - * Description: Returns the value of the subnet attribute network type - * parameter specified for the given attribute. If the given - * attribute is not defined, SDP_NT_INVALID is returned. + * Description: Returns the value of the subnet attribute network type + * parameter specified for the given attribute. If the given + * attribute is not defined, SDP_NT_INVALID is returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -3415,7 +3380,7 @@ sdp_nettype_e sdp_attr_get_subnet_nettype (void *sdp_ptr, u16 level, return (SDP_NT_INVALID); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SUBNET, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -3430,11 +3395,11 @@ sdp_nettype_e sdp_attr_get_subnet_nettype (void *sdp_ptr, u16 level, } /* Function: sdp_attr_get_subnet_addrtype - * Description: Returns the value of the subnet attribute address type - * parameter specified for the given attribute. If the given - * attribute is not defined, SDP_AT_INVALID is returned. + * Description: Returns the value of the subnet attribute address type + * parameter specified for the given attribute. If the given + * attribute is not defined, SDP_AT_INVALID is returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -3450,7 +3415,7 @@ sdp_addrtype_e sdp_attr_get_subnet_addrtype (void *sdp_ptr, u16 level, return (SDP_AT_INVALID); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SUBNET, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -3465,13 +3430,13 @@ sdp_addrtype_e sdp_attr_get_subnet_addrtype (void *sdp_ptr, u16 level, } /* Function: sdp_attr_get_subnet_addr - * Description: Returns the value of the subnet attribute address - * parameter specified for the given attribute. If the given + * Description: Returns the value of the subnet attribute address + * parameter specified for the given attribute. If the given * attribute is not defined, NULL is returned. Value is * returned as a const ptr and so cannot be modified by the * application. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -3487,7 +3452,7 @@ const char *sdp_attr_get_subnet_addr (void *sdp_ptr, u16 level, return (NULL); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SUBNET, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -3502,13 +3467,13 @@ const char *sdp_attr_get_subnet_addr (void *sdp_ptr, u16 level, } /* Function: sdp_attr_get_subnet_prefix - * Description: Returns the value of the subnet attribute prefix - * parameter specified for the given attribute. If the given + * Description: Returns the value of the subnet attribute prefix + * parameter specified for the given attribute. If the given * attribute is not defined, SDP_INVALID_PARAM is returned. - * Note that this is value is defined to be (-2) and is + * Note that this is value is defined to be (-2) and is * different from the return code SDP_INVALID_PARAMETER. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -3524,7 +3489,7 @@ int32 sdp_attr_get_subnet_prefix (void *sdp_ptr, u16 level, return (SDP_INVALID_VALUE); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SUBNET, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -3540,9 +3505,9 @@ int32 sdp_attr_get_subnet_prefix (void *sdp_ptr, u16 level, /* Function: sdp_attr_set_subnet_nettype * Description: Sets the value of the subnet attribute nettype parameter - * for the given attribute. + * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -3550,7 +3515,7 @@ int32 sdp_attr_get_subnet_prefix (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_subnet_nettype (void *sdp_ptr, u16 level, +sdp_result_e sdp_attr_set_subnet_nettype (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, sdp_nettype_e nettype) { @@ -3561,7 +3526,7 @@ sdp_result_e sdp_attr_set_subnet_nettype (void *sdp_ptr, u16 level, return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SUBNET, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -3578,9 +3543,9 @@ sdp_result_e sdp_attr_set_subnet_nettype (void *sdp_ptr, u16 level, /* Function: sdp_attr_set_subnet_addrtype * Description: Sets the value of the subnet attribute addrtype parameter - * for the given attribute. + * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -3588,7 +3553,7 @@ sdp_result_e sdp_attr_set_subnet_nettype (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_subnet_addrtype (void *sdp_ptr, u16 level, +sdp_result_e sdp_attr_set_subnet_addrtype (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, sdp_addrtype_e sdp_addrtype) { @@ -3599,7 +3564,7 @@ sdp_result_e sdp_attr_set_subnet_addrtype (void *sdp_ptr, u16 level, return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SUBNET, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -3616,11 +3581,11 @@ sdp_result_e sdp_attr_set_subnet_addrtype (void *sdp_ptr, u16 level, /* Function: sdp_attr_set_subnet_addr * Description: Sets the value of the subnet attribute addr parameter - * for the given attribute. The address is copied into the - * SDP structure so application memory will not be + * for the given attribute. The address is copied into the + * SDP structure so application memory will not be * referenced by the SDP lib. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -3628,7 +3593,7 @@ sdp_result_e sdp_attr_set_subnet_addrtype (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_subnet_addr (void *sdp_ptr, u16 level, +sdp_result_e sdp_attr_set_subnet_addr (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, const char *addr) { @@ -3639,7 +3604,7 @@ sdp_result_e sdp_attr_set_subnet_addr (void *sdp_ptr, u16 level, return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SUBNET, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -3649,7 +3614,7 @@ sdp_result_e sdp_attr_set_subnet_addr (void *sdp_ptr, u16 level, sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } else { - sstrncpy(attr_p->attr.subnet.addr, addr, + sstrncpy(attr_p->attr.subnet.addr, addr, sizeof(attr_p->attr.subnet.addr)) ; return (SDP_SUCCESS); } @@ -3659,7 +3624,7 @@ sdp_result_e sdp_attr_set_subnet_addr (void *sdp_ptr, u16 level, * Description: Sets the value of the subnet attribute prefix parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -3667,7 +3632,7 @@ sdp_result_e sdp_attr_set_subnet_addr (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_subnet_prefix (void *sdp_ptr, u16 level, +sdp_result_e sdp_attr_set_subnet_prefix (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, int32 prefix) { @@ -3678,7 +3643,7 @@ sdp_result_e sdp_attr_set_subnet_prefix (void *sdp_ptr, u16 level, return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SUBNET, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -3695,19 +3660,19 @@ sdp_result_e sdp_attr_set_subnet_prefix (void *sdp_ptr, u16 level, /* Function: sdp_attr_rtpmap_payload_valid - * Description: Returns true or false depending on whether an rtpmap + * Description: Returns true or false depending on whether an rtpmap * attribute was specified with the given payload value * at the given level. If it was, the instance number of * that attribute is returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number of the attribute * found is returned via this param. * Returns: TRUE or FALSE. */ -tinybool sdp_attr_rtpmap_payload_valid (void *sdp_ptr, u16 level, u8 cap_num, +tinybool sdp_attr_rtpmap_payload_valid (void *sdp_ptr, u16 level, u8 cap_num, u16 *inst_num, u16 payload_type) { u16 i; @@ -3721,29 +3686,29 @@ tinybool sdp_attr_rtpmap_payload_valid (void *sdp_ptr, u16 level, u8 cap_num, return (FALSE); } - if (sdp_attr_num_instances(sdp_ptr, level, cap_num, + if (sdp_attr_num_instances(sdp_ptr, level, cap_num, SDP_ATTR_RTPMAP, &num_instances) != SDP_SUCCESS) { return (FALSE); } for (i=1; i <= num_instances; i++) { attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_RTPMAP, i); - if ((attr_p != NULL) && + if ((attr_p != NULL) && (attr_p->attr.transport_map.payload_num == payload_type)) { *inst_num = i; return (TRUE); } - } + } return (FALSE); } /* Function: sdp_attr_get_rtpmap_payload_type * Description: Returns the value of the rtpmap attribute payload type - * parameter specified for the given attribute. If the given + * parameter specified for the given attribute. If the given * attribute is not defined, zero is returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -3779,7 +3744,7 @@ u16 sdp_attr_get_rtpmap_payload_type (void *sdp_ptr, u16 level, * application. If the given attribute is not defined, NULL * will be returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -3810,10 +3775,10 @@ const char *sdp_attr_get_rtpmap_encname (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_rtpmap_clockrate * Description: Returns the value of the rtpmap attribute clockrate - * parameter specified for the given attribute. If the given + * parameter specified for the given attribute. If the given * attribute is not defined, zero is returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -3844,10 +3809,10 @@ u32 sdp_attr_get_rtpmap_clockrate (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_rtpmap_num_chan * Description: Returns the value of the rtpmap attribute num_chan - * parameter specified for the given attribute. If the given + * parameter specified for the given attribute. If the given * attribute is not defined, zero is returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -3880,7 +3845,7 @@ u16 sdp_attr_get_rtpmap_num_chan (void *sdp_ptr, u16 level, * Description: Sets the value of the rtpmap attribute payload type parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -3888,8 +3853,8 @@ u16 sdp_attr_get_rtpmap_num_chan (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_rtpmap_payload_type (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_rtpmap_payload_type (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 payload_num) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -3917,7 +3882,7 @@ sdp_result_e sdp_attr_set_rtpmap_payload_type (void *sdp_ptr, u16 level, * Description: Sets the value of the rtpmap attribute encname parameter * for the given attribute. String is copied into SDP memory. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -3945,7 +3910,7 @@ sdp_result_e sdp_attr_set_rtpmap_encname (void *sdp_ptr, u16 level, u8 cap_num, return (SDP_INVALID_PARAMETER); } else { if (encname) { - sstrncpy(attr_p->attr.transport_map.encname, encname, + sstrncpy(attr_p->attr.transport_map.encname, encname, sizeof(attr_p->attr.transport_map.encname)); } return (SDP_SUCCESS); @@ -4028,7 +3993,7 @@ sdp_result_e sdp_attr_set_ice_attribute(void *sdp_ptr, u16 level, if (!ice_attrib) { return (SDP_INVALID_PARAMETER); - } + } sstrncpy(attr_p->attr.ice_attr, ice_attrib, sizeof(attr_p->attr.ice_attr)); return (SDP_SUCCESS); @@ -4196,7 +4161,7 @@ sdp_result_e sdp_attr_set_dtls_fingerprint_attribute(void *sdp_ptr, u16 level, * Description: Sets the value of the rtpmap attribute clockrate parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -4204,8 +4169,8 @@ sdp_result_e sdp_attr_set_dtls_fingerprint_attribute(void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_rtpmap_clockrate (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_rtpmap_clockrate (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u32 clockrate) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -4233,7 +4198,7 @@ sdp_result_e sdp_attr_set_rtpmap_clockrate (void *sdp_ptr, u16 level, * Description: Sets the value of the rtpmap attribute num_chan parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -4241,8 +4206,8 @@ sdp_result_e sdp_attr_set_rtpmap_clockrate (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_rtpmap_num_chan (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_rtpmap_num_chan (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 num_chan) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -4268,19 +4233,19 @@ sdp_result_e sdp_attr_set_rtpmap_num_chan (void *sdp_ptr, u16 level, /* Function: sdp_attr_sprtmap_payload_valid - * Description: Returns true or false depending on whether an sprtmap + * Description: Returns true or false depending on whether an sprtmap * attribute was specified with the given payload value * at the given level. If it was, the instance number of * that attribute is returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number of the attribute * found is returned via this param. * Returns: TRUE or FALSE. */ -tinybool sdp_attr_sprtmap_payload_valid (void *sdp_ptr, u16 level, u8 cap_num, +tinybool sdp_attr_sprtmap_payload_valid (void *sdp_ptr, u16 level, u8 cap_num, u16 *inst_num, u16 payload_type) { u16 i; @@ -4294,29 +4259,29 @@ tinybool sdp_attr_sprtmap_payload_valid (void *sdp_ptr, u16 level, u8 cap_num, return (FALSE); } - if (sdp_attr_num_instances(sdp_ptr, level, cap_num, + if (sdp_attr_num_instances(sdp_ptr, level, cap_num, SDP_ATTR_SPRTMAP, &num_instances) != SDP_SUCCESS) { return (FALSE); } for (i=1; i <= num_instances; i++) { attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SPRTMAP, i); - if ((attr_p != NULL) && + if ((attr_p != NULL) && (attr_p->attr.transport_map.payload_num == payload_type)) { *inst_num = i; return (TRUE); } - } + } return (FALSE); } /* Function: sdp_attr_get_sprtmap_payload_type * Description: Returns the value of the sprtmap attribute payload type - * parameter specified for the given attribute. If the given + * parameter specified for the given attribute. If the given * attribute is not defined, zero is returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -4352,7 +4317,7 @@ u16 sdp_attr_get_sprtmap_payload_type (void *sdp_ptr, u16 level, * application. If the given attribute is not defined, NULL * will be returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -4383,10 +4348,10 @@ const char *sdp_attr_get_sprtmap_encname (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_sprtmap_clockrate * Description: Returns the value of the sprtmap attribute clockrate - * parameter specified for the given attribute. If the given + * parameter specified for the given attribute. If the given * attribute is not defined, zero is returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -4417,10 +4382,10 @@ u32 sdp_attr_get_sprtmap_clockrate (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_sprtmap_num_chan * Description: Returns the value of the sprtmap attribute num_chan - * parameter specified for the given attribute. If the given + * parameter specified for the given attribute. If the given * attribute is not defined, zero is returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -4453,7 +4418,7 @@ u16 sdp_attr_get_sprtmap_num_chan (void *sdp_ptr, u16 level, * Description: Sets the value of the sprtmap attribute payload type parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -4461,8 +4426,8 @@ u16 sdp_attr_get_sprtmap_num_chan (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_sprtmap_payload_type (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_sprtmap_payload_type (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 payload_num) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -4490,7 +4455,7 @@ sdp_result_e sdp_attr_set_sprtmap_payload_type (void *sdp_ptr, u16 level, * Description: Sets the value of the sprtmap attribute encname parameter * for the given attribute. String is copied into SDP memory. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -4517,7 +4482,7 @@ sdp_result_e sdp_attr_set_sprtmap_encname (void *sdp_ptr, u16 level, u8 cap_num, sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } else { - sstrncpy(attr_p->attr.transport_map.encname, encname, + sstrncpy(attr_p->attr.transport_map.encname, encname, sizeof(attr_p->attr.transport_map.encname)); return (SDP_SUCCESS); } @@ -4527,7 +4492,7 @@ sdp_result_e sdp_attr_set_sprtmap_encname (void *sdp_ptr, u16 level, u8 cap_num, * Description: Sets the value of the sprtmap attribute clockrate parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -4535,8 +4500,8 @@ sdp_result_e sdp_attr_set_sprtmap_encname (void *sdp_ptr, u16 level, u8 cap_num, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_sprtmap_clockrate (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_sprtmap_clockrate (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 clockrate) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -4564,7 +4529,7 @@ sdp_result_e sdp_attr_set_sprtmap_clockrate (void *sdp_ptr, u16 level, * Description: Sets the value of the sprtmap attribute num_chan parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -4572,8 +4537,8 @@ sdp_result_e sdp_attr_set_sprtmap_clockrate (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_sprtmap_num_chan (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_sprtmap_num_chan (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 num_chan) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -4612,13 +4577,13 @@ sdp_result_e sdp_attr_set_sprtmap_num_chan (void *sdp_ptr, u16 level, * at the given level. If it was, the instance number of * that attribute is returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. * Returns: TRUE or FALSE. */ -tinybool sdp_attr_fmtp_payload_valid (void *sdp_ptr, u16 level, u8 cap_num, +tinybool sdp_attr_fmtp_payload_valid (void *sdp_ptr, u16 level, u8 cap_num, u16 *inst_num, u16 payload_type) { u16 i; @@ -4630,29 +4595,29 @@ tinybool sdp_attr_fmtp_payload_valid (void *sdp_ptr, u16 level, u8 cap_num, return (FALSE); } - if (sdp_attr_num_instances(sdp_ptr, level, cap_num, + if (sdp_attr_num_instances(sdp_ptr, level, cap_num, SDP_ATTR_FMTP, &num_instances) != SDP_SUCCESS) { return (FALSE); } for (i=1; i <= num_instances; i++) { attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, i); - if ((attr_p != NULL) && + if ((attr_p != NULL) && (attr_p->attr.fmtp.payload_num == payload_type)) { *inst_num = i; return (TRUE); } - } + } return (FALSE); } /* Function: sdp_attr_get_fmtp_payload_type * Description: Returns the value of the fmtp attribute payload type - * parameter specified for the given attribute. If the given + * parameter specified for the given attribute. If the given * attribute is not defined, zero is returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -4687,11 +4652,11 @@ u16 sdp_attr_get_fmtp_payload_type (void *sdp_ptr, u16 level, * The overall range for events is 0-255. * This will return either FULL_MATCH, PARTIAL_MATCH, or NO_MATCH * depending on whether all, some, or none of the specified - * events are defined. If the given attribute is not defined, + * events are defined. If the given attribute is not defined, * NO_MATCH will be returned. It is up to the appl to verify * the validity of the attribute before calling this routine. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -4699,7 +4664,7 @@ u16 sdp_attr_get_fmtp_payload_type (void *sdp_ptr, u16 level, * high_val High value of the range. * Returns: SDP_FULL_MATCH, SDP_PARTIAL_MATCH, SDP_NO_MATCH */ -sdp_ne_res_e sdp_attr_fmtp_is_range_set (void *sdp_ptr, u16 level, u8 cap_num, +sdp_ne_res_e sdp_attr_fmtp_is_range_set (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u8 low_val, u8 high_val) { u16 i; @@ -4751,10 +4716,10 @@ sdp_ne_res_e sdp_attr_fmtp_is_range_set (void *sdp_ptr, u16 level, u8 cap_num, * This routine will do a simple AND comparison and report the result. * * This will return TRUE if ftmp events are valid, and FALSE otherwise. - * It is up to the appl to verify the validity of the attribute + * It is up to the appl to verify the validity of the attribute * before calling this routine. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -4792,7 +4757,7 @@ sdp_attr_fmtp_valid(void *sdp_ptr, u16 level, u8 cap_num, if (fmtp_p->maxval > appl_maxval) return FALSE; - /* Ok, events are within range. Now check that only + /* Ok, events are within range. Now check that only * allowed events have been received */ mapword = appl_maxval/SDP_NE_BITS_PER_WORD; @@ -4801,7 +4766,7 @@ sdp_attr_fmtp_valid(void *sdp_ptr, u16 level, u8 cap_num, /* Remote SDP is requesting events not supported by Application */ return FALSE; } - } + } return TRUE; } @@ -4809,7 +4774,7 @@ sdp_attr_fmtp_valid(void *sdp_ptr, u16 level, u8 cap_num, * Description: Sets the value of the fmtp attribute payload type parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -4817,8 +4782,8 @@ sdp_attr_fmtp_valid(void *sdp_ptr, u16 level, u8 cap_num, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_fmtp_payload_type (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_payload_type (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 payload_num) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -4845,14 +4810,14 @@ sdp_result_e sdp_attr_set_fmtp_payload_type (void *sdp_ptr, u16 level, /* Function: sdp_attr_set_fmtp_bitmap * Description: Set a range of named events for an fmtp attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. * bmap The 8 word data array holding the bitmap - * Returns: SDP_SUCCESS + * Returns: SDP_SUCCESS */ -sdp_result_e sdp_attr_set_fmtp_bitmap(void *sdp_ptr, u16 level, +sdp_result_e sdp_attr_set_fmtp_bitmap(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u32 *bmap, u32 maxval) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -4883,14 +4848,14 @@ sdp_result_e sdp_attr_set_fmtp_bitmap(void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_range * Description: Get a range of named events for an fmtp attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. * bmap The 8 word data array holding the bitmap - * Returns: SDP_SUCCESS + * Returns: SDP_SUCCESS */ -sdp_result_e sdp_attr_get_fmtp_range (void *sdp_ptr, u16 level, u8 cap_num, +sdp_result_e sdp_attr_get_fmtp_range (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u32 *bmap) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -4921,15 +4886,15 @@ sdp_result_e sdp_attr_get_fmtp_range (void *sdp_ptr, u16 level, u8 cap_num, * Description: Set a range of named events for an fmtp attribute. The low * value specified must be <= the high value. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. * low_val The low value of the range. Range is 0-255. * high_val The high value of the range. May be == low. - * Returns: SDP_SUCCESS + * Returns: SDP_SUCCESS */ -sdp_result_e sdp_attr_set_fmtp_range (void *sdp_ptr, u16 level, u8 cap_num, +sdp_result_e sdp_attr_set_fmtp_range (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u8 low_val, u8 high_val) { u16 i; @@ -4970,15 +4935,15 @@ sdp_result_e sdp_attr_set_fmtp_range (void *sdp_ptr, u16 level, u8 cap_num, * Description: Clear a range of named events for an fmtp attribute. The low * value specified must be <= the high value. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. * low_val The low value of the range. Range is 0-255 * high_val The high value of the range. May be == low. - * Returns: SDP_SUCCESS + * Returns: SDP_SUCCESS */ -sdp_result_e sdp_attr_clear_fmtp_range (void *sdp_ptr, u16 level, u8 cap_num, +sdp_result_e sdp_attr_clear_fmtp_range (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u8 low_val, u8 high_val) { u16 i; @@ -5031,7 +4996,7 @@ sdp_result_e sdp_attr_clear_fmtp_range (void *sdp_ptr, u16 level, u8 cap_num, * Returns: SDP_FULL_MATCH, SDP_PARTIAL_MATCH, SDP_NO_MATCH. */ sdp_ne_res_e sdp_attr_compare_fmtp_ranges (void *src_sdp_ptr,void *dst_sdp_ptr, - u16 src_level, u16 dst_level, + u16 src_level, u16 dst_level, u8 src_cap_num, u8 dst_cap_num, u16 src_inst_num, u16 dst_inst_num) { @@ -5050,9 +5015,9 @@ sdp_ne_res_e sdp_attr_compare_fmtp_ranges (void *src_sdp_ptr,void *dst_sdp_ptr, return (SDP_NO_MATCH); } - src_attr_p = sdp_find_attr(src_sdp_p, src_level, src_cap_num, + src_attr_p = sdp_find_attr(src_sdp_p, src_level, src_cap_num, SDP_ATTR_FMTP, src_inst_num); - dst_attr_p = sdp_find_attr(dst_sdp_p, dst_level, dst_cap_num, + dst_attr_p = sdp_find_attr(dst_sdp_p, dst_level, dst_cap_num, SDP_ATTR_FMTP, dst_inst_num); if ((src_attr_p == NULL) || (dst_attr_p == NULL)) { if (src_sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -5087,7 +5052,7 @@ sdp_ne_res_e sdp_attr_compare_fmtp_ranges (void *src_sdp_ptr,void *dst_sdp_ptr, } /* Function: sdp_attr_copy_fmtp_ranges - * Description: Copy the named events set for one fmtp attribute to another. + * Description: Copy the named events set for one fmtp attribute to another. * Parameters: src_sdp_ptr The SDP handle returned by sdp_init_description. * dst_sdp_ptr The SDP handle returned by sdp_init_description. * src_level The level of the src fmtp attribute. @@ -5096,10 +5061,10 @@ sdp_ne_res_e sdp_attr_compare_fmtp_ranges (void *src_sdp_ptr,void *dst_sdp_ptr, * dst_cap_num The capability number of the dst attr. * src_inst_numh The attribute instance of the src attr. * dst_inst_numh The attribute instance of the dst attr. - * Returns: SDP_SUCCESS + * Returns: SDP_SUCCESS */ sdp_result_e sdp_attr_copy_fmtp_ranges (void *src_sdp_ptr, void *dst_sdp_ptr, - u16 src_level, u16 dst_level, + u16 src_level, u16 dst_level, u8 src_cap_num, u8 dst_cap_num, u16 src_inst_num, u16 dst_inst_num) { @@ -5116,9 +5081,9 @@ sdp_result_e sdp_attr_copy_fmtp_ranges (void *src_sdp_ptr, void *dst_sdp_ptr, return (SDP_INVALID_SDP_PTR); } - src_attr_p = sdp_find_attr(src_sdp_p, src_level, src_cap_num, + src_attr_p = sdp_find_attr(src_sdp_p, src_level, src_cap_num, SDP_ATTR_FMTP, src_inst_num); - dst_attr_p = sdp_find_attr(dst_sdp_p, dst_level, dst_cap_num, + dst_attr_p = sdp_find_attr(dst_sdp_p, dst_level, dst_cap_num, SDP_ATTR_FMTP, dst_inst_num); if ((src_attr_p == NULL) || (dst_attr_p == NULL)) { if (src_sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -5142,7 +5107,7 @@ sdp_result_e sdp_attr_copy_fmtp_ranges (void *src_sdp_ptr, void *dst_sdp_ptr, * Description: Sets the value of the fmtp attribute annexa type parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -5150,8 +5115,8 @@ sdp_result_e sdp_attr_copy_fmtp_ranges (void *src_sdp_ptr, void *dst_sdp_ptr, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_fmtp_annexa (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_annexa (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, tinybool annexa) { @@ -5177,7 +5142,7 @@ sdp_result_e sdp_attr_set_fmtp_annexa (void *sdp_ptr, u16 level, fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->annexa_required = TRUE; fmtp_p->annexa = annexa; - + return (SDP_SUCCESS); } @@ -5185,7 +5150,7 @@ sdp_result_e sdp_attr_set_fmtp_annexa (void *sdp_ptr, u16 level, * Description: Sets the value of the fmtp attribute annexb type parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -5193,8 +5158,8 @@ sdp_result_e sdp_attr_set_fmtp_annexa (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_fmtp_annexb (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_annexb (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, tinybool annexb) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -5204,7 +5169,7 @@ sdp_result_e sdp_attr_set_fmtp_annexb (void *sdp_ptr, u16 level, if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_PARAMETER); } - + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -5226,7 +5191,7 @@ sdp_result_e sdp_attr_set_fmtp_annexb (void *sdp_ptr, u16 level, * Description: Gets the value of the fmtp attribute mode parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * payload_type payload type. @@ -5250,7 +5215,7 @@ u32 sdp_attr_get_fmtp_mode_for_payload_type (void *sdp_ptr, u16 level, &num_a_lines); for (i = 0; i < num_a_lines; i++) { attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, (uint16_t) (i + 1)); - if ((attr_p != NULL) && + if ((attr_p != NULL) && (attr_p->attr.fmtp.payload_num == (u16)payload_type)) { if (attr_p->attr.fmtp.fmtp_format == SDP_FMTP_MODE) { return attr_p->attr.fmtp.mode; @@ -5304,7 +5269,7 @@ sdp_result_e sdp_attr_set_fmtp_mode (void *sdp_ptr, u16 level, * Description: Sets the value of the fmtp attribute bitrate type parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -5312,14 +5277,14 @@ sdp_result_e sdp_attr_set_fmtp_mode (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_fmtp_bitrate_type (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_bitrate_type (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u32 bitrate) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (bitrate <= 0) { return (SDP_INVALID_PARAMETER); } @@ -5348,7 +5313,7 @@ sdp_result_e sdp_attr_set_fmtp_bitrate_type (void *sdp_ptr, u16 level, * Description: Sets the value of the fmtp attribute cif parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -5356,14 +5321,14 @@ sdp_result_e sdp_attr_set_fmtp_bitrate_type (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_fmtp_cif (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_cif (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 cif) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if ((cif < SDP_MIN_CIF_VALUE) || ( cif > SDP_MAX_CIF_VALUE)) { return (SDP_INVALID_PARAMETER); } @@ -5392,7 +5357,7 @@ sdp_result_e sdp_attr_set_fmtp_cif (void *sdp_ptr, u16 level, * Description: Sets the value of the fmtp attribute qcif parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -5400,14 +5365,14 @@ sdp_result_e sdp_attr_set_fmtp_cif (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_fmtp_qcif (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_qcif (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 qcif) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if ((qcif < SDP_MIN_CIF_VALUE) || ( qcif > SDP_MAX_CIF_VALUE)) { return (SDP_INVALID_PARAMETER); } @@ -5435,22 +5400,22 @@ sdp_result_e sdp_attr_set_fmtp_qcif (void *sdp_ptr, u16 level, * Description: Sets the value of the fmtp attribute sqcif parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the - * attribute if any. If none, should be zero. + * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. * sqcif Sets the SQCIF value for a video codec * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_fmtp_sqcif (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_sqcif (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 sqcif) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if ((sqcif < SDP_MIN_CIF_VALUE) || (sqcif > SDP_MAX_CIF_VALUE)) { return (SDP_INVALID_PARAMETER); } @@ -5480,22 +5445,22 @@ sdp_result_e sdp_attr_set_fmtp_sqcif (void *sdp_ptr, u16 level, * Description: Sets the value of the fmtp attribute cif4 parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the - * attribute if any. If none, should be zero. + * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. * sqcif Sets the cif4 value for a video codec * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_fmtp_cif4 (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_cif4 (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 cif4) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if ((cif4 < SDP_MIN_CIF_VALUE) || (cif4 > SDP_MAX_CIF_VALUE)) { return (SDP_INVALID_PARAMETER); } @@ -5524,22 +5489,22 @@ sdp_result_e sdp_attr_set_fmtp_cif4 (void *sdp_ptr, u16 level, * Description: Sets the value of the fmtp attribute cif16 parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the - * attribute if any. If none, should be zero. + * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. * cif16 Sets the cif16 value for a video codec * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_fmtp_cif16 (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_cif16 (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 cif16) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if ((cif16 < SDP_MIN_CIF_VALUE) || (cif16 > SDP_MAX_CIF_VALUE)) { return (SDP_INVALID_PARAMETER); } @@ -5569,7 +5534,7 @@ sdp_result_e sdp_attr_set_fmtp_cif16 (void *sdp_ptr, u16 level, * Description: Sets the value of the fmtp attribute maxbr parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -5578,14 +5543,14 @@ sdp_result_e sdp_attr_set_fmtp_cif16 (void *sdp_ptr, u16 level, * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_fmtp_maxbr (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_maxbr (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 maxbr) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (maxbr <= 0) { return (SDP_INVALID_PARAMETER); } @@ -5614,7 +5579,7 @@ sdp_result_e sdp_attr_set_fmtp_maxbr (void *sdp_ptr, u16 level, * Description: Sets the value of the fmtp attribute custom parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -5623,14 +5588,14 @@ sdp_result_e sdp_attr_set_fmtp_maxbr (void *sdp_ptr, u16 level, * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_fmtp_custom (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_custom (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 custom_x, u16 custom_y, u16 custom_mpi) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if ((custom_x <= 0) || (custom_y <= 0) || (custom_mpi <= 0)) { return (SDP_INVALID_PARAMETER); } @@ -5661,7 +5626,7 @@ sdp_result_e sdp_attr_set_fmtp_custom (void *sdp_ptr, u16 level, * Description: Sets the value of the fmtp attribute PAR parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -5670,14 +5635,14 @@ sdp_result_e sdp_attr_set_fmtp_custom (void *sdp_ptr, u16 level, * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_fmtp_par (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_par (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 par_width, u16 par_height) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if ((par_width <= 0) || (par_height <= 0)) { return (SDP_INVALID_PARAMETER); } @@ -5707,7 +5672,7 @@ sdp_result_e sdp_attr_set_fmtp_par (void *sdp_ptr, u16 level, * Description: Sets the value of the fmtp attribute CPCF parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -5716,14 +5681,14 @@ sdp_result_e sdp_attr_set_fmtp_par (void *sdp_ptr, u16 level, * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_fmtp_cpcf (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_cpcf (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 cpcf) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (cpcf <= 0) { return (SDP_INVALID_PARAMETER); } @@ -5752,7 +5717,7 @@ sdp_result_e sdp_attr_set_fmtp_cpcf (void *sdp_ptr, u16 level, * Description: Sets the value of the fmtp attribute BPP parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -5761,14 +5726,14 @@ sdp_result_e sdp_attr_set_fmtp_cpcf (void *sdp_ptr, u16 level, * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_fmtp_bpp (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_bpp (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 bpp) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (bpp <= 0) { return (SDP_INVALID_PARAMETER); } @@ -5797,7 +5762,7 @@ sdp_result_e sdp_attr_set_fmtp_bpp (void *sdp_ptr, u16 level, * Description: Sets the value of the fmtp attribute HRD parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -5806,13 +5771,13 @@ sdp_result_e sdp_attr_set_fmtp_bpp (void *sdp_ptr, u16 level, * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_fmtp_hrd (void *sdp_ptr, u16 level, +sdp_result_e sdp_attr_set_fmtp_hrd (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 hrd) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (hrd <= 0) { return (SDP_INVALID_PARAMETER); } @@ -5837,8 +5802,8 @@ sdp_result_e sdp_attr_set_fmtp_hrd (void *sdp_ptr, u16 level, return (SDP_SUCCESS); } -sdp_result_e sdp_attr_set_fmtp_h263_num_params (void *sdp_ptr, int16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_h263_num_params (void *sdp_ptr, int16 level, + u8 cap_num, u16 inst_num, int16 profile, u16 h263_level, tinybool interlace) @@ -5846,7 +5811,7 @@ sdp_result_e sdp_attr_set_fmtp_h263_num_params (void *sdp_ptr, int16 level, sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_PARAMETER); @@ -5865,13 +5830,13 @@ sdp_result_e sdp_attr_set_fmtp_h263_num_params (void *sdp_ptr, int16 level, fmtp_p = &(attr_p->attr.fmtp); fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - if ((profile >= SDP_MIN_PROFILE_LEVEL_VALUE) && + if ((profile >= SDP_MIN_PROFILE_LEVEL_VALUE) && (profile <= SDP_MAX_PROFILE_VALUE)) { fmtp_p->profile = profile; } - if ((level >= SDP_MIN_PROFILE_LEVEL_VALUE) && - (level <= SDP_MAX_LEVEL_VALUE)) { + if ((level >= SDP_MIN_PROFILE_LEVEL_VALUE) && + (level <= SDP_MAX_LEVEL_VALUE)) { fmtp_p->level = h263_level; } @@ -5884,14 +5849,14 @@ sdp_result_e sdp_attr_set_fmtp_h263_num_params (void *sdp_ptr, int16 level, return (SDP_SUCCESS); } -sdp_result_e sdp_attr_set_fmtp_profile_level_id (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_profile_level_id (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, const char *profile_level_id) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_PARAMETER); } @@ -5908,22 +5873,22 @@ sdp_result_e sdp_attr_set_fmtp_profile_level_id (void *sdp_ptr, u16 level, fmtp_p = &(attr_p->attr.fmtp); fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - if (profile_level_id) { - sstrncpy(fmtp_p->profile_level_id, profile_level_id, + if (profile_level_id) { + sstrncpy(fmtp_p->profile_level_id, profile_level_id, SDP_MAX_STRING_LEN+1); } - + return (SDP_SUCCESS); } -sdp_result_e sdp_attr_set_fmtp_parameter_sets (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_parameter_sets (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, const char *parameter_sets) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_PARAMETER); } @@ -5943,18 +5908,18 @@ sdp_result_e sdp_attr_set_fmtp_parameter_sets (void *sdp_ptr, u16 level, if (parameter_sets) { sstrncpy(fmtp_p->parameter_sets, parameter_sets, SDP_MAX_STRING_LEN+1); } - + return (SDP_SUCCESS); } -sdp_result_e sdp_attr_set_fmtp_pack_mode (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_pack_mode (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 pack_mode) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (pack_mode > SDP_MAX_PACKETIZATION_MODE_VALUE) { return (SDP_INVALID_PARAMETER); } @@ -5980,14 +5945,14 @@ sdp_result_e sdp_attr_set_fmtp_pack_mode (void *sdp_ptr, u16 level, return (SDP_SUCCESS); } -sdp_result_e sdp_attr_set_fmtp_level_asymmetry_allowed (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_level_asymmetry_allowed (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 asym_allowed) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_PARAMETER); } @@ -6009,14 +5974,14 @@ sdp_result_e sdp_attr_set_fmtp_level_asymmetry_allowed (void *sdp_ptr, u16 level return (SDP_SUCCESS); } -sdp_result_e sdp_attr_set_fmtp_deint_buf_req (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_deint_buf_req (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u32 deint_buf_req) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_PARAMETER); @@ -6040,14 +6005,14 @@ sdp_result_e sdp_attr_set_fmtp_deint_buf_req (void *sdp_ptr, u16 level, return (SDP_SUCCESS); } -sdp_result_e sdp_attr_set_fmtp_init_buf_time (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_init_buf_time (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u32 init_buf_time) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_PARAMETER); @@ -6071,14 +6036,14 @@ sdp_result_e sdp_attr_set_fmtp_init_buf_time (void *sdp_ptr, u16 level, return (SDP_SUCCESS); } -sdp_result_e sdp_attr_set_fmtp_max_don_diff (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_max_don_diff (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u32 max_don_diff) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_PARAMETER); @@ -6101,14 +6066,14 @@ sdp_result_e sdp_attr_set_fmtp_max_don_diff (void *sdp_ptr, u16 level, return (SDP_SUCCESS); } -sdp_result_e sdp_attr_set_fmtp_interleaving_depth (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_interleaving_depth (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u16 interleaving_depth) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_PARAMETER); @@ -6131,14 +6096,14 @@ sdp_result_e sdp_attr_set_fmtp_interleaving_depth (void *sdp_ptr, u16 level, return (SDP_SUCCESS); } -sdp_result_e sdp_attr_set_fmtp_redundant_pic_cap (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_redundant_pic_cap (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, tinybool redundant_pic_cap) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_PARAMETER); @@ -6165,14 +6130,14 @@ sdp_result_e sdp_attr_set_fmtp_redundant_pic_cap (void *sdp_ptr, u16 level, } } -sdp_result_e sdp_attr_set_fmtp_max_mbps (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_max_mbps (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u32 max_mbps) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_PARAMETER); } @@ -6198,14 +6163,14 @@ sdp_result_e sdp_attr_set_fmtp_max_mbps (void *sdp_ptr, u16 level, } } -sdp_result_e sdp_attr_set_fmtp_max_fs (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_max_fs (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u32 max_fs) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_PARAMETER); } @@ -6231,14 +6196,14 @@ sdp_result_e sdp_attr_set_fmtp_max_fs (void *sdp_ptr, u16 level, } } -sdp_result_e sdp_attr_set_fmtp_max_br (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_max_br (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u32 max_br) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_PARAMETER); } @@ -6789,14 +6754,14 @@ sdp_result_e sdp_attr_get_fmtp_data_channel_protocol (void *sdp_ptr, u16 level, return (SDP_SUCCESS); } -sdp_result_e sdp_attr_set_fmtp_max_cpb (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_max_cpb (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u32 max_cpb) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_PARAMETER); } @@ -6822,14 +6787,14 @@ sdp_result_e sdp_attr_set_fmtp_max_cpb (void *sdp_ptr, u16 level, } } -sdp_result_e sdp_attr_set_fmtp_max_dpb (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_max_dpb (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u32 max_dpb) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_PARAMETER); } @@ -6855,14 +6820,14 @@ sdp_result_e sdp_attr_set_fmtp_max_dpb (void *sdp_ptr, u16 level, } } -sdp_result_e sdp_attr_set_fmtp_max_rcmd_nalu_size (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_max_rcmd_nalu_size (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u32 max_rcmd_nalu_size) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_PARAMETER); @@ -6882,18 +6847,18 @@ sdp_result_e sdp_attr_set_fmtp_max_rcmd_nalu_size (void *sdp_ptr, u16 level, fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->max_rcmd_nalu_size = max_rcmd_nalu_size; fmtp_p->flag |= SDP_MAX_RCMD_NALU_SIZE_FLAG; - + return (SDP_SUCCESS); } -sdp_result_e sdp_attr_set_fmtp_deint_buf_cap (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_deint_buf_cap (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, u32 deint_buf_cap) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_PARAMETER); @@ -6913,12 +6878,12 @@ sdp_result_e sdp_attr_set_fmtp_deint_buf_cap (void *sdp_ptr, u16 level, fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->deint_buf_cap = deint_buf_cap; fmtp_p->flag |= SDP_DEINT_BUF_CAP_FLAG; - + return (SDP_SUCCESS); } -sdp_result_e sdp_attr_set_fmtp_h264_parameter_add (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, +sdp_result_e sdp_attr_set_fmtp_h264_parameter_add (void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num, tinybool parameter_add) { @@ -6943,17 +6908,17 @@ sdp_result_e sdp_attr_set_fmtp_h264_parameter_add (void *sdp_ptr, u16 level, fmtp_p = &(attr_p->attr.fmtp); fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->parameter_add = parameter_add; - + return (SDP_SUCCESS); } -sdp_result_e sdp_attr_set_fmtp_h261_annex_params (void *sdp_ptr, u16 level, +sdp_result_e sdp_attr_set_fmtp_h261_annex_params (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, tinybool annex_d) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_PARAMETER); @@ -6976,7 +6941,7 @@ sdp_result_e sdp_attr_set_fmtp_h261_annex_params (void *sdp_ptr, u16 level, return (SDP_SUCCESS); } -sdp_result_e sdp_attr_set_fmtp_h263_annex_params (void *sdp_ptr, u16 level, +sdp_result_e sdp_attr_set_fmtp_h263_annex_params (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, tinybool annex_f, tinybool annex_i, @@ -6984,14 +6949,14 @@ sdp_result_e sdp_attr_set_fmtp_h263_annex_params (void *sdp_ptr, u16 level, tinybool annex_t, u16 annex_k_val, u16 annex_n_val, - u16 annex_p_val_picture_resize, + u16 annex_p_val_picture_resize, u16 annex_p_val_warp) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; sdp_fmtp_t *fmtp_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_PARAMETER); @@ -7014,13 +6979,13 @@ sdp_result_e sdp_attr_set_fmtp_h263_annex_params (void *sdp_ptr, u16 level, fmtp_p->annex_i = annex_i; fmtp_p->annex_j = annex_j; fmtp_p->annex_t = annex_t; - + fmtp_p->annex_k_val = annex_k_val; fmtp_p->annex_n_val = annex_n_val; - + fmtp_p->annex_p_val_picture_resize = annex_p_val_picture_resize; fmtp_p->annex_p_val_warp = annex_p_val_warp; - + return (SDP_SUCCESS); } @@ -7030,18 +6995,18 @@ sdp_result_e sdp_attr_set_fmtp_h263_annex_params (void *sdp_ptr, u16 level, * Description: Gives the value of the fmtp attribute annexb type parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. - * + * * * Returns: TRUE or FALSE. */ -tinybool sdp_attr_fmtp_is_annexb_set (void *sdp_ptr, u16 level, u8 cap_num, +tinybool sdp_attr_fmtp_is_annexb_set (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) -{ - +{ + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; @@ -7049,7 +7014,7 @@ tinybool sdp_attr_fmtp_is_annexb_set (void *sdp_ptr, u16 level, u8 cap_num, return (FALSE); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7067,15 +7032,15 @@ tinybool sdp_attr_fmtp_is_annexb_set (void *sdp_ptr, u16 level, u8 cap_num, * Description: Gives the value of the fmtp attribute annexa type parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. - * + * * * Returns: TRUE or FALSE. */ -tinybool sdp_attr_fmtp_is_annexa_set (void *sdp_ptr, u16 level, u8 cap_num, +tinybool sdp_attr_fmtp_is_annexa_set (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -7085,7 +7050,7 @@ tinybool sdp_attr_fmtp_is_annexa_set (void *sdp_ptr, u16 level, u8 cap_num, return (FALSE); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7103,7 +7068,7 @@ tinybool sdp_attr_fmtp_is_annexa_set (void *sdp_ptr, u16 level, u8 cap_num, * Description: Gets the value of the fmtp attribute bitrate type parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7120,7 +7085,7 @@ int32 sdp_attr_get_fmtp_bitrate_type (void *sdp_ptr, u16 level, return (SDP_INVALID_VALUE); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7138,7 +7103,7 @@ int32 sdp_attr_get_fmtp_bitrate_type (void *sdp_ptr, u16 level, * Description: Gets the value of the fmtp attribute QCIF type parameter * for a given Video codec. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7147,15 +7112,15 @@ int32 sdp_attr_get_fmtp_bitrate_type (void *sdp_ptr, u16 level, int32 sdp_attr_get_fmtp_qcif (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7172,7 +7137,7 @@ int32 sdp_attr_get_fmtp_qcif (void *sdp_ptr, u16 level, * Description: Gets the value of the fmtp attribute CIF type parameter * for a given Video codec. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7181,15 +7146,15 @@ int32 sdp_attr_get_fmtp_qcif (void *sdp_ptr, u16 level, int32 sdp_attr_get_fmtp_cif (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7208,7 +7173,7 @@ int32 sdp_attr_get_fmtp_cif (void *sdp_ptr, u16 level, * Description: Gets the value of the fmtp attribute sqcif type parameter * for a given Video codec. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7217,15 +7182,15 @@ int32 sdp_attr_get_fmtp_cif (void *sdp_ptr, u16 level, int32 sdp_attr_get_fmtp_sqcif (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7243,7 +7208,7 @@ int32 sdp_attr_get_fmtp_sqcif (void *sdp_ptr, u16 level, * Description: Gets the value of the fmtp attribute CIF4 type parameter * for a given Video codec. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7252,15 +7217,15 @@ int32 sdp_attr_get_fmtp_sqcif (void *sdp_ptr, u16 level, int32 sdp_attr_get_fmtp_cif4 (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7278,7 +7243,7 @@ int32 sdp_attr_get_fmtp_cif4 (void *sdp_ptr, u16 level, * Description: Gets the value of the fmtp attribute CIF16 type parameter * for a given Video codec. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7288,15 +7253,15 @@ int32 sdp_attr_get_fmtp_cif4 (void *sdp_ptr, u16 level, int32 sdp_attr_get_fmtp_cif16 (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7315,7 +7280,7 @@ int32 sdp_attr_get_fmtp_cif16 (void *sdp_ptr, u16 level, * Description: Gets the value of the fmtp attribute MAXBR type parameter * for a given Video codec. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7324,15 +7289,15 @@ int32 sdp_attr_get_fmtp_cif16 (void *sdp_ptr, u16 level, int32 sdp_attr_get_fmtp_maxbr (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7350,7 +7315,7 @@ int32 sdp_attr_get_fmtp_maxbr (void *sdp_ptr, u16 level, * Description: Gets the value of the fmtp attribute CUSTOM type parameter * for a given Video codec. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7360,15 +7325,15 @@ int32 sdp_attr_get_fmtp_maxbr (void *sdp_ptr, u16 level, int32 sdp_attr_get_fmtp_custom_x (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7385,7 +7350,7 @@ int32 sdp_attr_get_fmtp_custom_x (void *sdp_ptr, u16 level, * Description: Gets the value of the fmtp attribute custom_y type parameter * for a given Video codec. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7395,15 +7360,15 @@ int32 sdp_attr_get_fmtp_custom_x (void *sdp_ptr, u16 level, int32 sdp_attr_get_fmtp_custom_y (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7421,7 +7386,7 @@ int32 sdp_attr_get_fmtp_custom_y (void *sdp_ptr, u16 level, * Description: Gets the value of the fmtp attribute CUSTOM type parameter * for a given Video codec. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7431,15 +7396,15 @@ int32 sdp_attr_get_fmtp_custom_y (void *sdp_ptr, u16 level, int32 sdp_attr_get_fmtp_custom_mpi (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7456,7 +7421,7 @@ int32 sdp_attr_get_fmtp_custom_mpi (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_par_width * Description: Gets the value of the fmtp attribute PAR (width) parameter * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7465,15 +7430,15 @@ int32 sdp_attr_get_fmtp_custom_mpi (void *sdp_ptr, u16 level, int32 sdp_attr_get_fmtp_par_width (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7490,7 +7455,7 @@ int32 sdp_attr_get_fmtp_par_width (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_par_height * Description: Gets the value of the fmtp attribute PAR (height) parameter * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7499,15 +7464,15 @@ int32 sdp_attr_get_fmtp_par_width (void *sdp_ptr, u16 level, int32 sdp_attr_get_fmtp_par_height (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7524,7 +7489,7 @@ int32 sdp_attr_get_fmtp_par_height (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_cpcf * Description: Gets the value of the fmtp attribute- CPCF parameter * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7533,15 +7498,15 @@ int32 sdp_attr_get_fmtp_par_height (void *sdp_ptr, u16 level, int32 sdp_attr_get_fmtp_cpcf (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7558,7 +7523,7 @@ int32 sdp_attr_get_fmtp_cpcf (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_bpp * Description: Gets the value of the fmtp attribute- BPP parameter * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7567,15 +7532,15 @@ int32 sdp_attr_get_fmtp_cpcf (void *sdp_ptr, u16 level, int32 sdp_attr_get_fmtp_bpp (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7592,7 +7557,7 @@ int32 sdp_attr_get_fmtp_bpp (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_hrd * Description: Gets the value of the fmtp attribute- HRD parameter * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7601,15 +7566,15 @@ int32 sdp_attr_get_fmtp_bpp (void *sdp_ptr, u16 level, int32 sdp_attr_get_fmtp_hrd (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7626,7 +7591,7 @@ int32 sdp_attr_get_fmtp_hrd (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_profile * Description: Gets the value of the fmtp attribute- PROFILE parameter * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7635,15 +7600,15 @@ int32 sdp_attr_get_fmtp_hrd (void *sdp_ptr, u16 level, int32 sdp_attr_get_fmtp_profile (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7660,7 +7625,7 @@ int32 sdp_attr_get_fmtp_profile (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_level * Description: Gets the value of the fmtp attribute- LEVEL parameter * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7669,15 +7634,15 @@ int32 sdp_attr_get_fmtp_profile (void *sdp_ptr, u16 level, int32 sdp_attr_get_fmtp_level (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7694,7 +7659,7 @@ int32 sdp_attr_get_fmtp_level (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_interlace * Description: Checks if INTERLACE parameter is set. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7703,15 +7668,15 @@ int32 sdp_attr_get_fmtp_level (void *sdp_ptr, u16 level, tinybool sdp_attr_get_fmtp_interlace (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return FALSE; } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7728,7 +7693,7 @@ tinybool sdp_attr_get_fmtp_interlace (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_pack_mode * Description: Gets the value of the fmtp attribute- packetization-mode parameter for H.264 codec * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7738,15 +7703,15 @@ tinybool sdp_attr_get_fmtp_interlace (void *sdp_ptr, u16 level, sdp_result_e sdp_attr_get_fmtp_pack_mode (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 *val) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7764,7 +7729,7 @@ sdp_result_e sdp_attr_get_fmtp_pack_mode (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_level_asymmetry_allowed * Description: Gets the value of the fmtp attribute- level-asymmetry-allowed parameter for H.264 codec * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7774,15 +7739,15 @@ sdp_result_e sdp_attr_get_fmtp_pack_mode (void *sdp_ptr, u16 level, sdp_result_e sdp_attr_get_fmtp_level_asymmetry_allowed (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 *val) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7800,7 +7765,7 @@ sdp_result_e sdp_attr_get_fmtp_level_asymmetry_allowed (void *sdp_ptr, u16 level /* Function: sdp_attr_get_fmtp_profile_id * Description: Gets the value of the fmtp attribute- profile-level-id parameter for H.264 codec * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7809,15 +7774,15 @@ sdp_result_e sdp_attr_get_fmtp_level_asymmetry_allowed (void *sdp_ptr, u16 level const char* sdp_attr_get_fmtp_profile_id (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (0); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7834,7 +7799,7 @@ const char* sdp_attr_get_fmtp_profile_id (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_param_sets * Description: Gets the value of the fmtp attribute- parameter-sets parameter for H.264 codec * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7843,15 +7808,15 @@ const char* sdp_attr_get_fmtp_profile_id (void *sdp_ptr, u16 level, const char* sdp_attr_get_fmtp_param_sets (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (0); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7868,7 +7833,7 @@ const char* sdp_attr_get_fmtp_param_sets (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_interleaving_depth * Description: Gets the value of the fmtp attribute- interleaving_depth parameter for H.264 codec * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7880,12 +7845,12 @@ sdp_result_e sdp_attr_get_fmtp_interleaving_depth (void *sdp_ptr, u16 level, { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7903,7 +7868,7 @@ sdp_result_e sdp_attr_get_fmtp_interleaving_depth (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_deint_buf_req * Description: Gets the value of the fmtp attribute- deint-buf-req parameter for H.264 codec * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7916,12 +7881,12 @@ sdp_result_e sdp_attr_get_fmtp_deint_buf_req (void *sdp_ptr, u16 level, { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7943,7 +7908,7 @@ sdp_result_e sdp_attr_get_fmtp_deint_buf_req (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_max_don_diff * Description: Gets the value of the fmtp attribute- max-don-diff parameter for H.264 codec * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7955,12 +7920,12 @@ sdp_result_e sdp_attr_get_fmtp_max_don_diff (void *sdp_ptr, u16 level, { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -7978,7 +7943,7 @@ sdp_result_e sdp_attr_get_fmtp_max_don_diff (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_init_buf_time * Description: Gets the value of the fmtp attribute- init-buf-time parameter for H.264 codec * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -7990,12 +7955,12 @@ sdp_result_e sdp_attr_get_fmtp_init_buf_time (void *sdp_ptr, u16 level, { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8017,7 +7982,7 @@ sdp_result_e sdp_attr_get_fmtp_init_buf_time (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_max_mbps * Description: Gets the value of the fmtp attribute- max-mbps parameter for H.264 codec * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -8030,12 +7995,12 @@ sdp_result_e sdp_attr_get_fmtp_max_mbps (void *sdp_ptr, u16 level, { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8053,7 +8018,7 @@ sdp_result_e sdp_attr_get_fmtp_max_mbps (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_max_fs * Description: Gets the value of the fmtp attribute- max-fs parameter for H.264 codec * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -8065,12 +8030,12 @@ sdp_result_e sdp_attr_get_fmtp_max_fs (void *sdp_ptr, u16 level, { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8088,7 +8053,7 @@ sdp_result_e sdp_attr_get_fmtp_max_fs (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_max_cpb * Description: Gets the value of the fmtp attribute- max-cpb parameter for H.264 codec * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -8100,12 +8065,12 @@ sdp_result_e sdp_attr_get_fmtp_max_cpb (void *sdp_ptr, u16 level, { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8123,7 +8088,7 @@ sdp_result_e sdp_attr_get_fmtp_max_cpb (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_max_dpb * Description: Gets the value of the fmtp attribute- max-dpb parameter for H.264 codec * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -8135,12 +8100,12 @@ sdp_result_e sdp_attr_get_fmtp_max_dpb (void *sdp_ptr, u16 level, { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8159,7 +8124,7 @@ sdp_result_e sdp_attr_get_fmtp_max_dpb (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_max_br * Description: Gets the value of the fmtp attribute- max-br parameter for H.264 codec * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -8171,12 +8136,12 @@ sdp_result_e sdp_attr_get_fmtp_max_br (void *sdp_ptr, u16 level, { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8194,7 +8159,7 @@ sdp_result_e sdp_attr_get_fmtp_max_br (void *sdp_ptr, u16 level, /* Function: sdp_attr_fmtp_is_redundant_pic_cap * Description: Gets the value of the fmtp attribute- redundant_pic_cap parameter for H.264 codec * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -8203,15 +8168,15 @@ sdp_result_e sdp_attr_get_fmtp_max_br (void *sdp_ptr, u16 level, tinybool sdp_attr_fmtp_is_redundant_pic_cap (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (FALSE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8228,7 +8193,7 @@ tinybool sdp_attr_fmtp_is_redundant_pic_cap (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_deint_buf_cap * Description: Gets the value of the fmtp attribute- deint-buf-cap parameter for H.264 codec * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -8239,15 +8204,15 @@ sdp_result_e sdp_attr_get_fmtp_deint_buf_cap (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u32 *val) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8269,7 +8234,7 @@ sdp_result_e sdp_attr_get_fmtp_deint_buf_cap (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_fmtp_max_rcmd_nalu_size * Description: Gets the value of the fmtp attribute- max-rcmd-nalu-size parameter for H.264 codec * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -8279,15 +8244,15 @@ sdp_result_e sdp_attr_get_fmtp_max_rcmd_nalu_size (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u32 *val) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8309,7 +8274,7 @@ sdp_result_e sdp_attr_get_fmtp_max_rcmd_nalu_size (void *sdp_ptr, u16 level, /* Function: sdp_attr_fmtp_is_parameter_add * Description: Gets the value of the fmtp attribute- parameter-add for H.264 codec * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -8318,15 +8283,15 @@ sdp_result_e sdp_attr_get_fmtp_max_rcmd_nalu_size (void *sdp_ptr, u16 level, tinybool sdp_attr_fmtp_is_parameter_add (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (FALSE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8340,31 +8305,31 @@ tinybool sdp_attr_fmtp_is_parameter_add (void *sdp_ptr, u16 level, } } -/****** Following functions are get routines for Annex values +/****** Following functions are get routines for Annex values * For each Annex support, the get routine will return the boolean TRUE/FALSE - * Some Annexures for Video codecs have values defined . In those cases, + * Some Annexures for Video codecs have values defined . In those cases, * (e.g Annex K, P ) , the return values are not boolean. - * + * * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. - * Returns: Annex value + * Returns: Annex value */ tinybool sdp_attr_get_fmtp_annex_d (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (FALSE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8381,15 +8346,15 @@ tinybool sdp_attr_get_fmtp_annex_d (void *sdp_ptr, u16 level, tinybool sdp_attr_get_fmtp_annex_f (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (FALSE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8406,15 +8371,15 @@ tinybool sdp_attr_get_fmtp_annex_f (void *sdp_ptr, u16 level, tinybool sdp_attr_get_fmtp_annex_i (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (FALSE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8431,15 +8396,15 @@ tinybool sdp_attr_get_fmtp_annex_i (void *sdp_ptr, u16 level, tinybool sdp_attr_get_fmtp_annex_j (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (FALSE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8456,15 +8421,15 @@ tinybool sdp_attr_get_fmtp_annex_j (void *sdp_ptr, u16 level, tinybool sdp_attr_get_fmtp_annex_t (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (FALSE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8481,15 +8446,15 @@ tinybool sdp_attr_get_fmtp_annex_t (void *sdp_ptr, u16 level, int32 sdp_attr_get_fmtp_annex_k_val (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8506,15 +8471,15 @@ int32 sdp_attr_get_fmtp_annex_k_val (void *sdp_ptr, u16 level, int32 sdp_attr_get_fmtp_annex_n_val (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8532,15 +8497,15 @@ int32 sdp_attr_get_fmtp_annex_p_picture_resize (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8549,7 +8514,7 @@ int32 sdp_attr_get_fmtp_annex_p_picture_resize (void *sdp_ptr, u16 level, } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); - } else { + } else { return (attr_p->attr.fmtp.annex_p_val_picture_resize); } } @@ -8557,15 +8522,15 @@ int32 sdp_attr_get_fmtp_annex_p_picture_resize (void *sdp_ptr, u16 level, int32 sdp_attr_get_fmtp_annex_p_warp (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8584,16 +8549,16 @@ int32 sdp_attr_get_fmtp_annex_p_warp (void *sdp_ptr, u16 level, * type parameter * for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. - * + * * * Returns: Enum type sdp_fmtp_format_type_e */ -sdp_fmtp_format_type_e sdp_attr_fmtp_get_fmtp_format (void *sdp_ptr, - u16 level, u8 cap_num, +sdp_fmtp_format_type_e sdp_attr_fmtp_get_fmtp_format (void *sdp_ptr, + u16 level, u8 cap_num, u16 inst_num) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -8603,7 +8568,7 @@ sdp_fmtp_format_type_e sdp_attr_fmtp_get_fmtp_format (void *sdp_ptr, return (SDP_FMTP_UNKNOWN_TYPE); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8618,11 +8583,11 @@ sdp_fmtp_format_type_e sdp_attr_fmtp_get_fmtp_format (void *sdp_ptr, } /* Function: sdp_attr_get_pccodec_num_payload_types - * Description: Returns the number of payload types specified for the - * given X-pc-codec attribute. If the given attribute is not + * Description: Returns the number of payload types specified for the + * given X-pc-codec attribute. If the given attribute is not * defined, zero is returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -8638,7 +8603,7 @@ u16 sdp_attr_get_pccodec_num_payload_types (void *sdp_ptr, u16 level, return (0); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_X_PC_CODEC, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_X_PC_CODEC, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8653,19 +8618,19 @@ u16 sdp_attr_get_pccodec_num_payload_types (void *sdp_ptr, u16 level, } /* Function: sdp_attr_get_pccodec_payload_type - * Description: Returns the value of the specified payload type for the - * given X-pc-codec attribute. If the given attribute is not + * Description: Returns the value of the specified payload type for the + * given X-pc-codec attribute. If the given attribute is not * defined, zero is returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. - * payload_num The payload number to get. Range is (1 - + * payload_num The payload number to get. Range is (1 - * max num payloads). * Returns: Payload type. */ -u16 sdp_attr_get_pccodec_payload_type (void *sdp_ptr, u16 level, u8 cap_num, +u16 sdp_attr_get_pccodec_payload_type (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 payload_num) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -8675,7 +8640,7 @@ u16 sdp_attr_get_pccodec_payload_type (void *sdp_ptr, u16 level, u8 cap_num, return (0); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_X_PC_CODEC, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_X_PC_CODEC, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8685,11 +8650,11 @@ u16 sdp_attr_get_pccodec_payload_type (void *sdp_ptr, u16 level, u8 cap_num, sdp_p->conf_p->num_invalid_param++; return (0); } else { - if ((payload_num < 1) || + if ((payload_num < 1) || (payload_num > attr_p->attr.pccodec.num_payloads)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s X-pc-codec attribute, level %u instance %u, " - "invalid payload number %u requested.", + "invalid payload number %u requested.", sdp_p->debug_str, level, inst_num, payload_num); } sdp_p->conf_p->num_invalid_param++; @@ -8706,7 +8671,7 @@ u16 sdp_attr_get_pccodec_payload_type (void *sdp_ptr, u16 level, u8 cap_num, * added to the end of the list so these values should be added * in the order they will be displayed within the attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -8714,7 +8679,7 @@ u16 sdp_attr_get_pccodec_payload_type (void *sdp_ptr, u16 level, u8 cap_num, * Returns: SDP_SUCCESS Payload type was added successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_add_pccodec_payload_type (void *sdp_ptr, u16 level, +sdp_result_e sdp_attr_add_pccodec_payload_type (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 payload_type) { @@ -8726,7 +8691,7 @@ sdp_result_e sdp_attr_add_pccodec_payload_type (void *sdp_ptr, u16 level, return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_X_PC_CODEC, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_X_PC_CODEC, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8744,11 +8709,11 @@ sdp_result_e sdp_attr_add_pccodec_payload_type (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_xcap_first_cap_num * Description: Gets the first capability number valid for the specified - * X-cap attribute instance. If the capability is not + * X-cap attribute instance. If the capability is not * defined, zero is returned. * Note: cap_num is not specified. It must be zero. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the capability. + * level The level to check for the capability. * inst_num The X-cap instance number to check. * Returns: Capability number or zero. */ @@ -8804,12 +8769,12 @@ u16 sdp_attr_get_xcap_first_cap_num (void *sdp_ptr, u16 level, u16 inst_num) } /* Function: sdp_attr_get_xcap_media_type - * Description: Returns the media type specified for the given X-cap + * Description: Returns the media type specified for the given X-cap * attribute. If the given attribute is not defined, * SDP_MEDIA_INVALID is returned. * Note: cap_num is not specified. It must be zero. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * inst_num The attribute instance number to check. * Returns: Media type or SDP_MEDIA_INVALID. */ @@ -8839,12 +8804,12 @@ sdp_media_e sdp_attr_get_xcap_media_type (void *sdp_ptr, u16 level, } /* Function: sdp_attr_get_xcap_transport_type - * Description: Returns the transport type specified for the given X-cap + * Description: Returns the transport type specified for the given X-cap * attribute. If the given attribute is not defined, * SDP_TRANSPORT_INVALID is returned. * Note: cap_num is not specified. It must be zero. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * inst_num The attribute instance number to check. * Returns: Media type or SDP_TRANSPORT_INVALID. */ @@ -8859,7 +8824,7 @@ sdp_transport_e sdp_attr_get_xcap_transport_type (void *sdp_ptr, u16 level, return (SDP_TRANSPORT_INVALID); } - attr_p = sdp_find_attr(sdp_p, level, 0, SDP_ATTR_X_CAP, + attr_p = sdp_find_attr(sdp_p, level, 0, SDP_ATTR_X_CAP, inst_num); if ((attr_p == NULL) || (attr_p->attr.cap_p == NULL)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -8875,13 +8840,13 @@ sdp_transport_e sdp_attr_get_xcap_transport_type (void *sdp_ptr, u16 level, } /* Function: sdp_attr_get_xcap_num_payload_types - * Description: Returns the number of payload types associated with the - * specified X-cap attribute. If the attribute is invalid, - * zero will be returned. Application must validate the + * Description: Returns the number of payload types associated with the + * specified X-cap attribute. If the attribute is invalid, + * zero will be returned. Application must validate the * attribute line before using this routine. * Note: cap_num is not specified. It must be zero. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -8913,15 +8878,15 @@ u16 sdp_attr_get_xcap_num_payload_types (void *sdp_ptr, u16 level, } /* Function: sdp_attr_get_xcap_payload_type - * Description: Returns the payload type of the specified payload for the - * X-cap attribute line. If the attr line or payload number is - * invalid, zero will be returned. Application must validate + * Description: Returns the payload type of the specified payload for the + * X-cap attribute line. If the attr line or payload number is + * invalid, zero will be returned. Application must validate * the X-cap attr before using this routine. * Note: cap_num is not specified. It must be zero. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * inst_num The attribute instance number to check. - * payload_num The payload number to retrieve. Range is + * payload_num The payload number to retrieve. Range is * (1 - max num payloads). * Returns: Payload type or zero. */ @@ -8969,12 +8934,12 @@ u16 sdp_attr_get_xcap_payload_type (void *sdp_ptr, u16 level, * attribute line. * Note: cap_num is not specified. It must be zero. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * inst_num The attribute instance number to check. * media Media type for the X-cap attribute. * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER */ -sdp_result_e sdp_attr_set_xcap_media_type (void *sdp_ptr, u16 level, +sdp_result_e sdp_attr_set_xcap_media_type (void *sdp_ptr, u16 level, u16 inst_num, sdp_media_e media) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -9005,13 +8970,13 @@ sdp_result_e sdp_attr_set_xcap_media_type (void *sdp_ptr, u16 level, * attribute line. * Note: cap_num is not specified. It must be zero. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * inst_num The attribute instance number to check. * transport Transport type for the X-cap attribute. * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER */ -sdp_result_e sdp_attr_set_xcap_transport_type(void *sdp_ptr, u16 level, - u16 inst_num, +sdp_result_e sdp_attr_set_xcap_transport_type(void *sdp_ptr, u16 level, + u16 inst_num, sdp_transport_e transport) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -9038,12 +9003,12 @@ sdp_result_e sdp_attr_set_xcap_transport_type(void *sdp_ptr, u16 level, } /* Function: sdp_attr_add_xcap_payload_type - * Description: Add a new payload type for the X-cap attribute line + * Description: Add a new payload type for the X-cap attribute line * specified. The new payload type will be added at the end * of the payload type list. * Note: cap_num is not specified. It must be zero. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * inst_num The attribute instance number to check. * payload_type The new payload type. * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER @@ -9078,11 +9043,11 @@ sdp_result_e sdp_attr_add_xcap_payload_type(void *sdp_ptr, u16 level, /* Function: sdp_attr_get_cdsc_first_cap_num * Description: Gets the first capability number valid for the specified - * CDSC attribute instance. If the capability is not + * CDSC attribute instance. If the capability is not * defined, zero is returned. * Note: cap_num is not specified. It must be zero. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the capability. + * level The level to check for the capability. * inst_num The CDSC instance number to check. * Returns: Capability number or zero. */ @@ -9143,7 +9108,7 @@ u16 sdp_attr_get_cdsc_first_cap_num(void *sdp_ptr, u16 level, u16 inst_num) * SDP_MEDIA_INVALID is returned. * Note: cap_num is not specified. It must be zero. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * inst_num The attribute instance number to check. * Returns: Media type or SDP_MEDIA_INVALID. */ @@ -9173,12 +9138,12 @@ sdp_media_e sdp_attr_get_cdsc_media_type(void *sdp_ptr, u16 level, } /* Function: sdp_attr_get_cdsc_transport_type - * Description: Returns the transport type specified for the given CDSC + * Description: Returns the transport type specified for the given CDSC * attribute. If the given attribute is not defined, * SDP_TRANSPORT_INVALID is returned. * Note: cap_num is not specified. It must be zero. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * inst_num The attribute instance number to check. * Returns: Media type or SDP_TRANSPORT_INVALID. */ @@ -9193,7 +9158,7 @@ sdp_transport_e sdp_attr_get_cdsc_transport_type(void *sdp_ptr, u16 level, return (SDP_TRANSPORT_INVALID); } - attr_p = sdp_find_attr(sdp_p, level, 0, SDP_ATTR_CDSC, + attr_p = sdp_find_attr(sdp_p, level, 0, SDP_ATTR_CDSC, inst_num); if ((attr_p == NULL) || (attr_p->attr.cap_p == NULL)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -9209,13 +9174,13 @@ sdp_transport_e sdp_attr_get_cdsc_transport_type(void *sdp_ptr, u16 level, } /* Function: sdp_attr_get_cdsc_num_payload_types - * Description: Returns the number of payload types associated with the - * specified CDSC attribute. If the attribute is invalid, - * zero will be returned. Application must validate the + * Description: Returns the number of payload types associated with the + * specified CDSC attribute. If the attribute is invalid, + * zero will be returned. Application must validate the * attribute line before using this routine. * Note: cap_num is not specified. It must be zero. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -9247,15 +9212,15 @@ u16 sdp_attr_get_cdsc_num_payload_types (void *sdp_ptr, u16 level, } /* Function: sdp_attr_get_cdsc_payload_type - * Description: Returns the payload type of the specified payload for the - * CDSC attribute line. If the attr line or payload number is - * invalid, zero will be returned. Application must validate + * Description: Returns the payload type of the specified payload for the + * CDSC attribute line. If the attr line or payload number is + * invalid, zero will be returned. Application must validate * the CDSC attr before using this routine. * Note: cap_num is not specified. It must be zero. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * inst_num The attribute instance number to check. - * payload_num The payload number to retrieve. Range is + * payload_num The payload number to retrieve. Range is * (1 - max num payloads). * Returns: Payload type or zero. */ @@ -9302,12 +9267,12 @@ u16 sdp_attr_get_cdsc_payload_type (void *sdp_ptr, u16 level, * attribute line. * Note: cap_num is not specified. It must be zero. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * inst_num The attribute instance number to check. * media Media type for the CDSC attribute. * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER */ -sdp_result_e sdp_attr_set_cdsc_media_type (void *sdp_ptr, u16 level, +sdp_result_e sdp_attr_set_cdsc_media_type (void *sdp_ptr, u16 level, u16 inst_num, sdp_media_e media) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -9338,12 +9303,12 @@ sdp_result_e sdp_attr_set_cdsc_media_type (void *sdp_ptr, u16 level, * attribute line. * Note: cap_num is not specified. It must be zero. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * inst_num The attribute instance number to check. * transport Transport type for the CDSC attribute. * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER */ -sdp_result_e sdp_attr_set_cdsc_transport_type (void *sdp_ptr, u16 level, +sdp_result_e sdp_attr_set_cdsc_transport_type (void *sdp_ptr, u16 level, u16 inst_num, sdp_transport_e transport) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -9370,12 +9335,12 @@ sdp_result_e sdp_attr_set_cdsc_transport_type (void *sdp_ptr, u16 level, } /* Function: sdp_attr_add_cdsc_payload_type - * Description: Add a new payload type for the CDSC attribute line + * Description: Add a new payload type for the CDSC attribute line * specified. The new payload type will be added at the end * of the payload type list. * Note: cap_num is not specified. It must be zero. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * inst_num The attribute instance number to check. * payload_type The new payload type. * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER @@ -9417,7 +9382,7 @@ sdp_result_e sdp_attr_add_cdsc_payload_type (void *sdp_ptr, u16 level, * Returns: TRUE or FALSE. Returns TRUE if payload type is defined on the * media line, else returns FALSE */ - + tinybool sdp_media_dynamic_payload_valid (void *sdp_ptr, u16 payload_type, u16 m_line) { @@ -9427,21 +9392,21 @@ tinybool sdp_media_dynamic_payload_valid (void *sdp_ptr, u16 payload_type, tinybool payload_matches = FALSE; tinybool result = TRUE; sdp_t *sdp_p = (sdp_t *)sdp_ptr; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (FALSE); } - - if ((payload_type < SDP_MIN_DYNAMIC_PAYLOAD) || + + if ((payload_type < SDP_MIN_DYNAMIC_PAYLOAD) || (payload_type > SDP_MAX_DYNAMIC_PAYLOAD)) { return FALSE; } - + num_payload_types = sdp_get_media_num_payload_types(sdp_p, m_line); - + for(p_type=1; p_type <=num_payload_types;p_type++){ - + m_ptype = (u16)sdp_get_media_payload_type(sdp_p, m_line, p_type, &ind); if (payload_type == m_ptype) { @@ -9450,13 +9415,13 @@ tinybool sdp_media_dynamic_payload_valid (void *sdp_ptr, u16 payload_type, } } - + if (!payload_matches) { return FALSE; } - + return (result); - + } /* Function: sdp_attr_set_rtr_confirm @@ -9464,7 +9429,7 @@ tinybool sdp_media_dynamic_payload_valid (void *sdp_ptr, u16 payload_type, * If this parameter is TRUE, the confirm parameter will be * specified when the SDP description is built. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * qos_attr The specific type of qos attribute. May be @@ -9474,7 +9439,7 @@ tinybool sdp_media_dynamic_payload_valid (void *sdp_ptr, u16 payload_type, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_rtr_confirm (void *sdp_ptr, u16 level, u8 cap_num, +sdp_result_e sdp_attr_set_rtr_confirm (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, tinybool confirm) { @@ -9505,7 +9470,7 @@ sdp_result_e sdp_attr_set_rtr_confirm (void *sdp_ptr, u16 level, u8 cap_num, * parameter specified for the given attribute. Returns TRUE if * the confirm parameter is specified. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -9525,7 +9490,7 @@ tinybool sdp_attr_get_rtr_confirm (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s %s attribute, level %u instance %u " - "not found.", sdp_p->debug_str, + "not found.", sdp_p->debug_str, sdp_get_attr_name(SDP_ATTR_RTR), level, inst_num); } sdp_p->conf_p->num_invalid_param++; @@ -9547,7 +9512,7 @@ sdp_mediadir_role_e sdp_attr_get_comediadir_role (void *sdp_ptr, u16 level, return (SDP_MEDIADIR_ROLE_UNKNOWN); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_DIRECTION, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -9563,9 +9528,9 @@ sdp_mediadir_role_e sdp_attr_get_comediadir_role (void *sdp_ptr, u16 level, /* Function: sdp_attr_set_comediadir_role * Description: Sets the value of the comediadir role parameter - * for the direction attribute. + * for the direction attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -9573,7 +9538,7 @@ sdp_mediadir_role_e sdp_attr_get_comediadir_role (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_comediadir_role (void *sdp_ptr, u16 level, +sdp_result_e sdp_attr_set_comediadir_role (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, sdp_mediadir_role_e comediadir_role) { @@ -9584,7 +9549,7 @@ sdp_result_e sdp_attr_set_comediadir_role (void *sdp_ptr, u16 level, return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_DIRECTION, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -9604,7 +9569,7 @@ sdp_result_e sdp_attr_set_comediadir_role (void *sdp_ptr, u16 level, * parameter specified for the given attribute. Returns TRUE if * the confirm parameter is specified. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -9620,7 +9585,7 @@ tinybool sdp_attr_get_silencesupp_enabled (void *sdp_ptr, u16 level, return (FALSE); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SILENCESUPP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -9640,7 +9605,7 @@ tinybool sdp_attr_get_silencesupp_enabled (void *sdp_ptr, u16 level, * is set to TRUE if no value was specified, but instead the * null "-" value was specified. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -9658,7 +9623,7 @@ u16 sdp_attr_get_silencesupp_timer (void *sdp_ptr, u16 level, return (0); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SILENCESUPP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -9678,7 +9643,7 @@ u16 sdp_attr_get_silencesupp_timer (void *sdp_ptr, u16 level, * If this parameter is TRUE, the confirm parameter will be * specified when the SDP description is built. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -9687,7 +9652,7 @@ u16 sdp_attr_get_silencesupp_timer (void *sdp_ptr, u16 level, * SDP_INVALID_PARAMETER Specified attribute is not defined. */ sdp_silencesupp_pref_e sdp_attr_get_silencesupp_pref (void *sdp_ptr, - u16 level, u8 cap_num, + u16 level, u8 cap_num, u16 inst_num) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -9697,7 +9662,7 @@ sdp_silencesupp_pref_e sdp_attr_get_silencesupp_pref (void *sdp_ptr, return (SDP_SILENCESUPP_PREF_UNKNOWN); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SILENCESUPP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -9713,11 +9678,11 @@ sdp_silencesupp_pref_e sdp_attr_get_silencesupp_pref (void *sdp_ptr, /* Function: sdp_attr_get_silencesupp_siduse * Description: Returns the value of the silencesupp attribute siduse - * parameter specified for the given attribute. If the given - * attribute is not defined, SDP_QOS_STRENGTH_UNKNOWN is - * returned. + * parameter specified for the given attribute. If the given + * attribute is not defined, SDP_QOS_STRENGTH_UNKNOWN is + * returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -9735,7 +9700,7 @@ sdp_silencesupp_siduse_e sdp_attr_get_silencesupp_siduse (void *sdp_ptr, return (SDP_SILENCESUPP_SIDUSE_UNKNOWN); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SILENCESUPP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -9755,7 +9720,7 @@ sdp_silencesupp_siduse_e sdp_attr_get_silencesupp_siduse (void *sdp_ptr, * null_ind is set to TRUE if no value was specified, * but instead the null "-" value was specified. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -9773,7 +9738,7 @@ u8 sdp_attr_get_silencesupp_fxnslevel (void *sdp_ptr, u16 level, return (0); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SILENCESUPP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -9791,7 +9756,7 @@ u8 sdp_attr_get_silencesupp_fxnslevel (void *sdp_ptr, u16 level, /* Function: sdp_attr_set_silencesupp_enabled * Description: Sets the silencesupp enable value * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -9810,7 +9775,7 @@ sdp_result_e sdp_attr_set_silencesupp_enabled (void *sdp_ptr, u16 level, return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SILENCESUPP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -9828,7 +9793,7 @@ sdp_result_e sdp_attr_set_silencesupp_enabled (void *sdp_ptr, u16 level, /* Function: sdp_attr_set_silencesupp_timer * Description: Sets the silencesupp timer value * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -9849,7 +9814,7 @@ sdp_result_e sdp_attr_set_silencesupp_timer (void *sdp_ptr, u16 level, return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SILENCESUPP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -9868,7 +9833,7 @@ sdp_result_e sdp_attr_set_silencesupp_timer (void *sdp_ptr, u16 level, /* Function: sdp_attr_set_silencesupp_pref * Description: Sets the silencesupp supppref value * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -9887,7 +9852,7 @@ sdp_result_e sdp_attr_set_silencesupp_pref (void *sdp_ptr, u16 level, return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SILENCESUPP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -9905,7 +9870,7 @@ sdp_result_e sdp_attr_set_silencesupp_pref (void *sdp_ptr, u16 level, /* Function: sdp_attr_set_silencesupp_siduse * Description: Sets the silencesupp supppref value * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -9924,7 +9889,7 @@ sdp_result_e sdp_attr_set_silencesupp_siduse (void *sdp_ptr, u16 level, return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SILENCESUPP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -9942,7 +9907,7 @@ sdp_result_e sdp_attr_set_silencesupp_siduse (void *sdp_ptr, u16 level, /* Function: sdp_attr_set_silencesupp_fxnslevel * Description: Sets the silencesupp timer value * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -9963,7 +9928,7 @@ sdp_result_e sdp_attr_set_silencesupp_fxnslevel (void *sdp_ptr, u16 level, return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SILENCESUPP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -9981,11 +9946,11 @@ sdp_result_e sdp_attr_set_silencesupp_fxnslevel (void *sdp_ptr, u16 level, /* Function: sdp_attr_get_mptime_num_intervals - * Description: Returns the number of intervals specified for the - * given mptime attribute. If the given attribute is not + * Description: Returns the number of intervals specified for the + * given mptime attribute. If the given attribute is not * defined, zero is returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -9996,7 +9961,7 @@ u16 sdp_attr_get_mptime_num_intervals ( u16 level, u8 cap_num, u16 inst_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; @@ -10008,7 +9973,7 @@ u16 sdp_attr_get_mptime_num_intervals ( if (attr_p != NULL) { return attr_p->attr.mptime.num_intervals; } - + if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s mptime attribute, level %u instance %u not found.", sdp_p->debug_str, level, inst_num); @@ -10018,15 +9983,15 @@ u16 sdp_attr_get_mptime_num_intervals ( } /* Function: sdp_attr_get_mptime_interval - * Description: Returns the value of the specified interval for the - * given mptime attribute. If the given attribute is not + * Description: Returns the value of the specified interval for the + * given mptime attribute. If the given attribute is not * defined, zero is returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. - * interval_num The interval number to get. Range is (1 - + * interval_num The interval number to get. Range is (1 - * max num payloads). * Returns: Interval. */ @@ -10036,7 +10001,7 @@ u16 sdp_attr_get_mptime_interval ( u8 cap_num, u16 inst_num, u16 interval_num) { - + sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; @@ -10053,11 +10018,11 @@ u16 sdp_attr_get_mptime_interval ( sdp_p->conf_p->num_invalid_param++; return 0; } - + if ((interval_num<1) || (interval_num>attr_p->attr.mptime.num_intervals)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s mptime attribute, level %u instance %u, " - "invalid interval number %u requested.", + "invalid interval number %u requested.", sdp_p->debug_str, level, inst_num, interval_num); } sdp_p->conf_p->num_invalid_param++; @@ -10073,7 +10038,7 @@ u16 sdp_attr_get_mptime_interval ( * added to the end of the list so these values should be added * in the order they will be displayed within the attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -10088,7 +10053,7 @@ sdp_result_e sdp_attr_add_mptime_interval ( u8 cap_num, u16 inst_num, u16 mp_interval) { - + u16 interval_num; sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; @@ -10117,7 +10082,7 @@ sdp_result_e sdp_attr_add_mptime_interval ( sdp_p->conf_p->num_invalid_param++; return SDP_INVALID_PARAMETER; } - + attr_p->attr.mptime.intervals[interval_num] = mp_interval; ++attr_p->attr.mptime.num_intervals; return SDP_SUCCESS; @@ -10126,7 +10091,7 @@ sdp_result_e sdp_attr_add_mptime_interval ( /* Function: sdp_get_group_attr - * Description: Returns the attribute parameter from the a=group:<> + * Description: Returns the attribute parameter from the a=group:<> * line. If no attrib has been set , * SDP_GROUP_ATTR_UNSUPPORTED will be returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. @@ -10138,12 +10103,12 @@ sdp_group_attr_e sdp_get_group_attr (void *sdp_ptr, u16 level, { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_GROUP_ATTR_UNSUPPORTED); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_GROUP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -10154,8 +10119,8 @@ sdp_group_attr_e sdp_get_group_attr (void *sdp_ptr, u16 level, return (SDP_GROUP_ATTR_UNSUPPORTED); } else { if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { - SDP_PRINT("%s Stream data group attr field is :%s ", - sdp_p->debug_str, + SDP_PRINT("%s Stream data group attr field is :%s ", + sdp_p->debug_str, sdp_get_group_attr_name(attr_p->attr.stream_data.group_attr) ); } return (attr_p->attr.stream_data.group_attr); @@ -10163,7 +10128,7 @@ sdp_group_attr_e sdp_get_group_attr (void *sdp_ptr, u16 level, } /* Function: sdp_set_group_attr - * Description: Sets the value of the group attribute for the + * Description: Sets the value of the group attribute for the * a=group: line. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level SDP_SESSION_LEVEL @@ -10171,17 +10136,17 @@ sdp_group_attr_e sdp_get_group_attr (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER/SDP_INVALID_SDP_PTR */ -sdp_result_e sdp_set_group_attr (void *sdp_ptr, u16 level, +sdp_result_e sdp_set_group_attr (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, sdp_group_attr_e group_attr) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_GROUP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -10197,22 +10162,22 @@ sdp_result_e sdp_set_group_attr (void *sdp_ptr, u16 level, } /* Function: sdp_get_group_num_id - * Description: Returns the number of ids from the a=group:<> line. + * Description: Returns the number of ids from the a=group:<> line. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level SDP_SESSION_LEVEL - * Returns: Num of group ids present or 0 if there is an error. + * Returns: Num of group ids present or 0 if there is an error. */ u16 sdp_get_group_num_id (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (0); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_GROUP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -10223,8 +10188,8 @@ u16 sdp_get_group_num_id (void *sdp_ptr, u16 level, return (0); } else { if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { - SDP_PRINT("%s Stream data group attr - num of ids is :%d ", - sdp_p->debug_str, + SDP_PRINT("%s Stream data group attr - num of ids is :%d ", + sdp_p->debug_str, attr_p->attr.stream_data.num_group_id); } } @@ -10238,21 +10203,21 @@ u16 sdp_get_group_num_id (void *sdp_ptr, u16 level, * level SDP_SESSION_LEVEL * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER/SDP_INVALID_SDP_PTR * Note: The application must call this API to set the number of group - * ids to be provided before actually setting the group ids on + * ids to be provided before actually setting the group ids on * the a=group line. */ -sdp_result_e sdp_set_group_num_id (void *sdp_ptr, u16 level, +sdp_result_e sdp_set_group_num_id (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 group_num_id) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_GROUP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -10275,12 +10240,12 @@ sdp_result_e sdp_set_group_num_id (void *sdp_ptr, u16 level, } /* Function: sdp_get_group_id - * Description: Returns the number of ids from the a=group:<> line. + * Description: Returns the number of ids from the a=group:<> line. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level SDP_SESSION_LEVEL - * id_num Number of the id to retrieve. The range is (1 - + * id_num Number of the id to retrieve. The range is (1 - * SDP_MAX_GROUP_STREAM_ID) - * Returns: Value of the group id at the index specified or + * Returns: Value of the group id at the index specified or * SDP_INVALID_VALUE if an error */ int32 sdp_get_group_id (void *sdp_ptr, u16 level, @@ -10288,12 +10253,12 @@ int32 sdp_get_group_id (void *sdp_ptr, u16 level, { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_VALUE); } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, + + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_GROUP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -10304,8 +10269,8 @@ int32 sdp_get_group_id (void *sdp_ptr, u16 level, return (SDP_INVALID_VALUE); } else { if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { - SDP_PRINT("%s Stream data group attr - num of ids is :%d ", - sdp_p->debug_str, + SDP_PRINT("%s Stream data group attr - num of ids is :%d ", + sdp_p->debug_str, attr_p->attr.stream_data.num_group_id); } if ((id_num < 1) || (id_num > attr_p->attr.stream_data.num_group_id)) { @@ -10323,18 +10288,18 @@ int32 sdp_get_group_id (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER/SDP_INVALID_SDP_PTR */ -sdp_result_e sdp_set_group_id (void *sdp_ptr, u16 level, +sdp_result_e sdp_set_group_id (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 group_id) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; u16 num_group_id; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_GROUP, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -10360,7 +10325,7 @@ sdp_result_e sdp_set_group_id (void *sdp_ptr, u16 level, } /* Function: sdp_attr_get_x_sidin - * Description: Returns the attribute parameter from the a=X-sidin:<> + * Description: Returns the attribute parameter from the a=X-sidin:<> * line. If no attrib has been set NULL will be returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level media level index @@ -10374,12 +10339,12 @@ const char* sdp_attr_get_x_sidin (void *sdp_ptr, u16 level, { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (NULL); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_X_SIDIN, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -10390,8 +10355,8 @@ const char* sdp_attr_get_x_sidin (void *sdp_ptr, u16 level, return (NULL); } else { if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { - SDP_PRINT("%s Stream X-sidin attr field is :%s ", - sdp_p->debug_str, + SDP_PRINT("%s Stream X-sidin attr field is :%s ", + sdp_p->debug_str, attr_p->attr.stream_data.x_sidin); } return (attr_p->attr.stream_data.x_sidin); @@ -10400,19 +10365,19 @@ const char* sdp_attr_get_x_sidin (void *sdp_ptr, u16 level, /* Function: sdp_attr_set_x_sidin * Description: Sets the value of the X-sidin parameter - * for the given attribute. The address is copied into the - * SDP structure so application memory will not be + * for the given attribute. The address is copied into the + * SDP structure so application memory will not be * referenced by the SDP lib. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. - * sidin Ptr to the sidin string + * sidin Ptr to the sidin string * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_x_sidin (void *sdp_ptr, u16 level, +sdp_result_e sdp_attr_set_x_sidin (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, const char *sidin) { @@ -10423,7 +10388,7 @@ sdp_result_e sdp_attr_set_x_sidin (void *sdp_ptr, u16 level, return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_X_SIDIN, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -10433,14 +10398,14 @@ sdp_result_e sdp_attr_set_x_sidin (void *sdp_ptr, u16 level, sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } else { - sstrncpy(attr_p->attr.stream_data.x_sidin, sidin, + sstrncpy(attr_p->attr.stream_data.x_sidin, sidin, sizeof(attr_p->attr.stream_data.x_sidin)) ; return (SDP_SUCCESS); } } /* Function: sdp_attr_get_x_sidout - * Description: Returns the attribute parameter from the a=X-sidout:<> + * Description: Returns the attribute parameter from the a=X-sidout:<> * line. If no attrib has been set NULL will be returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level media level index @@ -10454,12 +10419,12 @@ const char* sdp_attr_get_x_sidout (void *sdp_ptr, u16 level, { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (NULL); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_X_SIDOUT, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -10470,8 +10435,8 @@ const char* sdp_attr_get_x_sidout (void *sdp_ptr, u16 level, return (NULL); } else { if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { - SDP_PRINT("%s Stream X-sidout attr field is :%s ", - sdp_p->debug_str, + SDP_PRINT("%s Stream X-sidout attr field is :%s ", + sdp_p->debug_str, attr_p->attr.stream_data.x_sidout); } return (attr_p->attr.stream_data.x_sidout); @@ -10480,11 +10445,11 @@ const char* sdp_attr_get_x_sidout (void *sdp_ptr, u16 level, /* Function: sdp_attr_set_x_sidout * Description: Sets the value of the x-sidout parameter - * for the given attribute. The address is copied into the - * SDP structure so application memory will not be + * for the given attribute. The address is copied into the + * SDP structure so application memory will not be * referenced by the SDP lib. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -10492,7 +10457,7 @@ const char* sdp_attr_get_x_sidout (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_x_sidout (void *sdp_ptr, u16 level, +sdp_result_e sdp_attr_set_x_sidout (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, const char *sidout) { @@ -10503,7 +10468,7 @@ sdp_result_e sdp_attr_set_x_sidout (void *sdp_ptr, u16 level, return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_X_SIDOUT, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -10513,14 +10478,14 @@ sdp_result_e sdp_attr_set_x_sidout (void *sdp_ptr, u16 level, sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } else { - sstrncpy(attr_p->attr.stream_data.x_sidout, sidout, + sstrncpy(attr_p->attr.stream_data.x_sidout, sidout, sizeof(attr_p->attr.stream_data.x_sidout)) ; return (SDP_SUCCESS); } } /* Function: sdp_attr_get_x_confid - * Description: Returns the attribute parameter from the a=X-confid:<> + * Description: Returns the attribute parameter from the a=X-confid:<> * line. If no attrib has been set NULL will be returned. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level media level index @@ -10534,12 +10499,12 @@ const char* sdp_attr_get_x_confid (void *sdp_ptr, u16 level, { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (NULL); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_X_CONFID, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -10550,8 +10515,8 @@ const char* sdp_attr_get_x_confid (void *sdp_ptr, u16 level, return (NULL); } else { if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { - SDP_PRINT("%s Stream X-confid attr field is :%s ", - sdp_p->debug_str, + SDP_PRINT("%s Stream X-confid attr field is :%s ", + sdp_p->debug_str, attr_p->attr.stream_data.x_confid); } return (attr_p->attr.stream_data.x_confid); @@ -10560,11 +10525,11 @@ const char* sdp_attr_get_x_confid (void *sdp_ptr, u16 level, /* Function: sdp_attr_set_x_confid * Description: Sets the value of the X-confid parameter - * for the given attribute. The address is copied into the - * SDP structure so application memory will not be + * for the given attribute. The address is copied into the + * SDP structure so application memory will not be * referenced by the SDP lib. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -10572,7 +10537,7 @@ const char* sdp_attr_get_x_confid (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ -sdp_result_e sdp_attr_set_x_confid (void *sdp_ptr, u16 level, +sdp_result_e sdp_attr_set_x_confid (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, const char *confid) { @@ -10583,7 +10548,7 @@ sdp_result_e sdp_attr_set_x_confid (void *sdp_ptr, u16 level, return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_X_CONFID, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -10593,7 +10558,7 @@ sdp_result_e sdp_attr_set_x_confid (void *sdp_ptr, u16 level, sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } else { - sstrncpy(attr_p->attr.stream_data.x_confid, confid, + sstrncpy(attr_p->attr.stream_data.x_confid, confid, sizeof(attr_p->attr.stream_data.x_confid)) ; return (SDP_SUCCESS); } @@ -10607,28 +10572,28 @@ sdp_result_e sdp_attr_set_x_confid (void *sdp_ptr, u16 level, * mode Filter-mode (incl/excl) * nettype Network type * addrtype Address type of the destination - * dest_addr Destination unicast/multicast address + * dest_addr Destination unicast/multicast address * (ip-addr/ fqdn/ *) * src_addr One of the source address to which the filter * applies, i.e. process/drop the packets. - * (More source addresses are added using + * (More source addresses are added using * sdp_include_new_filter_src_addr) * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER/SDP_INVALID_SDP_PTR */ -sdp_result_e -sdp_set_source_filter (void *sdp_ptr, u16 level, u8 cap_num, +sdp_result_e +sdp_set_source_filter (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, sdp_src_filter_mode_e mode, - sdp_nettype_e nettype, sdp_addrtype_e addrtype, + sdp_nettype_e nettype, sdp_addrtype_e addrtype, const char *dest_addr, const char *src_addr) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; u16 index; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SOURCE_FILTER, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -10644,18 +10609,18 @@ sdp_set_source_filter (void *sdp_ptr, u16 level, u8 cap_num, sstrncpy(attr_p->attr.source_filter.dest_addr, dest_addr, SDP_MAX_STRING_LEN+1); if (src_addr) { - index = attr_p->attr.source_filter.num_src_addr; - sstrncpy(attr_p->attr.source_filter.src_list[index], + index = attr_p->attr.source_filter.num_src_addr; + sstrncpy(attr_p->attr.source_filter.src_list[index], src_addr,SDP_MAX_STRING_LEN+1); /* Increment source list count if the api was invoked for * first time or else we're basically replacing the index 0 * element in src-list. */ ++attr_p->attr.source_filter.num_src_addr; - SDP_PRINT("%s Source address (%s) number %d added to source filter", - sdp_p->debug_str,src_addr, + SDP_PRINT("%s Source address (%s) number %d added to source filter", + sdp_p->debug_str,src_addr, attr_p->attr.source_filter.num_src_addr); - + } return (SDP_SUCCESS); @@ -10672,13 +10637,13 @@ sdp_set_source_filter (void *sdp_ptr, u16 level, u8 cap_num, * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER/SDP_INVALID_SDP_PTR */ -sdp_result_e -sdp_include_new_filter_src_addr (void *sdp_ptr, u16 level, u8 cap_num, +sdp_result_e +sdp_include_new_filter_src_addr (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, const char *src_addr) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); } @@ -10716,8 +10681,8 @@ sdp_include_new_filter_src_addr (void *sdp_ptr, u16 level, u8 cap_num, * inst_num The attribute instance number * Returns: Filter mode (incl/excl/not present) */ -sdp_src_filter_mode_e -sdp_get_source_filter_mode (void *sdp_ptr, u16 level, u8 cap_num, +sdp_src_filter_mode_e +sdp_get_source_filter_mode (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -10726,7 +10691,7 @@ sdp_get_source_filter_mode (void *sdp_ptr, u16 level, u8 cap_num, if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_FILTER_MODE_NOT_PRESENT); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SOURCE_FILTER, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -10742,15 +10707,15 @@ sdp_get_source_filter_mode (void *sdp_ptr, u16 level, u8 cap_num, /* Function: sdp_get_filter_destination_attributes * Description: Gets the destination address parameters - * Parameters: Network type (optional), destination address type - * (optional), and destination address (mandatory) variables + * Parameters: Network type (optional), destination address type + * (optional), and destination address (mandatory) variables * which gets updated. * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER/SDP_INVALID_SDP_PTR */ sdp_result_e sdp_get_filter_destination_attributes (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, sdp_nettype_e *nettype, - sdp_addrtype_e *addrtype, + sdp_addrtype_e *addrtype, char *dest_addr) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -10790,7 +10755,7 @@ sdp_get_filter_destination_attributes (void *sdp_ptr, u16 level, u8 cap_num, */ int32 -sdp_get_filter_source_address_count (void *sdp_ptr, u16 level, +sdp_get_filter_source_address_count (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -10825,7 +10790,7 @@ sdp_get_filter_source_address_count (void *sdp_ptr, u16 level, */ sdp_result_e sdp_get_filter_source_address (void *sdp_ptr, u16 level, u8 cap_num, - u16 inst_num, u16 src_addr_id, + u16 inst_num, u16 src_addr_id, char *src_addr) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -10859,7 +10824,7 @@ sdp_get_filter_source_address (void *sdp_ptr, u16 level, u8 cap_num, } sdp_result_e -sdp_set_rtcp_unicast_mode (void *sdp_ptr, u16 level, u8 cap_num, +sdp_set_rtcp_unicast_mode (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, sdp_rtcp_unicast_mode_e mode) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -10871,7 +10836,7 @@ sdp_set_rtcp_unicast_mode (void *sdp_ptr, u16 level, u8 cap_num, if (mode >= SDP_RTCP_MAX_UNICAST_MODE) { return (SDP_INVALID_PARAMETER); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_RTCP_UNICAST, inst_num); if (attr_p == NULL) { @@ -10887,7 +10852,7 @@ sdp_set_rtcp_unicast_mode (void *sdp_ptr, u16 level, u8 cap_num, return (SDP_SUCCESS); } -sdp_rtcp_unicast_mode_e +sdp_rtcp_unicast_mode_e sdp_get_rtcp_unicast_mode(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { @@ -10916,14 +10881,14 @@ sdp_get_rtcp_unicast_mode(void *sdp_ptr, u16 level, u8 cap_num, * Description: Returns the value of the sdescriptions tag * parameter specified for the given attribute. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. * Returns: Tag value or SDP_INVALID_VALUE (-2) if error encountered. */ - -int32 + +int32 sdp_attr_get_sdescriptions_tag (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) { @@ -10934,9 +10899,9 @@ sdp_attr_get_sdescriptions_tag (void *sdp_ptr, u16 level, return SDP_INVALID_VALUE; } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SDESCRIPTIONS, inst_num); - + if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s srtp attribute tag, level %u instance %u " @@ -10958,16 +10923,16 @@ sdp_attr_get_sdescriptions_tag (void *sdp_ptr, u16 level, * attribute is present. If it is, return the suite. If it's not, * try to find the version 9. This assumes you cannot have both * versions in the same SDP. - * + * * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. - * Returns: SDP_SRTP_UNKNOWN_CRYPTO_SUITE is returned if an error was + * Returns: SDP_SRTP_UNKNOWN_CRYPTO_SUITE is returned if an error was * encountered otherwise the crypto suite is returned. */ - + sdp_srtp_crypto_suite_t sdp_attr_get_sdescriptions_crypto_suite (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) @@ -10979,14 +10944,14 @@ sdp_attr_get_sdescriptions_crypto_suite (void *sdp_ptr, u16 level, return SDP_SRTP_UNKNOWN_CRYPTO_SUITE; } - + /* Try version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SRTP_CONTEXT, inst_num); - + if (attr_p == NULL) { /* There's no version 2 so now try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SDESCRIPTIONS, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -10997,9 +10962,9 @@ sdp_attr_get_sdescriptions_crypto_suite (void *sdp_ptr, u16 level, return SDP_SRTP_UNKNOWN_CRYPTO_SUITE; } } - + return attr_p->attr.srtp_context.suite; - + } /* Function: sdp_attr_get_sdescriptions_key @@ -11013,13 +10978,13 @@ sdp_attr_get_sdescriptions_crypto_suite (void *sdp_ptr, u16 level, * versions in the same SDP. * * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. * Returns: NULL if error encountered or master key salt string */ - + const char* sdp_attr_get_sdescriptions_key (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) @@ -11032,14 +10997,14 @@ sdp_attr_get_sdescriptions_key (void *sdp_ptr, u16 level, } /* Try version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SRTP_CONTEXT, inst_num); - + if (attr_p == NULL) { /* Couldn't find version 2 now try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SDESCRIPTIONS, inst_num); - + if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s srtp attribute key, level %u instance %u " @@ -11048,8 +11013,8 @@ sdp_attr_get_sdescriptions_key (void *sdp_ptr, u16 level, sdp_p->conf_p->num_invalid_param++; return NULL; } - } - + } + return (char*)attr_p->attr.srtp_context.master_key; } @@ -11065,13 +11030,13 @@ sdp_attr_get_sdescriptions_key (void *sdp_ptr, u16 level, * versions in the same SDP. * * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. * Returns: NULL if error encountered or master key salt string */ - + const char* sdp_attr_get_sdescriptions_salt (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) @@ -11084,14 +11049,14 @@ sdp_attr_get_sdescriptions_salt (void *sdp_ptr, u16 level, } /* Try version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SRTP_CONTEXT, inst_num); - + if (attr_p == NULL) { /* Couldn't find version 2 now try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SDESCRIPTIONS, inst_num); - + if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s srtp attribute salt, level %u instance %u " @@ -11100,10 +11065,10 @@ sdp_attr_get_sdescriptions_salt (void *sdp_ptr, u16 level, sdp_p->conf_p->num_invalid_param++; return NULL; } - } - + } + return (char*) attr_p->attr.srtp_context.master_salt; - + } @@ -11119,13 +11084,13 @@ sdp_attr_get_sdescriptions_salt (void *sdp_ptr, u16 level, * both versions in the same SDP. * * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. * Returns: NULL if error encountered or lifetime string */ - + const char* sdp_attr_get_sdescriptions_lifetime (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) @@ -11138,14 +11103,14 @@ sdp_attr_get_sdescriptions_lifetime (void *sdp_ptr, u16 level, } /* Try version 2 first. */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SRTP_CONTEXT, inst_num); - + if (attr_p == NULL) { /* Couldn't find version 2 now try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SDESCRIPTIONS, inst_num); - + if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s srtp attribute lifetime, level %u instance %u " @@ -11154,10 +11119,10 @@ sdp_attr_get_sdescriptions_lifetime (void *sdp_ptr, u16 level, sdp_p->conf_p->num_invalid_param++; return NULL; } - } - + } + return (char*)attr_p->attr.srtp_context.master_key_lifetime; - + } /* Function: sdp_attr_get_sdescriptions_mki @@ -11171,18 +11136,18 @@ sdp_attr_get_sdescriptions_lifetime (void *sdp_ptr, u16 level, * both versions in the same SDP. * * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. * mki_value application provided pointer that on exit * is set to the MKI value string if one exists. - * mki_length application provided pointer that on exit + * mki_length application provided pointer that on exit * is set to the MKI length if one exists. - * Returns: SDP_SUCCESS no errors encountered otherwise sdp error + * Returns: SDP_SUCCESS no errors encountered otherwise sdp error * based upon the specific error. */ - + sdp_result_e sdp_attr_get_sdescriptions_mki (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, @@ -11194,18 +11159,18 @@ sdp_attr_get_sdescriptions_mki (void *sdp_ptr, u16 level, *mki_value = NULL; *mki_length = 0; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return SDP_INVALID_SDP_PTR; } /* Try version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SRTP_CONTEXT, inst_num); - + if (attr_p == NULL) { /* Couldn't find version 2 now try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SDESCRIPTIONS, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -11216,11 +11181,11 @@ sdp_attr_get_sdescriptions_mki (void *sdp_ptr, u16 level, return SDP_INVALID_PARAMETER; } } - + *mki_value = (char*)attr_p->attr.srtp_context.mki; *mki_length = attr_p->attr.srtp_context.mki_size_bytes; return SDP_SUCCESS; - + } @@ -11232,9 +11197,9 @@ sdp_attr_get_sdescriptions_mki (void *sdp_ptr, u16 level, * attribute is present. If it is, return session parameters. If * it's not, try to find version 9. This assumes you cannot have * both versions in the same SDP. - * + * * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -11243,7 +11208,7 @@ sdp_attr_get_sdescriptions_mki (void *sdp_ptr, u16 level, * parameters string. Note that the calling function should * not free the returned pointer. */ - + const char* sdp_attr_get_sdescriptions_session_params (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num) @@ -11256,12 +11221,12 @@ sdp_attr_get_sdescriptions_session_params (void *sdp_ptr, u16 level, } /* Try version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SRTP_CONTEXT, inst_num); - + if (attr_p == NULL) { /* Couldn't find version 2 try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SDESCRIPTIONS, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -11271,8 +11236,8 @@ sdp_attr_get_sdescriptions_session_params (void *sdp_ptr, u16 level, sdp_p->conf_p->num_invalid_param++; return NULL; } - } - + } + return attr_p->attr.srtp_context.session_parameters; } @@ -11285,37 +11250,37 @@ sdp_attr_get_sdescriptions_session_params (void *sdp_ptr, u16 level, * attribute is present. If it is, return key size. If * it's not, try to find version 9. This assumes you cannot have * both versions in the same SDP. - * + * * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. - * Returns: 0 (SDP_SDESCRIPTIONS_KEY_SIZE_UNKNOWN) if error was + * Returns: 0 (SDP_SDESCRIPTIONS_KEY_SIZE_UNKNOWN) if error was * encountered, otherwise key size. */ - -unsigned char -sdp_attr_get_sdescriptions_key_size (void *sdp_ptr, - u16 level, - u8 cap_num, + +unsigned char +sdp_attr_get_sdescriptions_key_size (void *sdp_ptr, + u16 level, + u8 cap_num, u16 inst_num) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return SDP_SDESCRIPTIONS_KEY_SIZE_UNKNOWN; } /* Try version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SRTP_CONTEXT, inst_num); - + if (attr_p == NULL) { /* Couldn't find version 2 now try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SDESCRIPTIONS, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -11326,7 +11291,7 @@ sdp_attr_get_sdescriptions_key_size (void *sdp_ptr, return SDP_SDESCRIPTIONS_KEY_SIZE_UNKNOWN; } } - + return attr_p->attr.srtp_context.master_key_size_bytes; } @@ -11340,37 +11305,37 @@ sdp_attr_get_sdescriptions_key_size (void *sdp_ptr, * attribute is present. If it is, return salt size. If * it's not, try to find version 9. This assumes you cannot have * both versions in the same SDP. - * + * * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. - * Returns: 0 (SDP_SDESCRIPTIONS_KEY_SIZE_UNKNOWN) if error was + * Returns: 0 (SDP_SDESCRIPTIONS_KEY_SIZE_UNKNOWN) if error was * encountered, otherwise salt size. */ - -unsigned char -sdp_attr_get_sdescriptions_salt_size (void *sdp_ptr, - u16 level, - u8 cap_num, + +unsigned char +sdp_attr_get_sdescriptions_salt_size (void *sdp_ptr, + u16 level, + u8 cap_num, u16 inst_num) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return SDP_SDESCRIPTIONS_KEY_SIZE_UNKNOWN; } /* Try version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SRTP_CONTEXT, inst_num); - + if (attr_p == NULL) { /* Couldn't find version 2 now try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SDESCRIPTIONS, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -11381,7 +11346,7 @@ sdp_attr_get_sdescriptions_salt_size (void *sdp_ptr, return SDP_SDESCRIPTIONS_KEY_SIZE_UNKNOWN; } } - + return attr_p->attr.srtp_context.master_salt_size_bytes; } @@ -11396,38 +11361,38 @@ sdp_attr_get_sdescriptions_salt_size (void *sdp_ptr, * it's not, try to find version 9. This assumes you cannot have * both versions in the same SDP. * Currently only necessary for MGCP. - * + * * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. - * Returns: 0 (SDP_SRTP_CRYPTO_SELECTION_FLAGS_UNKNOWN) if error was + * Returns: 0 (SDP_SRTP_CRYPTO_SELECTION_FLAGS_UNKNOWN) if error was * encountered, otherwise selection flags. */ - -unsigned long -sdp_attr_get_srtp_crypto_selection_flags (void *sdp_ptr, - u16 level, - u8 cap_num, + +unsigned long +sdp_attr_get_srtp_crypto_selection_flags (void *sdp_ptr, + u16 level, + u8 cap_num, u16 inst_num) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; - + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return SDP_SRTP_CRYPTO_SELECTION_FLAGS_UNKNOWN; } /* Try version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SRTP_CONTEXT, inst_num); - + if (attr_p == NULL) { /* Couldn't find version 2 now try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SDESCRIPTIONS, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -11438,9 +11403,9 @@ sdp_attr_get_srtp_crypto_selection_flags (void *sdp_ptr, return SDP_SRTP_CRYPTO_SELECTION_FLAGS_UNKNOWN; } } - + return attr_p->attr.srtp_context.selection_flags; - + } @@ -11448,7 +11413,7 @@ sdp_attr_get_srtp_crypto_selection_flags (void *sdp_ptr, /* Function: sdp_attr_set_sdescriptions_tag * Description: Sets the sdescriptions tag parameter * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -11456,8 +11421,8 @@ sdp_attr_get_srtp_crypto_selection_flags (void *sdp_ptr, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ - -sdp_result_e + +sdp_result_e sdp_attr_set_sdescriptions_tag (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, int32 tag_num) @@ -11469,7 +11434,7 @@ sdp_attr_set_sdescriptions_tag (void *sdp_ptr, u16 level, return (SDP_INVALID_SDP_PTR); } - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SDESCRIPTIONS, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -11491,11 +11456,11 @@ sdp_attr_set_sdescriptions_tag (void *sdp_ptr, u16 level, * sdescriptions. It has no knowledge which version is being * used so it will first try to find if a version 2 sdescriptions * attribute is present. If it is, it will set the crypto suite - * for version 2. If it's not, try to find version 9. This assumes + * for version 2. If it's not, try to find version 9. This assumes * you cannot have both versions in the same SDP. * * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -11503,8 +11468,8 @@ sdp_attr_set_sdescriptions_tag (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ - -sdp_result_e + +sdp_result_e sdp_attr_set_sdescriptions_crypto_suite (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, sdp_srtp_crypto_suite_t crypto_suite) @@ -11518,15 +11483,15 @@ sdp_attr_set_sdescriptions_crypto_suite (void *sdp_ptr, u16 level, } /* Try to find version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SRTP_CONTEXT, inst_num); if (attr_p == NULL) { - + /* Version 2 not found, try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SDESCRIPTIONS, inst_num); if (attr_p == NULL) { - + if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s srtp attribute suite, level %u instance %u " "not found.", sdp_p->debug_str, level, inst_num); @@ -11534,27 +11499,27 @@ sdp_attr_set_sdescriptions_crypto_suite (void *sdp_ptr, u16 level, sdp_p->conf_p->num_invalid_param++; return SDP_INVALID_PARAMETER; } - } - + } + attr_p->attr.srtp_context.suite = crypto_suite; for (i=0; i < SDP_SRTP_MAX_NUM_CRYPTO_SUITES; i++) { /* For the specified crypto suite, get the size of the * key and salt. */ - if (sdp_srtp_crypto_suite_array[i].crypto_suite_val == + if (sdp_srtp_crypto_suite_array[i].crypto_suite_val == crypto_suite) { - + attr_p->attr.srtp_context.master_key_size_bytes = sdp_srtp_crypto_suite_array[i].key_size_bytes; - - attr_p->attr.srtp_context.master_salt_size_bytes = + + attr_p->attr.srtp_context.master_salt_size_bytes = sdp_srtp_crypto_suite_array[i].salt_size_bytes; - + } } - + return SDP_SUCCESS; - + } @@ -11564,11 +11529,11 @@ sdp_attr_set_sdescriptions_crypto_suite (void *sdp_ptr, u16 level, * sdescriptions. It has no knowledge which version is being * used so it will first try to find if a version 2 sdescriptions * attribute is present. If it is, it will set the key for - * version 2. If it's not, try to find version 9. This assumes + * version 2. If it's not, try to find version 9. This assumes * you cannot have both versions in the same SDP. * * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -11576,8 +11541,8 @@ sdp_attr_set_sdescriptions_crypto_suite (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ - -sdp_result_e + +sdp_result_e sdp_attr_set_sdescriptions_key (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, char *key) @@ -11591,11 +11556,11 @@ sdp_attr_set_sdescriptions_key (void *sdp_ptr, u16 level, } /* Try version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SRTP_CONTEXT, inst_num); if (attr_p == NULL) { /* Couldn't find version 2 try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SDESCRIPTIONS, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -11605,14 +11570,14 @@ sdp_attr_set_sdescriptions_key (void *sdp_ptr, u16 level, sdp_p->conf_p->num_invalid_param++; return SDP_INVALID_PARAMETER; } - - } - - bcopy(key, attr_p->attr.srtp_context.master_key, + + } + + bcopy(key, attr_p->attr.srtp_context.master_key, SDP_SRTP_MAX_KEY_SIZE_BYTES); - + return SDP_SUCCESS; - + } @@ -11622,11 +11587,11 @@ sdp_attr_set_sdescriptions_key (void *sdp_ptr, u16 level, * sdescriptions. It has no knowledge which version is being * used so it will first try to find if a version 2 sdescriptions * attribute is present. If it is, it will set the salt for - * version 2. If it's not, try to find version 9. This assumes + * version 2. If it's not, try to find version 9. This assumes * you cannot have both versions in the same SDP. * * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -11634,8 +11599,8 @@ sdp_attr_set_sdescriptions_key (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ - -sdp_result_e + +sdp_result_e sdp_attr_set_sdescriptions_salt (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, char *salt) @@ -11649,11 +11614,11 @@ sdp_attr_set_sdescriptions_salt (void *sdp_ptr, u16 level, } /* Try to find version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SRTP_CONTEXT, inst_num); if (attr_p == NULL) { /* Couldn't find version 2, try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SDESCRIPTIONS, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -11663,12 +11628,12 @@ sdp_attr_set_sdescriptions_salt (void *sdp_ptr, u16 level, sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } - - } - + + } + bcopy(salt, attr_p->attr.srtp_context.master_salt, SDP_SRTP_MAX_SALT_SIZE_BYTES); - + return SDP_SUCCESS; } @@ -11679,11 +11644,11 @@ sdp_attr_set_sdescriptions_salt (void *sdp_ptr, u16 level, * sdescriptions. It has no knowledge which version is being * used so it will first try to find if a version 2 sdescriptions * attribute is present. If it is, it will set the lifetime for - * version 2. If it's not, try to find version 9. This assumes + * version 2. If it's not, try to find version 9. This assumes * you cannot have both versions in the same SDP. * * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -11691,8 +11656,8 @@ sdp_attr_set_sdescriptions_salt (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ - -sdp_result_e + +sdp_result_e sdp_attr_set_sdescriptions_lifetime (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, char *lifetime) @@ -11705,11 +11670,11 @@ sdp_attr_set_sdescriptions_lifetime (void *sdp_ptr, u16 level, } /* Try version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SRTP_CONTEXT, inst_num); if (attr_p == NULL) { /* Couldn't find version 2, try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SDESCRIPTIONS, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -11719,38 +11684,38 @@ sdp_attr_set_sdescriptions_lifetime (void *sdp_ptr, u16 level, sdp_p->conf_p->num_invalid_param++; return SDP_INVALID_PARAMETER; } - - } - - sstrncpy((char*)attr_p->attr.srtp_context.master_key_lifetime, lifetime, + + } + + sstrncpy((char*)attr_p->attr.srtp_context.master_key_lifetime, lifetime, SDP_SRTP_MAX_LIFETIME_BYTES); return SDP_SUCCESS; - + } /* Function: sdp_attr_set_sdescriptions_mki - * Description: Sets the sdescriptions mki parameter compose of the MKI + * Description: Sets the sdescriptions mki parameter compose of the MKI * value and length. Note that this is a common api for both * version 2 and version 9 sdescriptions. It has no knowledge - * which version is being used so it will first try to find if - * a version 2 sdescriptions attribute is present. If it is, it will - * set the lifetime for version 2. If it's not, try to find version 9. + * which version is being used so it will first try to find if + * a version 2 sdescriptions attribute is present. If it is, it will + * set the lifetime for version 2. If it's not, try to find version 9. * This assumes you cannot have both versions in the same SDP. * * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. - * mki_value buffer containing the mki value. Assumes null + * mki_value buffer containing the mki value. Assumes null * terminated buffer. * mki_length length of the MKI * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ - -sdp_result_e + +sdp_result_e sdp_attr_set_sdescriptions_mki (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, char *mki_value, @@ -11764,11 +11729,11 @@ sdp_attr_set_sdescriptions_mki (void *sdp_ptr, u16 level, } /* Try version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SRTP_CONTEXT, inst_num); if (attr_p == NULL) { /* Couldn't find version 2, try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SDESCRIPTIONS, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -11779,12 +11744,12 @@ sdp_attr_set_sdescriptions_mki (void *sdp_ptr, u16 level, return SDP_INVALID_PARAMETER; } } - - sstrncpy((char*)attr_p->attr.srtp_context.mki, mki_value, + + sstrncpy((char*)attr_p->attr.srtp_context.mki, mki_value, SDP_SRTP_MAX_MKI_SIZE_BYTES); attr_p->attr.srtp_context.mki_size_bytes = mki_length; return SDP_SUCCESS; - + } @@ -11794,11 +11759,11 @@ sdp_attr_set_sdescriptions_mki (void *sdp_ptr, u16 level, * sdescriptions. It has no knowledge which version is being * used so it will first try to find if a version 2 sdescriptions * attribute is present. If it is, it will set the key for - * version 2. If it's not, try to find version 9. This assumes + * version 2. If it's not, try to find version 9. This assumes * you cannot have both versions in the same SDP. * * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -11806,14 +11771,14 @@ sdp_attr_set_sdescriptions_mki (void *sdp_ptr, u16 level, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ - + sdp_result_e -sdp_attr_set_sdescriptions_key_size (void *sdp_ptr, - u16 level, - u8 cap_num, - u16 inst_num, +sdp_attr_set_sdescriptions_key_size (void *sdp_ptr, + u16 level, + u8 cap_num, + u16 inst_num, unsigned char key_size) - + { sdp_t *sdp_p = (sdp_t *)sdp_ptr; @@ -11824,11 +11789,11 @@ sdp_attr_set_sdescriptions_key_size (void *sdp_ptr, } /* Try version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SRTP_CONTEXT, inst_num); if (attr_p == NULL) { /* Couldn't find version 2, try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SDESCRIPTIONS, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -11839,7 +11804,7 @@ sdp_attr_set_sdescriptions_key_size (void *sdp_ptr, return SDP_INVALID_PARAMETER; } } - + attr_p->attr.srtp_context.master_key_size_bytes = key_size; return SDP_SUCCESS; @@ -11852,11 +11817,11 @@ sdp_attr_set_sdescriptions_key_size (void *sdp_ptr, * sdescriptions. It has no knowledge which version is being * used so it will first try to find if a version 2 sdescriptions * attribute is present. If it is, it will set the salt for - * version 2. If it's not, try to find version 9. This assumes + * version 2. If it's not, try to find version 9. This assumes * you cannot have both versions in the same SDP. * * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. + * level The level to check for the attribute. * cap_num The capability number associated with the * attribute if any. If none, should be zero. * inst_num The attribute instance number to check. @@ -11864,12 +11829,12 @@ sdp_attr_set_sdescriptions_key_size (void *sdp_ptr, * Returns: SDP_SUCCESS Attribute param was set successfully. * SDP_INVALID_PARAMETER Specified attribute is not defined. */ - + sdp_result_e -sdp_attr_set_sdescriptions_salt_size (void *sdp_ptr, - u16 level, - u8 cap_num, - u16 inst_num, +sdp_attr_set_sdescriptions_salt_size (void *sdp_ptr, + u16 level, + u8 cap_num, + u16 inst_num, unsigned char salt_size) { @@ -11881,11 +11846,11 @@ sdp_attr_set_sdescriptions_salt_size (void *sdp_ptr, } /* Try version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SRTP_CONTEXT, inst_num); if (attr_p == NULL) { /* Couldn't find version 2, try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, + attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SDESCRIPTIONS, inst_num); if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -11896,7 +11861,7 @@ sdp_attr_set_sdescriptions_salt_size (void *sdp_ptr, return SDP_INVALID_PARAMETER; } } - + attr_p->attr.srtp_context.master_salt_size_bytes = salt_size; return SDP_SUCCESS; diff --git a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_base64.c b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_base64.c index c357b2a05c1b..0cef82166d11 100644 --- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_base64.c +++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_base64.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "sdp_base64.h" @@ -118,16 +83,16 @@ int base64_est_encode_size_bytes (int raw_size_bytes) { int length; - /* + /* * Find the number of bytes needed to represent the data - * using a 4/3 expansion ratio. That result must be + * using a 4/3 expansion ratio. That result must be * rounded to the next higher multiple of four to account * for padding. Then add in a term to account for any '\n's * added. */ - length = ((((raw_size_bytes * 4 + 2)/ 3) + 3) & ~(0x3)) + + length = ((((raw_size_bytes * 4 + 2)/ 3) + 3) & ~(0x3)) + raw_size_bytes / MAX_BASE64_LINE_LENGTH; - + return length; } @@ -148,7 +113,7 @@ int base64_est_decode_size_bytes (int base64_size_bytes) { int length; - length = (base64_size_bytes * 3 + 3) / 4; + length = (base64_size_bytes * 3 + 3) / 4; return length; } @@ -172,8 +137,8 @@ int base64_est_decode_size_bytes (int base64_size_bytes) * but at completion holds the number of bytes converted. * * RETURN VALUE - * base64_success if the buffer was successfully converted, the - * appropriate error code otherwise. + * base64_success if the buffer was successfully converted, the + * appropriate error code otherwise. * * The dest parameter holds the converted data. * @@ -204,7 +169,7 @@ base64_result_t base64_encode(unsigned char *src, int src_bytes, unsigned char * line_count += 4; if ((j+3) < dmax) { - + /* Find mapping of upper 6 bits */ index = (src[i] >> 2) & 0x3F; dest[j++] = raw_to_base64_table[index]; @@ -227,7 +192,7 @@ base64_result_t base64_encode(unsigned char *src, int src_bytes, unsigned char * /* Check to see if any more work must be done */ if (i=MAX_BASE64_LINE_LENGTH) { if (j - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _SDP_BASE64_H_ #define _SDP_BASE64_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_config.c b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_config.c index db119d1ba1f5..17750af37c71 100644 --- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_config.c +++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_config.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "sdp_os_defs.h" #include "sdp.h" @@ -51,7 +16,7 @@ * str String containing function name to print. * Returns: TRUE or FALSE. */ -tinybool sdp_verify_conf_ptr (sdp_conf_options_t *conf_p) +tinybool sdp_verify_conf_ptr (sdp_conf_options_t *conf_p) { if ((conf_p != NULL) && (conf_p->magic_num == SDP_MAGIC_NUM)) { return (TRUE); @@ -135,16 +100,16 @@ void *sdp_init_config () /* Function: void sdp_appl_debug(void *config_p, sdp_debug_e debug_type, * tinybool my_bool); - * Description: Define the default type of debug for the application. - * Valid debug types are ERRORS, WARNINGS, and TRACE. Each - * debug type can be turned on/off individually. The + * Description: Define the default type of debug for the application. + * Valid debug types are ERRORS, WARNINGS, and TRACE. Each + * debug type can be turned on/off individually. The * default debug level can be redefined at any time. * Parameters: conf_p The config handle returned by sdp_init_config. * debug_type Specifies the debug type being enabled/disabled. * debug_flag Defines whether the debug should be enabled or not. * Returns: Nothing. */ -void sdp_appl_debug (void *config_p, sdp_debug_e debug_type, +void sdp_appl_debug (void *config_p, sdp_debug_e debug_type, tinybool debug_flag) { sdp_conf_options_t *conf_p = (sdp_conf_options_t *)config_p; @@ -153,7 +118,7 @@ void sdp_appl_debug (void *config_p, sdp_debug_e debug_type, return; } - if (debug_type < SDP_MAX_DEBUG_TYPES) { + if (debug_type < SDP_MAX_DEBUG_TYPES) { conf_p->debug_flag[debug_type] = debug_flag; } } @@ -163,10 +128,10 @@ void sdp_appl_debug (void *config_p, sdp_debug_e debug_type, * void sdp_require_owner * void sdp_require_session_name * void sdp_require_timespec - * Description: These functions allow the application to not require several + * Description: These functions allow the application to not require several * of the tokens that are specifically required by RFC 2327. * Parameters: conf_p The config handle returned by sdp_init_config. - * version_required TRUE or FALSE whether the token should + * version_required TRUE or FALSE whether the token should * be required. * Returns: Nothing. */ @@ -216,15 +181,15 @@ void sdp_require_timespec (void *config_p, tinybool timespec_required) /* Function: sdp_media_supported - * Description: These functions allow the application to specify which - * media types it supports. The application must set any/all + * Description: These functions allow the application to specify which + * media types it supports. The application must set any/all * as required. No media types are supported by default. * Parameters: config_p The config handle returned by sdp_init_config. * nettype The network type for which support is being set. * media_supported TRUE or FALSE whether the support is provided. * Returns: Nothing. */ -void sdp_media_supported (void *config_p, sdp_media_e media_type, +void sdp_media_supported (void *config_p, sdp_media_e media_type, tinybool media_supported) { sdp_conf_options_t *conf_p = (sdp_conf_options_t *)config_p; @@ -238,17 +203,17 @@ void sdp_media_supported (void *config_p, sdp_media_e media_type, /* Function: sdp_nettype_supported - * Description: This function allows the application to specify which - * network types it supports. The application must set + * Description: This function allows the application to specify which + * network types it supports. The application must set * any/all as required. No network types are supported by * default. * Parameters: config_p The config handle returned by sdp_init_config. * nettype The network type for which support is being set. - * nettype_supported TRUE or FALSE whether the support is + * nettype_supported TRUE or FALSE whether the support is * provided. * Returns: Nothing. */ -void sdp_nettype_supported (void *config_p, sdp_nettype_e nettype, +void sdp_nettype_supported (void *config_p, sdp_nettype_e nettype, tinybool nettype_supported) { sdp_conf_options_t *conf_p = (sdp_conf_options_t *)config_p; @@ -262,17 +227,17 @@ void sdp_nettype_supported (void *config_p, sdp_nettype_e nettype, /* Function: sdp_addrtype_supported - * Description: This function allows the application to specify which - * address types it supports. The application must set + * Description: This function allows the application to specify which + * address types it supports. The application must set * any/all as required. No address types are supported by * default. * Parameters: config_p The config handle returned by sdp_init_config. * addrtype The address type for which support is being set. - * addrtype_supported TRUE or FALSE whether the support is + * addrtype_supported TRUE or FALSE whether the support is * provided. * Returns: Nothing. */ -void sdp_addrtype_supported (void *config_p, sdp_addrtype_e addrtype, +void sdp_addrtype_supported (void *config_p, sdp_addrtype_e addrtype, tinybool addrtype_supported) { sdp_conf_options_t *conf_p = (sdp_conf_options_t *)config_p; @@ -286,17 +251,17 @@ void sdp_addrtype_supported (void *config_p, sdp_addrtype_e addrtype, /* Function: sdp_transport_supported - * Description: This function allows the application to specify which - * transport types it supports. The application must set + * Description: This function allows the application to specify which + * transport types it supports. The application must set * any/all as required. No transport types are supported * by default. * Parameters: config_p The config handle returned by sdp_init_config. * transport The transport type for which support is being set. - * transport_supported TRUE or FALSE whether the support is + * transport_supported TRUE or FALSE whether the support is * provided. * Returns: Nothing. */ -void sdp_transport_supported (void *config_p, sdp_transport_e transport, +void sdp_transport_supported (void *config_p, sdp_transport_e transport, tinybool transport_supported) { sdp_conf_options_t *conf_p = (sdp_conf_options_t *)config_p; @@ -310,11 +275,11 @@ void sdp_transport_supported (void *config_p, sdp_transport_e transport, /* Function: sdp_allow_choose - * Description: These functions allow the CHOOSE parameter `$' to be + * Description: These functions allow the CHOOSE parameter `$' to be * specified in place of certain parameters. * Parameters: config_p The config handle returned by sdp_init_config. * param The param that may or may not be CHOOSE. - * choose_allowed TRUE or FALSE whether the CHOOSE parameter + * choose_allowed TRUE or FALSE whether the CHOOSE parameter * should be allowed. * Returns: Nothing. */ @@ -326,7 +291,7 @@ void sdp_allow_choose (void *config_p, sdp_choose_param_e param, tinybool choose return; } - if (param < SDP_MAX_CHOOSE_PARAMS) { + if (param < SDP_MAX_CHOOSE_PARAMS) { conf_p->allow_choose[param] = choose_allowed; } } diff --git a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_main.c b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_main.c index 4553ce5aeb2e..73d62d04c827 100644 --- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_main.c +++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_main.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "sdp_os_defs.h" #include "sdp.h" @@ -66,121 +31,121 @@ const sdp_tokenarray_t sdp_token[SDP_MAX_TOKENS] = /* Note: These *must* be in the same order as the enum types. */ const sdp_attrarray_t sdp_attr[SDP_MAX_ATTR_TYPES] = { - {"bearer", sizeof("bearer"), + {"bearer", sizeof("bearer"), sdp_parse_attr_simple_string, sdp_build_attr_simple_string }, - {"called", sizeof("called"), + {"called", sizeof("called"), sdp_parse_attr_simple_string, sdp_build_attr_simple_string }, - {"connection_type", sizeof("connection_type"), + {"connection_type", sizeof("connection_type"), sdp_parse_attr_simple_string, sdp_build_attr_simple_string }, - {"dialed", sizeof("dialed"), + {"dialed", sizeof("dialed"), sdp_parse_attr_simple_string, sdp_build_attr_simple_string }, - {"dialing", sizeof("dialing"), + {"dialing", sizeof("dialing"), sdp_parse_attr_simple_string, sdp_build_attr_simple_string }, - {"direction", sizeof("direction"), + {"direction", sizeof("direction"), sdp_parse_attr_comediadir, sdp_build_attr_comediadir }, - {"eecid", sizeof("eecid"), + {"eecid", sizeof("eecid"), sdp_parse_attr_simple_u32, sdp_build_attr_simple_u32 }, - {"fmtp", sizeof("fmtp"), + {"fmtp", sizeof("fmtp"), sdp_parse_attr_fmtp, sdp_build_attr_fmtp }, - {"framing", sizeof("framing"), + {"framing", sizeof("framing"), sdp_parse_attr_simple_string, sdp_build_attr_simple_string }, - {"inactive", sizeof("inactive"), + {"inactive", sizeof("inactive"), sdp_parse_attr_direction, sdp_build_attr_direction }, - {"ptime", sizeof("ptime"), + {"ptime", sizeof("ptime"), sdp_parse_attr_simple_u32, sdp_build_attr_simple_u32 }, - {"qos", sizeof("qos"), + {"qos", sizeof("qos"), sdp_parse_attr_qos, sdp_build_attr_qos }, - {"curr", sizeof("curr"), - sdp_parse_attr_curr, sdp_build_attr_curr }, - {"des", sizeof("des"), + {"curr", sizeof("curr"), + sdp_parse_attr_curr, sdp_build_attr_curr }, + {"des", sizeof("des"), sdp_parse_attr_des, sdp_build_attr_des}, - {"conf", sizeof("conf"), + {"conf", sizeof("conf"), sdp_parse_attr_conf, sdp_build_attr_conf}, - {"recvonly", sizeof("recvonly"), + {"recvonly", sizeof("recvonly"), sdp_parse_attr_direction, sdp_build_attr_direction }, - {"rtpmap", sizeof("rtpmap"), + {"rtpmap", sizeof("rtpmap"), sdp_parse_attr_transport_map, sdp_build_attr_transport_map }, - {"secure", sizeof("secure"), + {"secure", sizeof("secure"), sdp_parse_attr_qos, sdp_build_attr_qos }, - {"sendonly", sizeof("sendonly"), + {"sendonly", sizeof("sendonly"), sdp_parse_attr_direction, sdp_build_attr_direction }, - {"sendrecv", sizeof("sendrecv"), + {"sendrecv", sizeof("sendrecv"), sdp_parse_attr_direction, sdp_build_attr_direction }, - {"subnet", sizeof("subnet"), + {"subnet", sizeof("subnet"), sdp_parse_attr_subnet, sdp_build_attr_subnet }, - {"T38FaxVersion", sizeof("T38FaxVersion"), + {"T38FaxVersion", sizeof("T38FaxVersion"), sdp_parse_attr_simple_u32, sdp_build_attr_simple_u32 }, - {"T38MaxBitRate", sizeof("T38MaxBitRate"), + {"T38MaxBitRate", sizeof("T38MaxBitRate"), sdp_parse_attr_simple_u32, sdp_build_attr_simple_u32 }, - {"T38FaxFillBitRemoval", sizeof("T38FaxFillBitRemoval"), + {"T38FaxFillBitRemoval", sizeof("T38FaxFillBitRemoval"), sdp_parse_attr_simple_bool, sdp_build_attr_simple_bool }, - {"T38FaxTranscodingMMR", sizeof("T38FaxTranscodingMMR"), + {"T38FaxTranscodingMMR", sizeof("T38FaxTranscodingMMR"), sdp_parse_attr_simple_bool, sdp_build_attr_simple_bool }, - {"T38FaxTranscodingJBIG", sizeof("T38FaxTranscodingJBIG"), + {"T38FaxTranscodingJBIG", sizeof("T38FaxTranscodingJBIG"), sdp_parse_attr_simple_bool, sdp_build_attr_simple_bool }, - {"T38FaxRateManagement", sizeof("T38FaxRateManagement"), + {"T38FaxRateManagement", sizeof("T38FaxRateManagement"), sdp_parse_attr_t38_ratemgmt, sdp_build_attr_t38_ratemgmt }, - {"T38FaxMaxBuffer", sizeof("T38FaxMaxBuffer"), + {"T38FaxMaxBuffer", sizeof("T38FaxMaxBuffer"), sdp_parse_attr_simple_u32, sdp_build_attr_simple_u32 }, - {"T38FaxMaxDatagram", sizeof("T38FaxMaxDatagram"), + {"T38FaxMaxDatagram", sizeof("T38FaxMaxDatagram"), sdp_parse_attr_simple_u32, sdp_build_attr_simple_u32 }, - {"T38FaxUdpEC", sizeof("T38FaxUdpEC"), + {"T38FaxUdpEC", sizeof("T38FaxUdpEC"), sdp_parse_attr_t38_udpec, sdp_build_attr_t38_udpec }, - {"X-cap", sizeof("X-cap"), + {"X-cap", sizeof("X-cap"), sdp_parse_attr_cap, sdp_build_attr_cap }, - {"X-cpar", sizeof("X-cpar"), + {"X-cpar", sizeof("X-cpar"), sdp_parse_attr_cpar, sdp_build_attr_cpar }, - {"X-pc-codec", sizeof("X-pc-codec"), + {"X-pc-codec", sizeof("X-pc-codec"), sdp_parse_attr_pc_codec, sdp_build_attr_pc_codec }, - {"X-pc-qos", sizeof("X-pc-qos"), + {"X-pc-qos", sizeof("X-pc-qos"), sdp_parse_attr_qos, sdp_build_attr_qos }, - {"X-qos", sizeof("X-qos"), + {"X-qos", sizeof("X-qos"), sdp_parse_attr_qos, sdp_build_attr_qos }, - {"X-sqn", sizeof("X-sqn"), + {"X-sqn", sizeof("X-sqn"), sdp_parse_attr_simple_u32, sdp_build_attr_simple_u32 }, - {"TMRGwXid", sizeof("TMRGwXid"), + {"TMRGwXid", sizeof("TMRGwXid"), sdp_parse_attr_simple_bool, sdp_build_attr_simple_bool }, - {"TC1PayloadBytes", sizeof("TC1PayloadBytes"), + {"TC1PayloadBytes", sizeof("TC1PayloadBytes"), sdp_parse_attr_simple_u32, sdp_build_attr_simple_u32 }, - {"TC1WindowSize", sizeof("TC1WindowSize"), + {"TC1WindowSize", sizeof("TC1WindowSize"), sdp_parse_attr_simple_u32, sdp_build_attr_simple_u32 }, - {"TC2PayloadBytes", sizeof("TC2PayloadBytes"), + {"TC2PayloadBytes", sizeof("TC2PayloadBytes"), sdp_parse_attr_simple_u32, sdp_build_attr_simple_u32 }, - {"TC2WindowSize", sizeof("TC2WindowSize"), + {"TC2WindowSize", sizeof("TC2WindowSize"), sdp_parse_attr_simple_u32, sdp_build_attr_simple_u32 }, - {"rtcp", sizeof("rtcp"), + {"rtcp", sizeof("rtcp"), sdp_parse_attr_simple_u32, sdp_build_attr_simple_u32 }, - {"rtr", sizeof("rtr"), + {"rtr", sizeof("rtr"), sdp_parse_attr_rtr, sdp_build_attr_rtr}, {"silenceSupp", sizeof("silenceSupp"), sdp_parse_attr_silencesupp, sdp_build_attr_silencesupp }, {"X-crypto", sizeof("X-crypto"), sdp_parse_attr_srtpcontext, sdp_build_attr_srtpcontext }, - {"mptime", sizeof("mptime"), + {"mptime", sizeof("mptime"), sdp_parse_attr_mptime, sdp_build_attr_mptime }, - {"X-sidin", sizeof("X-sidin"), + {"X-sidin", sizeof("X-sidin"), sdp_parse_attr_x_sidin, sdp_build_attr_x_sidin }, - {"X-sidout", sizeof("X-sidout"), + {"X-sidout", sizeof("X-sidout"), sdp_parse_attr_x_sidout, sdp_build_attr_x_sidout }, - {"X-confid", sizeof("X-confid"), + {"X-confid", sizeof("X-confid"), sdp_parse_attr_x_confid, sdp_build_attr_x_confid }, - {"group", sizeof("group"), + {"group", sizeof("group"), sdp_parse_attr_group, sdp_build_attr_group }, - {"mid", sizeof("mid"), + {"mid", sizeof("mid"), sdp_parse_attr_simple_u32, sdp_build_attr_simple_u32 }, - {"source-filter", sizeof("source-filter"), + {"source-filter", sizeof("source-filter"), sdp_parse_attr_source_filter, sdp_build_source_filter}, {"rtcp-unicast", sizeof("rtcp-unicast"), sdp_parse_attr_rtcp_unicast, sdp_build_attr_rtcp_unicast}, {"maxprate", sizeof("maxprate"), sdp_parse_attr_maxprate, sdp_build_attr_simple_string}, - {"sqn", sizeof("sqn"), + {"sqn", sizeof("sqn"), sdp_parse_attr_simple_u32, sdp_build_attr_simple_u32 }, - {"cdsc", sizeof("cdsc"), + {"cdsc", sizeof("cdsc"), sdp_parse_attr_cap, sdp_build_attr_cap }, - {"cpar", sizeof("cpar"), + {"cpar", sizeof("cpar"), sdp_parse_attr_cpar, sdp_build_attr_cpar }, - {"sprtmap", sizeof("sprtmap"), + {"sprtmap", sizeof("sprtmap"), sdp_parse_attr_transport_map, sdp_build_attr_transport_map }, {"crypto", sizeof("crypto"), sdp_parse_attr_sdescriptions, sdp_build_attr_sdescriptions }, @@ -387,7 +352,7 @@ const sdp_namearray_t sdp_fmtp_codec_param[SDP_MAX_FMTP_PARAM] = {"PROFILE", sizeof("PROFILE")}, /* 14 */ {"LEVEL", sizeof("LEVEL")}, /* 15 */ {"INTERLACE", sizeof("INTERLACE")}, /* 16 */ - + /* H.264 related */ {"profile-level-id", sizeof("profile-level-id")}, /* 17 */ {"sprop-parameter-sets", sizeof("sprop-parameter-sets")}, /* 18 */ @@ -427,7 +392,7 @@ const sdp_namearray_t sdp_fmtp_codec_param[SDP_MAX_FMTP_PARAM] = {"cbr", sizeof("cbr")}, /* 48 */ {"streams", sizeof("streams")}, /* 49 */ {"protocol", sizeof("protocol")} /* 50 */ - + } ; /* Note: These *must* be in the same order as the enum type. */ @@ -488,15 +453,15 @@ const sdp_srtp_crypto_suite_list sdp_srtp_crypto_suite_array[SDP_SRTP_MAX_NUM_CR SDP_SRTP_F8_128_HMAC_SHA1_80_SALT_BYTES} }; -const char* sdp_result_name[SDP_MAX_RC] = - {"SDP_SUCCESS", - "SDP_FAILURE", - "SDP_INVALID_SDP_PTR", - "SDP_NOT_SDP_DESCRIPTION", - "SDP_INVALID_TOKEN_ORDERING", - "SDP_INVALID_PARAMETER", - "SDP_INVALID_MEDIA_LEVEL", - "SDP_INVALID_CAPABILITY", +const char* sdp_result_name[SDP_MAX_RC] = + {"SDP_SUCCESS", + "SDP_FAILURE", + "SDP_INVALID_SDP_PTR", + "SDP_NOT_SDP_DESCRIPTION", + "SDP_INVALID_TOKEN_ORDERING", + "SDP_INVALID_PARAMETER", + "SDP_INVALID_MEDIA_LEVEL", + "SDP_INVALID_CAPABILITY", "SDP_NO_RESOURCE", "SDP_UNRECOGNIZED_TOKEN", "SDP_NULL_BUF_PTR", @@ -694,7 +659,7 @@ const char *sdp_get_bw_modifier_name (sdp_bw_modifier_e bw_modifier_type) { if (bw_modifier_type == SDP_BW_MODIFIER_UNSUPPORTED) { return (SDP_UNSUPPORTED); - } else if (bw_modifier_type < SDP_BW_MODIFIER_AS || + } else if (bw_modifier_type < SDP_BW_MODIFIER_AS || bw_modifier_type >= SDP_MAX_BW_MODIFIER_VAL) { return ("Invalid bw modifier type"); } else { @@ -740,7 +705,7 @@ const char *sdp_get_rtcp_unicast_mode_name (sdp_rtcp_unicast_mode_e type) * Parameters: sdp_p The SDP structure handle. * Returns: TRUE or FALSE. */ -inline tinybool sdp_verify_sdp_ptr (sdp_t *sdp_p) +inline tinybool sdp_verify_sdp_ptr (sdp_t *sdp_p) { if ((sdp_p != NULL) && (sdp_p->magic_num == SDP_MAGIC_NUM)) { return (TRUE); @@ -752,8 +717,8 @@ inline tinybool sdp_verify_sdp_ptr (sdp_t *sdp_p) /* Function: sdp_init_description * Description: Allocates a new SDP structure that can be used for either - * parsing or building an SDP description. This routine - * saves the config pointer passed in the SDP structure so + * parsing or building an SDP description. This routine + * saves the config pointer passed in the SDP structure so * SDP will know how to parse/build based on the options defined. * An SDP structure must be allocated before parsing or building * since the handle must be passed to these routines. @@ -799,7 +764,7 @@ void *sdp_init_description (void *config_p) sdp_p->bw.bw_data_count = 0; sdp_p->bw.bw_data_list = NULL; - + sdp_p->timespec_p = NULL; sdp_p->sess_attrs_p = NULL; sdp_p->mca_p = NULL; @@ -809,18 +774,18 @@ void *sdp_init_description (void *config_p) for (i=0; i < SDP_MAX_DEBUG_TYPES; i++) { sdp_p->debug_flag[i] = conf_p->debug_flag[i]; } - + return (sdp_p); } /* Function: void sdp_debug(void *sdp_p, sdp_debug_e debug_type, * tinybool my_bool); - * Description: Define the type of debug for this particular SDP structure. + * Description: Define the type of debug for this particular SDP structure. * By default, each SDP description has the settings that are * set for the application. - * Valid debug types are ERRORS, WARNINGS, and TRACE. Each - * debug type can be turned on/off individually. The + * Valid debug types are ERRORS, WARNINGS, and TRACE. Each + * debug type can be turned on/off individually. The * debug level can be redefined at any time. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * debug_type Specifies the debug type being enabled/disabled. @@ -842,12 +807,12 @@ void sdp_debug (void *sdp_ptr, sdp_debug_e debug_type, tinybool debug_flag) /* Function: void sdp_set_string_debug(void *sdp_p, char *debug_str) - * Description: Define a string to be associated with all debug output - * for this SDP. The string will be copied into the SDP - * structure and so the library will not be dependent on + * Description: Define a string to be associated with all debug output + * for this SDP. The string will be copied into the SDP + * structure and so the library will not be dependent on * the application's memory for this string. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. - * debug_str Pointer to a string that should be printed out + * debug_str Pointer to a string that should be printed out * with every debug msg. * Returns: Nothing. */ @@ -866,7 +831,7 @@ void sdp_set_string_debug (void *sdp_ptr, char *debug_str) /* Function: sdp_validate_sdp * Description: Validate an SDP structure. * Parameters: sdp_p The SDP handle of the struct to validate. - * Returns: A result value indicating if the validation was successful. + * Returns: A result value indicating if the validation was successful. * If not, what type of error was encountered. */ sdp_result_e sdp_validate_sdp (sdp_t *sdp_p) @@ -892,7 +857,7 @@ sdp_result_e sdp_validate_sdp (sdp_t *sdp_p) } /* Validate required lines were specified */ - if ((sdp_owner_valid((void *)sdp_p) == FALSE) && + if ((sdp_owner_valid((void *)sdp_p) == FALSE) && (sdp_p->conf_p->owner_reqd == TRUE)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s o= owner line not specified, validation " @@ -901,7 +866,7 @@ sdp_result_e sdp_validate_sdp (sdp_t *sdp_p) return (SDP_FAILURE); } - if ((sdp_session_name_valid((void *)sdp_p) == FALSE) && + if ((sdp_session_name_valid((void *)sdp_p) == FALSE) && (sdp_p->conf_p->session_name_reqd == TRUE)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s s= session name line not specified, validation " @@ -910,7 +875,7 @@ sdp_result_e sdp_validate_sdp (sdp_t *sdp_p) return (SDP_FAILURE); } - if ((sdp_timespec_valid((void *)sdp_p) == FALSE) && + if ((sdp_timespec_valid((void *)sdp_p) == FALSE) && (sdp_p->conf_p->timespec_reqd == TRUE)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s t= timespec line not specified, validation " @@ -925,11 +890,11 @@ sdp_result_e sdp_validate_sdp (sdp_t *sdp_p) /* Function: sdp_parse * Description: Parse an SDP description in the specified buffer. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description - * bufp Pointer to the buffer containing the SDP + * bufp Pointer to the buffer containing the SDP * description to parse. * len The length of the buffer. - * Returns: A result value indicating if the parse was successful and - * if not, what type of error was encountered. The + * Returns: A result value indicating if the parse was successful and + * if not, what type of error was encountered. The * information from the parse is stored in the sdp_p structure. */ sdp_result_e sdp_parse (void *sdp_ptr, char **bufp, u16 len) @@ -962,7 +927,7 @@ sdp_result_e sdp_parse (void *sdp_ptr, char **bufp, u16 len) next_ptr = *bufp; sdp_p->conf_p->num_parses++; - /* Initialize the last valid capability instance to zero. Used + /* Initialize the last valid capability instance to zero. Used * to help in parsing X-cpar attrs. */ sdp_p->cap_valid = FALSE; sdp_p->last_cap_inst = 0; @@ -978,7 +943,7 @@ sdp_result_e sdp_parse (void *sdp_ptr, char **bufp, u16 len) line_end = sdp_findchar(ptr, "\n"); if (line_end >= (*bufp + len)) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - SDP_WARN("%s End of line beyond end of buffer.", + SDP_WARN("%s End of line beyond end of buffer.", sdp_p->debug_str); } end_found = TRUE; @@ -986,14 +951,14 @@ sdp_result_e sdp_parse (void *sdp_ptr, char **bufp, u16 len) } /* Print the line if we're tracing. */ - if ((parse_done == FALSE) && + if ((parse_done == FALSE) && (sdp_p->debug_flag[SDP_DEBUG_TRACE])) { SDP_PRINT("%s ", sdp_p->debug_str); SDP_PRINT("%*s", line_end - ptr, ptr); - + } - + /* Find out which token this line has, if any. */ for (i=0; i < SDP_MAX_TOKENS; i++) { if (strncmp(ptr, sdp_token[i].name, SDP_TOKEN_LEN) == 0) { @@ -1010,14 +975,14 @@ sdp_result_e sdp_parse (void *sdp_ptr, char **bufp, u16 len) if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { SDP_ERROR("%s Attempt to parse text not recognized as " "SDP text, parse fails.", sdp_p->debug_str); - /* If we haven't already printed out the line we + /* If we haven't already printed out the line we * were trying to parse, do it now. */ if (!sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s ", sdp_p->debug_str); SDP_PRINT("%*s", line_end - ptr, ptr); - + } } sdp_p->conf_p->num_not_sdp_desc++; @@ -1040,7 +1005,7 @@ sdp_result_e sdp_parse (void *sdp_ptr, char **bufp, u16 len) end_found = TRUE; } - /* If we've finished parsing and are just looking for the end of + /* If we've finished parsing and are just looking for the end of * the SDP description, we don't need to do anything else here. */ if (parse_done == TRUE) { @@ -1120,14 +1085,14 @@ sdp_result_e sdp_parse (void *sdp_ptr, char **bufp, u16 len) sdp_p->conf_p->num_not_sdp_desc++; return (SDP_NOT_SDP_DESCRIPTION); } - + /* If no errors were found yet, validate the overall sdp. */ if (result == SDP_SUCCESS) { result = sdp_validate_sdp(sdp_p); } /* Return the pointer where we left off. */ *bufp = next_ptr; - /* If the SDP is valid, but the next line following was an + /* If the SDP is valid, but the next line following was an * unrecognized = line, indicate this on the return. */ if ((result == SDP_SUCCESS) && (unrec_token == TRUE)) { return (SDP_UNRECOGNIZED_TOKEN); @@ -1138,21 +1103,17 @@ sdp_result_e sdp_parse (void *sdp_ptr, char **bufp, u16 len) /* Function: sdp_build - * Description: Build an SDP description in the specified buffer based + * Description: Build an SDP description in the specified buffer based * on the information in the given SDP structure. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description - * bufp Pointer to the buffer where the SDP description - * should be built. - * len The maximum length of the SDP/length of the buffer. - * Returns: A result value indicating if the build was successful and - * if not, what type of error was encountered - e.g., + * fs A flex_string where the SDP description should be built. + * Returns: A result value indicating if the build was successful and + * if not, what type of error was encountered - e.g., * description was too long for the given buffer. */ -sdp_result_e sdp_build (void *sdp_ptr, char **bufp, u16 len) +sdp_result_e sdp_build (void *sdp_ptr, flex_string *fs) { int i, j; - char *ptr = NULL; - char *endbuf_p; sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_result_e result = SDP_SUCCESS; @@ -1160,34 +1121,30 @@ sdp_result_e sdp_build (void *sdp_ptr, char **bufp, u16 len) return (SDP_INVALID_SDP_PTR); } - if ((bufp == NULL) || (*bufp == NULL)) { + if (!fs) { return (SDP_NULL_BUF_PTR); } if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Trace SDP Build:", sdp_p->debug_str); } - - ptr = *bufp; + sdp_p->conf_p->num_builds++; - /* Find ptr to the end of the buf for recalculating len remaining. */ - endbuf_p = ptr + len; - for (i=0; ((i < SDP_TOKEN_M) && - (result == SDP_SUCCESS) && (endbuf_p - ptr > 0)); i++) { - result = sdp_token[i].build_func(sdp_p, SDP_SESSION_LEVEL, &ptr, (u16)(endbuf_p - ptr)); + (result == SDP_SUCCESS)); i++) { + result = sdp_token[i].build_func(sdp_p, SDP_SESSION_LEVEL, fs); /* ok not to check buffer space (yet) as the if() checks it */ } /* If the session level was ok, build the media lines. */ - if ((result == SDP_SUCCESS) && (endbuf_p - ptr > 0)) { + if (result == SDP_SUCCESS) { for (i=1; ((i <= sdp_p->mca_count) && - (result == SDP_SUCCESS) && (endbuf_p - ptr > 0)); i++) { - result = sdp_token[SDP_TOKEN_M].build_func(sdp_p, (u16)i, &ptr, (u16)(endbuf_p - ptr)); + (result == SDP_SUCCESS)); i++) { + result = sdp_token[SDP_TOKEN_M].build_func(sdp_p, (u16)i, fs); /* ok not to check buffer space (yet) as the for() checks it */ for (j=SDP_TOKEN_I; - ((j < SDP_TOKEN_M) && (result == SDP_SUCCESS) && (endbuf_p - ptr > 0)); + ((j < SDP_TOKEN_M) && (result == SDP_SUCCESS)); j++) { if ((j == SDP_TOKEN_U) || (j == SDP_TOKEN_E) || (j == SDP_TOKEN_P) || (j == SDP_TOKEN_T) || @@ -1195,25 +1152,12 @@ sdp_result_e sdp_build (void *sdp_ptr, char **bufp, u16 len) /* These tokens not valid at media level. */ continue; } - result = sdp_token[j].build_func(sdp_p, (u16)i, &ptr, (u16)(endbuf_p - ptr)); + result = sdp_token[j].build_func(sdp_p, (u16)i, fs); /* ok not to check buffer space (yet) as the for() checks it */ } } } - /* Return the pointer where we left off. */ - *bufp = ptr; - - if (result == SDP_SUCCESS) { - if ((endbuf_p - ptr) <= 1) { - /* - * The buffer was too small, or just big enough, to hold - * the sdp. Some of the sdp may have gotten dropped. - */ - result = SDP_POTENTIAL_SDP_OVERFLOW; - } - } - return (result); } @@ -1277,10 +1221,10 @@ void *sdp_copy (void *sdp_ptr) orig_sdp_p->default_conn.conn_addr, SDP_MAX_LINE_LEN+1); - new_sdp_p->default_conn.is_multicast = + new_sdp_p->default_conn.is_multicast = orig_sdp_p->default_conn.is_multicast; new_sdp_p->default_conn.ttl = orig_sdp_p->default_conn.ttl; - new_sdp_p->default_conn.num_of_addresses + new_sdp_p->default_conn.num_of_addresses = orig_sdp_p->default_conn.num_of_addresses; new_sdp_p->encrypt.encrypt_type = orig_sdp_p->encrypt.encrypt_type; sstrncpy(new_sdp_p->encrypt.encrypt_key, @@ -1293,7 +1237,7 @@ void *sdp_copy (void *sdp_ptr) sdp_free_description(new_sdp_p); return (NULL); } - + /* Copy timespec structures. */ orig_time_p = orig_sdp_p->timespec_p; while (orig_time_p != NULL) { @@ -1438,8 +1382,8 @@ void *sdp_copy (void *sdp_ptr) /* Function: sdp_free_description * Description: Free an SDP description and all memory associated with it. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description - * Returns: A result value indicating if the free was successful and - * if not, what type of error was encountered - e.g., sdp_p + * Returns: A result value indicating if the free was successful and + * if not, what type of error was encountered - e.g., sdp_p * was invalid and didn't point to an SDP structure. */ sdp_result_e sdp_free_description (void *sdp_ptr) @@ -1469,7 +1413,7 @@ sdp_result_e sdp_free_description (void *sdp_ptr) bw_data_p = bw_p->bw_data_list; while (bw_data_p != NULL) { bw_p->bw_data_list = bw_data_p->next_p; - SDP_FREE(bw_data_p); + SDP_FREE(bw_data_p); bw_data_p = bw_p->bw_data_list; } @@ -1503,7 +1447,7 @@ sdp_result_e sdp_free_description (void *sdp_ptr) bw_data_p = bw_p->bw_data_list; while (bw_data_p != NULL) { bw_p->bw_data_list = bw_data_p->next_p; - SDP_FREE(bw_data_p); + SDP_FREE(bw_data_p); bw_data_p = bw_p->bw_data_list; } diff --git a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_os_defs.h b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_os_defs.h index 64436c87452a..9a91561297d4 100644 --- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_os_defs.h +++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_os_defs.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _SDP_OS_DEFS_H_ #define _SDP_OS_DEFS_H_ @@ -64,7 +29,7 @@ typedef int32_t int32; typedef int16_t int16; typedef unsigned short ushort; typedef unsigned long ulong; -#define inline +#define inline #endif /* _SDP_OS_DEFS_H_ */ diff --git a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_private.h b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_private.h index abcf46c0ae53..c12295001c92 100644 --- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_private.h +++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_private.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _SDP_PRIVATE_H_ #define _SDP_PRIVATE_H_ @@ -46,7 +11,6 @@ /* SDP Defines */ #define SDP_MAX_STRING_LEN 256 /* Max len for SDP string */ -#define SDP_MAX_CANDIDATE_LEN 256 /* Max len for SDP string */ #define SDP_MAX_SHORT_STRING_LEN 12 /* Max len for a short SDP string */ #define SDP_MAX_PAYLOAD_TYPES 23 /* Max payload types in m= line */ #define SDP_TOKEN_LEN 2 /* Len of = */ @@ -125,7 +89,7 @@ typedef struct sdp_encryptspec { } sdp_encryptspec_t; -/* FMTP attribute deals with named events in the range of 0-255 as +/* FMTP attribute deals with named events in the range of 0-255 as * defined in RFC 2833 */ #define SDP_MIN_NE_VALUE 0 #define SDP_MAX_NE_VALUES 256 @@ -150,9 +114,9 @@ typedef struct sdp_fmtp { tinybool annexa; tinybool annexb; - u32 bitrate; - u32 mode; - + u32 bitrate; + u32 mode; + /* some OPUS specific fmtp params */ u32 maxaveragebitrate; u16 usedtx; @@ -177,10 +141,10 @@ typedef struct sdp_fmtp { u16 custom_y; u16 custom_mpi; /* CUSTOM=360,240,4 implies X-AXIS=360, Y-AXIS=240; MPI=4 */ - u16 par_width; - u16 par_height; + u16 par_width; + u16 par_height; /* PAR=12:11 implies par_width=12, par_height=11 */ - + /* CPCF should be a float. IOS does not support float and so it is u16 */ /* For portable stack, CPCF should be defined as float and the parsing should * be modified accordingly */ @@ -214,14 +178,14 @@ typedef struct sdp_fmtp { tinybool annex_d; - tinybool annex_f; - tinybool annex_i; - tinybool annex_j; + tinybool annex_f; + tinybool annex_i; + tinybool annex_j; tinybool annex_t; - /* H.263 codec requires annex K,N and P to have values */ - u16 annex_k_val; - u16 annex_n_val; + /* H.263 codec requires annex K,N and P to have values */ + u16 annex_k_val; + u16 annex_n_val; /* Annex P can take one or more values in the range 1-4 . e.g P=1,3 */ u16 annex_p_val_picture_resize; /* 1 = four; 2 = sixteenth */ @@ -394,12 +358,12 @@ typedef struct sdp_media_profiles { * This type is used to hold cryptographic context information. * */ - + typedef struct sdp_srtp_crypto_context_t_ { int32 tag; unsigned long selection_flags; sdp_srtp_crypto_suite_t suite; - unsigned char master_key[SDP_SRTP_MAX_KEY_SIZE_BYTES]; + unsigned char master_key[SDP_SRTP_MAX_KEY_SIZE_BYTES]; unsigned char master_salt[SDP_SRTP_MAX_SALT_SIZE_BYTES]; unsigned char master_key_size_bytes; unsigned char master_salt_size_bytes; @@ -416,7 +380,7 @@ typedef struct sdp_srtp_crypto_context_t_ { /* m= line info and associated attribute list */ -/* Note: Most of the port parameter values are 16-bit values. We set +/* Note: Most of the port parameter values are 16-bit values. We set * the type to int32 so we can return either a 16-bit value or the * choose value. */ typedef struct sdp_mca { @@ -453,7 +417,7 @@ typedef struct sdp_attr { tinybool boolean_val; u32 u32_val; char string_val[SDP_MAX_STRING_LEN+1]; - char ice_attr[SDP_MAX_CANDIDATE_LEN]; + char ice_attr[SDP_MAX_STRING_LEN+1]; sdp_fmtp_t fmtp; sdp_qos_t qos; sdp_curr_t curr; @@ -465,14 +429,14 @@ typedef struct sdp_attr { sdp_t38_udpec_e t38udpec; sdp_pccodec_t pccodec; sdp_silencesupp_t silencesupp; - sdp_mca_t *cap_p; /* A X-CAP or CDSC attribute */ + sdp_mca_t *cap_p; /* A X-CAP or CDSC attribute */ sdp_rtr_t rtr; - sdp_comediadir_t comediadir; + sdp_comediadir_t comediadir; sdp_srtp_crypto_context_t srtp_context; sdp_mptime_t mptime; sdp_stream_data_t stream_data; char unknown[SDP_MAX_STRING_LEN+1]; - sdp_source_filter_t source_filter; + sdp_source_filter_t source_filter; } attr; struct sdp_attr *next_p; } sdp_attr_t; @@ -541,7 +505,7 @@ typedef struct { u16 last_cap_inst; /* Info to help building X-cpar/cpar attrs. */ sdp_attr_e last_cap_type; - + /* MCA - Media, connection, and attributes */ sdp_mca_t *mca_p; ushort mca_count; @@ -552,7 +516,7 @@ typedef struct { typedef struct { char *name; sdp_result_e (*parse_func)(sdp_t *sdp_p, u16 level, const char *ptr); - sdp_result_e (*build_func)(sdp_t *sdp_p, u16 level, char **ptr, u16 len); + sdp_result_e (*build_func)(sdp_t *sdp_p, u16 level, flex_string *fs); } sdp_tokenarray_t; @@ -560,10 +524,10 @@ typedef struct { typedef struct { char *name; u16 strlen; - sdp_result_e (*parse_func)(sdp_t *sdp_p, sdp_attr_t *attr_p, + sdp_result_e (*parse_func)(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); - sdp_result_e (*build_func)(sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len); + sdp_result_e (*build_func)(sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs); } sdp_attrarray_t; @@ -592,7 +556,7 @@ extern const sdp_namearray_t sdp_silencesupp_siduse[]; extern const sdp_namearray_t sdp_srtp_context_crypto_suite[]; extern const sdp_namearray_t sdp_bw_modifier_val[]; extern const sdp_namearray_t sdp_group_attr_val[]; -extern const sdp_namearray_t sdp_src_filter_mode_val[]; +extern const sdp_namearray_t sdp_src_filter_mode_val[]; extern const sdp_namearray_t sdp_rtcp_unicast_mode_val[]; extern const sdp_srtp_crypto_suite_list sdp_srtp_crypto_suite_array[]; @@ -603,144 +567,144 @@ extern sdp_mca_t *sdp_find_media_level(sdp_t *sdp_p, u16 level); extern sdp_bw_data_t* sdp_find_bw_line (void *sdp_ptr, u16 level, u16 inst_num); /* sdp_attr.c */ -extern sdp_result_e sdp_parse_attribute(sdp_t *sdp_p, u16 level, +extern sdp_result_e sdp_parse_attribute(sdp_t *sdp_p, u16 level, const char *ptr); -extern sdp_result_e sdp_parse_attr_simple_string(sdp_t *sdp_p, +extern sdp_result_e sdp_parse_attr_simple_string(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); -extern sdp_result_e sdp_build_attr_simple_string(sdp_t *sdp_p, - sdp_attr_t *attr_p, char **ptr, u16 len); -extern sdp_result_e sdp_parse_attr_simple_u32(sdp_t *sdp_p, +extern sdp_result_e sdp_build_attr_simple_string(sdp_t *sdp_p, + sdp_attr_t *attr_p, flex_string *fs); +extern sdp_result_e sdp_parse_attr_simple_u32(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); -extern sdp_result_e sdp_build_attr_simple_u32(sdp_t *sdp_p, - sdp_attr_t *attr_p, char **ptr, u16 len); -extern sdp_result_e sdp_parse_attr_simple_bool(sdp_t *sdp_p, +extern sdp_result_e sdp_build_attr_simple_u32(sdp_t *sdp_p, + sdp_attr_t *attr_p, flex_string *fs); +extern sdp_result_e sdp_parse_attr_simple_bool(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); -extern sdp_result_e sdp_build_attr_simple_bool(sdp_t *sdp_p, - sdp_attr_t *attr_p, char **ptr, u16 len); -extern sdp_result_e sdp_parse_attr_maxprate(sdp_t *sdp_p, sdp_attr_t *attr_p, +extern sdp_result_e sdp_build_attr_simple_bool(sdp_t *sdp_p, + sdp_attr_t *attr_p, flex_string *fs); +extern sdp_result_e sdp_parse_attr_maxprate(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); -extern sdp_result_e sdp_parse_attr_fmtp(sdp_t *sdp_p, sdp_attr_t *attr_p, +extern sdp_result_e sdp_parse_attr_fmtp(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); -extern sdp_result_e sdp_build_attr_fmtp(sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len); +extern sdp_result_e sdp_build_attr_fmtp(sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs); extern sdp_result_e sdp_parse_attr_direction(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_build_attr_direction(sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len); -extern sdp_result_e sdp_parse_attr_qos(sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs); +extern sdp_result_e sdp_parse_attr_qos(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); -extern sdp_result_e sdp_build_attr_qos(sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len); -extern sdp_result_e sdp_parse_attr_curr(sdp_t *sdp_p, sdp_attr_t *attr_p, +extern sdp_result_e sdp_build_attr_qos(sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs); +extern sdp_result_e sdp_parse_attr_curr(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); -extern sdp_result_e sdp_build_attr_curr (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len); -extern sdp_result_e sdp_parse_attr_des(sdp_t *sdp_p, sdp_attr_t *attr_p, +extern sdp_result_e sdp_build_attr_curr (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs); +extern sdp_result_e sdp_parse_attr_des(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); -extern sdp_result_e sdp_build_attr_des (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len); -extern sdp_result_e sdp_parse_attr_conf(sdp_t *sdp_p, sdp_attr_t *attr_p, +extern sdp_result_e sdp_build_attr_des (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs); +extern sdp_result_e sdp_parse_attr_conf(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); -extern sdp_result_e sdp_build_attr_conf (sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len); -extern sdp_result_e sdp_parse_attr_transport_map(sdp_t *sdp_p, +extern sdp_result_e sdp_build_attr_conf (sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs); +extern sdp_result_e sdp_parse_attr_transport_map(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); -extern sdp_result_e sdp_build_attr_transport_map(sdp_t *sdp_p, - sdp_attr_t *attr_p, char **ptr, u16 len); -extern sdp_result_e sdp_parse_attr_subnet(sdp_t *sdp_p, sdp_attr_t *attr_p, +extern sdp_result_e sdp_build_attr_transport_map(sdp_t *sdp_p, + sdp_attr_t *attr_p, flex_string *fs); +extern sdp_result_e sdp_parse_attr_subnet(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); -extern sdp_result_e sdp_build_attr_subnet(sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len); -extern sdp_result_e sdp_parse_attr_t38_ratemgmt(sdp_t *sdp_p, +extern sdp_result_e sdp_build_attr_subnet(sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs); +extern sdp_result_e sdp_parse_attr_t38_ratemgmt(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); -extern sdp_result_e sdp_build_attr_t38_ratemgmt(sdp_t *sdp_p, - sdp_attr_t *attr_p, char **ptr, u16 len); +extern sdp_result_e sdp_build_attr_t38_ratemgmt(sdp_t *sdp_p, + sdp_attr_t *attr_p, flex_string *fs); extern sdp_result_e sdp_parse_attr_t38_udpec(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_build_attr_t38_udpec(sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len); -extern sdp_result_e sdp_parse_attr_cap(sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs); +extern sdp_result_e sdp_parse_attr_cap(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); -extern sdp_result_e sdp_build_attr_cap(sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len); -extern sdp_result_e sdp_parse_attr_cpar(sdp_t *sdp_p, sdp_attr_t *attr_p, +extern sdp_result_e sdp_build_attr_cap(sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs); +extern sdp_result_e sdp_parse_attr_cpar(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); -extern sdp_result_e sdp_build_attr_cpar(sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len); -extern sdp_result_e sdp_parse_attr_pc_codec(sdp_t *sdp_p, sdp_attr_t *attr_p, +extern sdp_result_e sdp_build_attr_cpar(sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs); +extern sdp_result_e sdp_parse_attr_pc_codec(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); -extern sdp_result_e sdp_build_attr_pc_codec(sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len); -extern sdp_result_e sdp_parse_attr_xcap(sdp_t *sdp_p, sdp_attr_t *attr_p, +extern sdp_result_e sdp_build_attr_pc_codec(sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs); +extern sdp_result_e sdp_parse_attr_xcap(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); -extern sdp_result_e sdp_build_attr_xcap(sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len); -extern sdp_result_e sdp_parse_attr_xcpar(sdp_t *sdp_p, sdp_attr_t *attr_p, +extern sdp_result_e sdp_build_attr_xcap(sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs); +extern sdp_result_e sdp_parse_attr_xcpar(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); -extern sdp_result_e sdp_build_attr_xcpar(sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len); -extern sdp_result_e sdp_parse_attr_rtr(sdp_t *sdp_p, sdp_attr_t *attr_p, +extern sdp_result_e sdp_build_attr_xcpar(sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs); +extern sdp_result_e sdp_parse_attr_rtr(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); -extern sdp_result_e sdp_build_attr_rtr(sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len); +extern sdp_result_e sdp_build_attr_rtr(sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs); extern sdp_result_e sdp_parse_attr_comediadir(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_build_attr_comediadir(sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len); + flex_string *fs); extern sdp_result_e sdp_parse_attr_silencesupp(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_build_attr_silencesupp(sdp_t *sdp_p, - sdp_attr_t *attr_p, - char **ptr, u16 len); + sdp_attr_t *attr_p, + flex_string *fs); extern sdp_result_e sdp_parse_attr_srtpcontext(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_build_attr_srtpcontext(sdp_t *sdp_p, - sdp_attr_t *attr_p, - char **ptr, u16 len); + sdp_attr_t *attr_p, + flex_string *fs); extern sdp_result_e sdp_parse_attr_mptime( sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_build_attr_mptime( - sdp_t *sdp_p, sdp_attr_t *attr_p, char **ptr, u16 len); + sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs); extern sdp_result_e sdp_parse_attr_x_sidin( sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_build_attr_x_sidin( - sdp_t *sdp_p, sdp_attr_t *attr_p, char **ptr, u16 len); + sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs); extern sdp_result_e sdp_parse_attr_x_sidout( sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_build_attr_x_sidout( - sdp_t *sdp_p, sdp_attr_t *attr_p, char **ptr, u16 len); + sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs); extern sdp_result_e sdp_parse_attr_x_confid( sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_build_attr_x_confid( - sdp_t *sdp_p, sdp_attr_t *attr_p, char **ptr, u16 len); + sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs); extern sdp_result_e sdp_parse_attr_group( sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_build_attr_group( - sdp_t *sdp_p, sdp_attr_t *attr_p, char **ptr, u16 len); + sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs); extern sdp_result_e sdp_parse_attr_source_filter( sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_build_source_filter( - sdp_t *sdp_p, sdp_attr_t *attr_p, char **ptr, u16 len); + sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs); extern sdp_result_e sdp_parse_attr_rtcp_unicast( sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_build_attr_rtcp_unicast( - sdp_t *sdp_p, sdp_attr_t *attr_p, char **ptr, u16 len); + sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs); extern sdp_result_e sdp_build_attr_ice_attr ( - sdp_t *sdp_p, sdp_attr_t *attr_p, char **ptr, u16 len); + sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs); extern sdp_result_e sdp_parse_attr_ice_attr ( sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_build_attr_rtcp_mux_attr ( - sdp_t *sdp_p, sdp_attr_t *attr_p, char **ptr, u16 len); + sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs); extern sdp_result_e sdp_parse_attr_rtcp_mux_attr ( sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_parse_attr_fingerprint_attr ( @@ -748,7 +712,7 @@ extern sdp_result_e sdp_parse_attr_fingerprint_attr ( /* sdp_attr_access.c */ extern void sdp_free_attr(sdp_attr_t *attr_p); -extern sdp_result_e sdp_find_attr_list(sdp_t *sdp_p, u16 level, u8 cap_num, +extern sdp_result_e sdp_find_attr_list(sdp_t *sdp_p, u16 level, u8 cap_num, sdp_attr_t **attr_p, char *fname); extern sdp_attr_t *sdp_find_attr(sdp_t *sdp_p, u16 level, u8 cap_num, sdp_attr_e attr_type, u16 inst_num); @@ -787,98 +751,83 @@ extern tinybool sdp_verify_sdp_ptr(sdp_t *sdp_p); /* sdp_tokens.c */ -extern sdp_result_e sdp_parse_version(sdp_t *sdp_p, u16 token, +extern sdp_result_e sdp_parse_version(sdp_t *sdp_p, u16 token, const char *ptr); -extern sdp_result_e sdp_build_version(sdp_t *sdp_p, u16 token, char **ptr, - u16 len); -extern sdp_result_e sdp_parse_owner(sdp_t *sdp_p, u16 token, +extern sdp_result_e sdp_build_version(sdp_t *sdp_p, u16 token, flex_string *fs); +extern sdp_result_e sdp_parse_owner(sdp_t *sdp_p, u16 token, const char *ptr); -extern sdp_result_e sdp_build_owner(sdp_t *sdp_p, u16 token, char **ptr, - u16 len); -extern sdp_result_e sdp_parse_sessname(sdp_t *sdp_p, u16 token, +extern sdp_result_e sdp_build_owner(sdp_t *sdp_p, u16 token, flex_string *fs); +extern sdp_result_e sdp_parse_sessname(sdp_t *sdp_p, u16 token, const char *ptr); -extern sdp_result_e sdp_build_sessname(sdp_t *sdp_p, u16 token, char **ptr, - u16 len); -extern sdp_result_e sdp_parse_sessinfo(sdp_t *sdp_p, u16 token, +extern sdp_result_e sdp_build_sessname(sdp_t *sdp_p, u16 token, flex_string *fs); +extern sdp_result_e sdp_parse_sessinfo(sdp_t *sdp_p, u16 token, const char *ptr); -extern sdp_result_e sdp_build_sessinfo(sdp_t *sdp_p, u16 token, char **ptr, - u16 len); +extern sdp_result_e sdp_build_sessinfo(sdp_t *sdp_p, u16 token, flex_string *fs); extern sdp_result_e sdp_parse_uri(sdp_t *sdp_p, u16 token, const char *ptr); -extern sdp_result_e sdp_build_uri(sdp_t *sdp_p, u16 token, char **ptr, - u16 len); +extern sdp_result_e sdp_build_uri(sdp_t *sdp_p, u16 token, flex_string *fs); extern sdp_result_e sdp_parse_email(sdp_t *sdp_p, u16 token, const char *ptr); -extern sdp_result_e sdp_build_email(sdp_t *sdp_p, u16 token, char **ptr, - u16 len); -extern sdp_result_e sdp_parse_phonenum(sdp_t *sdp_p, u16 token, +extern sdp_result_e sdp_build_email(sdp_t *sdp_p, u16 token, flex_string *fs); +extern sdp_result_e sdp_parse_phonenum(sdp_t *sdp_p, u16 token, const char *ptr); -extern sdp_result_e sdp_build_phonenum(sdp_t *sdp_p, u16 token, char **ptr, - u16 len); -extern sdp_result_e sdp_parse_connection(sdp_t *sdp_p, u16 token, +extern sdp_result_e sdp_build_phonenum(sdp_t *sdp_p, u16 token, flex_string *fs); +extern sdp_result_e sdp_parse_connection(sdp_t *sdp_p, u16 token, const char *ptr); -extern sdp_result_e sdp_build_connection(sdp_t *sdp_p, u16 token, char **ptr, - u16 len); -extern sdp_result_e sdp_parse_bandwidth(sdp_t *sdp_p, u16 token, +extern sdp_result_e sdp_build_connection(sdp_t *sdp_p, u16 token, flex_string *fs); +extern sdp_result_e sdp_parse_bandwidth(sdp_t *sdp_p, u16 token, const char *ptr); -extern sdp_result_e sdp_build_bandwidth(sdp_t *sdp_p, u16 token, char **ptr, - u16 len); -extern sdp_result_e sdp_parse_timespec(sdp_t *sdp_p, u16 token, +extern sdp_result_e sdp_build_bandwidth(sdp_t *sdp_p, u16 token, flex_string *fs); +extern sdp_result_e sdp_parse_timespec(sdp_t *sdp_p, u16 token, const char *ptr); -extern sdp_result_e sdp_build_timespec(sdp_t *sdp_p, u16 token, char **ptr, - u16 len); -extern sdp_result_e sdp_parse_repeat_time(sdp_t *sdp_p, u16 token, +extern sdp_result_e sdp_build_timespec(sdp_t *sdp_p, u16 token, flex_string *fs); +extern sdp_result_e sdp_parse_repeat_time(sdp_t *sdp_p, u16 token, const char *ptr); -extern sdp_result_e sdp_build_repeat_time(sdp_t *sdp_p, u16 token, char **ptr, - u16 len); -extern sdp_result_e sdp_parse_timezone_adj(sdp_t *sdp_p, u16 token, +extern sdp_result_e sdp_build_repeat_time(sdp_t *sdp_p, u16 token, flex_string *fs); +extern sdp_result_e sdp_parse_timezone_adj(sdp_t *sdp_p, u16 token, const char *ptr); -extern sdp_result_e sdp_build_timezone_adj(sdp_t *sdp_p, u16 token, char **ptr, - u16 len); -extern sdp_result_e sdp_parse_encryption(sdp_t *sdp_p, u16 token, +extern sdp_result_e sdp_build_timezone_adj(sdp_t *sdp_p, u16 token, flex_string *fs); +extern sdp_result_e sdp_parse_encryption(sdp_t *sdp_p, u16 token, const char *ptr); -extern sdp_result_e sdp_build_encryption(sdp_t *sdp_p, u16 token, char **ptr, - u16 len); +extern sdp_result_e sdp_build_encryption(sdp_t *sdp_p, u16 token, flex_string *fs); extern sdp_result_e sdp_parse_media(sdp_t *sdp_p, u16 token, const char *ptr); -extern sdp_result_e sdp_build_media(sdp_t *sdp_p, u16 token, char **ptr, - u16 len); -extern sdp_result_e sdp_parse_attribute(sdp_t *sdp_p, u16 token, +extern sdp_result_e sdp_build_media(sdp_t *sdp_p, u16 token, flex_string *fs); +extern sdp_result_e sdp_parse_attribute(sdp_t *sdp_p, u16 token, const char *ptr); -extern sdp_result_e sdp_build_attribute(sdp_t *sdp_p, u16 token, char **ptr, - u16 len); +extern sdp_result_e sdp_build_attribute(sdp_t *sdp_p, u16 token, flex_string *fs); -extern void sdp_parse_payload_types(sdp_t *sdp_p, sdp_mca_t *mca_p, +extern void sdp_parse_payload_types(sdp_t *sdp_p, sdp_mca_t *mca_p, const char *ptr); -extern sdp_result_e sdp_parse_multiple_profile_payload_types(sdp_t *sdp_p, - sdp_mca_t *mca_p, +extern sdp_result_e sdp_parse_multiple_profile_payload_types(sdp_t *sdp_p, + sdp_mca_t *mca_p, const char *ptr); -extern sdp_result_e +extern sdp_result_e sdp_parse_attr_sdescriptions(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); - + extern sdp_result_e -sdp_build_attr_sdescriptions(sdp_t *sdp_p, sdp_attr_t *attr_p, - char **ptr, u16 len); - +sdp_build_attr_sdescriptions(sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs); + /* sdp_utils.c */ extern sdp_mca_t *sdp_alloc_mca(void); extern tinybool sdp_validate_maxprate(const char *string_parm); extern char *sdp_findchar(const char *ptr, char *char_list); -extern const char *sdp_getnextstrtok(const char *str, char *tokenstr, unsigned tokenstr_len, +extern const char *sdp_getnextstrtok(const char *str, char *tokenstr, unsigned tokenstr_len, const char *delim, sdp_result_e *result); -extern u32 sdp_getnextnumtok(const char *str, const char **str_end, +extern u32 sdp_getnextnumtok(const char *str, const char **str_end, const char *delim, sdp_result_e *result); -extern u32 sdp_getnextnumtok_or_null(const char *str, const char **str_end, +extern u32 sdp_getnextnumtok_or_null(const char *str, const char **str_end, const char *delim, tinybool *null_ind, sdp_result_e *result); -extern tinybool sdp_getchoosetok(const char *str, const char **str_end, +extern tinybool sdp_getchoosetok(const char *str, const char **str_end, const char *delim, sdp_result_e *result); -extern +extern tinybool verify_sdescriptions_mki(char *buf, char *mkiVal, u16 *mkiLen); extern tinybool verify_sdescriptions_lifetime(char *buf); - + /* sdp_services_xxx.c */ extern void sdp_log_errmsg(sdp_errmsg_e err_msg, char *str); extern void sdp_dump_buffer(char *_ptr, int _size_bytes); diff --git a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_services_unix.c b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_services_unix.c index d80c30721a96..585492ac1fcf 100755 --- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_services_unix.c +++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_services_unix.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "sdp_os_defs.h" #include "sdp.h" diff --git a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_services_win32.c b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_services_win32.c index d80c30721a96..585492ac1fcf 100755 --- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_services_win32.c +++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_services_win32.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "sdp_os_defs.h" #include "sdp.h" diff --git a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_token.c b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_token.c index a90ac5120125..ee347b50a9b3 100644 --- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_token.c +++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_token.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include @@ -62,7 +27,7 @@ sdp_result_e sdp_parse_version (sdp_t *sdp_p, u16 level, const char *ptr) sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } - + if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Parse version line successful, version %u", sdp_p->debug_str, (u16)sdp_p->version); @@ -70,10 +35,8 @@ sdp_result_e sdp_parse_version (sdp_t *sdp_p, u16 level, const char *ptr) return (SDP_SUCCESS); } -sdp_result_e sdp_build_version (sdp_t *sdp_p, u16 level, char **ptr, u16 len) +sdp_result_e sdp_build_version (sdp_t *sdp_p, u16 level, flex_string *fs) { - char *endbuf_p = *ptr + len; - if (sdp_p->version == SDP_INVALID_VALUE) { if (sdp_p->conf_p->version_reqd == TRUE) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -87,7 +50,8 @@ sdp_result_e sdp_build_version (sdp_t *sdp_p, u16 level, char **ptr, u16 len) return (SDP_SUCCESS); } } - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "v=%u\r\n", (u16)sdp_p->version); + + flex_string_sprintf(fs, "v=%u\r\n", (u16)sdp_p->version); if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Built v= version line", sdp_p->debug_str); @@ -121,7 +85,7 @@ sdp_result_e sdp_parse_owner (sdp_t *sdp_p, u16 level, const char *ptr) return (SDP_INVALID_PARAMETER); } - /* Find the owner session id. This is a numeric field but is + /* Find the owner session id. This is a numeric field but is * stored as a string since it may be 64 bit. */ ptr = sdp_getnextstrtok(ptr, sdp_p->owner_sessid, sizeof(sdp_p->owner_sessid), " \t", &result); @@ -129,7 +93,7 @@ sdp_result_e sdp_parse_owner (sdp_t *sdp_p, u16 level, const char *ptr) /* Make sure the sessid is numeric, even though we store it as * a string. */ - (void)sdp_getnextnumtok(sdp_p->owner_sessid, + (void)sdp_getnextnumtok(sdp_p->owner_sessid, (const char **)&tmpptr, " \t",&result); } if (result != SDP_SUCCESS) { @@ -147,7 +111,7 @@ sdp_result_e sdp_parse_owner (sdp_t *sdp_p, u16 level, const char *ptr) /* Make sure the version is numeric, even though we store it as * a string. */ - (void)sdp_getnextnumtok(sdp_p->owner_version, + (void)sdp_getnextnumtok(sdp_p->owner_version, (const char **)&tmpptr," \t",&result); } if (result != SDP_SUCCESS) { @@ -180,7 +144,7 @@ sdp_result_e sdp_parse_owner (sdp_t *sdp_p, u16 level, const char *ptr) } if (sdp_p->owner_network_type == SDP_NT_UNSUPPORTED) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - SDP_ERROR("%s Owner network type unsupported (%s)", + SDP_ERROR("%s Owner network type unsupported (%s)", sdp_p->debug_str, tmp); } sdp_p->conf_p->num_invalid_param++; @@ -209,7 +173,7 @@ sdp_result_e sdp_parse_owner (sdp_t *sdp_p, u16 level, const char *ptr) if ((sdp_p->owner_addr_type == SDP_AT_UNSUPPORTED) && (sdp_p->owner_network_type != SDP_NT_ATM)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - SDP_ERROR("%s Owner address type unsupported (%s)", + SDP_ERROR("%s Owner address type unsupported (%s)", sdp_p->debug_str, tmp); } sdp_p->conf_p->num_invalid_param++; @@ -227,8 +191,8 @@ sdp_result_e sdp_parse_owner (sdp_t *sdp_p, u16 level, const char *ptr) } if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { - SDP_PRINT("%s Parse owner: name %s, session id %s, version %s", - sdp_p->debug_str, sdp_p->owner_name, sdp_p->owner_sessid, + SDP_PRINT("%s Parse owner: name %s, session id %s, version %s", + sdp_p->debug_str, sdp_p->owner_name, sdp_p->owner_sessid, sdp_p->owner_version); SDP_PRINT("%s network %s, address type %s, " "address %s", sdp_p->debug_str, @@ -239,21 +203,19 @@ sdp_result_e sdp_parse_owner (sdp_t *sdp_p, u16 level, const char *ptr) return (SDP_SUCCESS); } -sdp_result_e sdp_build_owner (sdp_t *sdp_p, u16 level, char **ptr, u16 len) +sdp_result_e sdp_build_owner (sdp_t *sdp_p, u16 level, flex_string *fs) { - char *endbuf_p = *ptr + len; - if ((sdp_p->owner_name[0] == '\0') || (sdp_p->owner_network_type >= SDP_MAX_NETWORK_TYPES) || (sdp_p->owner_addr_type >= SDP_MAX_ADDR_TYPES) || (sdp_p->owner_addr[0] == '\0')) { - + if((sdp_p->owner_network_type == SDP_NT_ATM) && (sdp_p->owner_addr_type == SDP_AT_INVALID)) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "o=%s %s %s %s - -\r\n", + flex_string_sprintf(fs, "o=%s %s %s %s - -\r\n", sdp_p->owner_name, sdp_p->owner_sessid, - sdp_p->owner_version, - sdp_get_network_name(sdp_p->owner_network_type)); + sdp_p->owner_version, + sdp_get_network_name(sdp_p->owner_network_type)); } if (sdp_p->conf_p->owner_reqd == TRUE) { @@ -269,9 +231,9 @@ sdp_result_e sdp_build_owner (sdp_t *sdp_p, u16 level, char **ptr, u16 len) } } - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "o=%s %s %s %s %s %s\r\n", + flex_string_sprintf(fs, "o=%s %s %s %s %s %s\r\n", sdp_p->owner_name, sdp_p->owner_sessid, - sdp_p->owner_version, + sdp_p->owner_version, sdp_get_network_name(sdp_p->owner_network_type), sdp_get_address_name(sdp_p->owner_addr_type), sdp_p->owner_addr); @@ -298,7 +260,7 @@ sdp_result_e sdp_parse_sessname (sdp_t *sdp_p, u16 level, const char *ptr) endptr = sdp_findchar(ptr, "\r\n"); if (ptr == endptr) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - SDP_WARN("%s Warning: No session name specified.", + SDP_WARN("%s Warning: No session name specified.", sdp_p->debug_str); } } @@ -306,16 +268,14 @@ sdp_result_e sdp_parse_sessname (sdp_t *sdp_p, u16 level, const char *ptr) sstrncpy(sdp_p->sessname, ptr, str_len+1); if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { - SDP_PRINT("%s Parse session name, %s", + SDP_PRINT("%s Parse session name, %s", sdp_p->debug_str, sdp_p->sessname); } return (SDP_SUCCESS); } -sdp_result_e sdp_build_sessname (sdp_t *sdp_p, u16 level, char **ptr, u16 len) +sdp_result_e sdp_build_sessname (sdp_t *sdp_p, u16 level, flex_string *fs) { - char *endbuf_p = *ptr + len; - if (sdp_p->sessname[0] == '\0') { if (sdp_p->conf_p->session_name_reqd == TRUE) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { @@ -330,7 +290,7 @@ sdp_result_e sdp_build_sessname (sdp_t *sdp_p, u16 level, char **ptr, u16 len) } } - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "s=%s\r\n", sdp_p->sessname); + flex_string_sprintf(fs, "s=%s\r\n", sdp_p->sessname); if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Built s= session name line", sdp_p->debug_str); @@ -385,7 +345,7 @@ sdp_result_e sdp_parse_sessinfo (sdp_t *sdp_p, u16 level, const char *ptr) return (SDP_SUCCESS); } -sdp_result_e sdp_build_sessinfo (sdp_t *sdp_p, u16 level, char **ptr, u16 len) +sdp_result_e sdp_build_sessinfo (sdp_t *sdp_p, u16 level, flex_string *fs) { /* Build session info line not supported. */ return (SDP_SUCCESS); @@ -417,7 +377,7 @@ sdp_result_e sdp_parse_uri (sdp_t *sdp_p, u16 level, const char *ptr) return (SDP_SUCCESS); } -sdp_result_e sdp_build_uri (sdp_t *sdp_p, u16 level, char **ptr, u16 len) +sdp_result_e sdp_build_uri (sdp_t *sdp_p, u16 level, flex_string *fs) { /* Build URI line not supported. */ return (SDP_SUCCESS); @@ -440,7 +400,7 @@ sdp_result_e sdp_parse_email (sdp_t *sdp_p, u16 level, const char *ptr) return (SDP_SUCCESS); } -sdp_result_e sdp_build_email (sdp_t *sdp_p, u16 level, char **ptr, u16 len) +sdp_result_e sdp_build_email (sdp_t *sdp_p, u16 level, flex_string *fs) { /* Build email line not supported. */ return (SDP_SUCCESS); @@ -464,7 +424,7 @@ sdp_result_e sdp_parse_phonenum (sdp_t *sdp_p, u16 level, const char *ptr) return (SDP_SUCCESS); } -sdp_result_e sdp_build_phonenum (sdp_t *sdp_p, u16 level, char **ptr, u16 len) +sdp_result_e sdp_build_phonenum (sdp_t *sdp_p, u16 level, flex_string *fs) { /* Build phone number line not supported. */ return (SDP_SUCCESS); @@ -518,7 +478,7 @@ sdp_result_e sdp_parse_connection (sdp_t *sdp_p, u16 level, const char *ptr) } conn_p->nettype = SDP_NT_UNSUPPORTED; for (i=0; i < SDP_MAX_NETWORK_TYPES; i++) { - if (cpr_strncasecmp(tmp, sdp_nettype[i].name, + if (cpr_strncasecmp(tmp, sdp_nettype[i].name, sdp_nettype[i].strlen) == 0) { if (sdp_p->conf_p->nettype_supported[i] == TRUE) { conn_p->nettype = (sdp_nettype_e)i; @@ -577,12 +537,12 @@ sdp_result_e sdp_parse_connection (sdp_t *sdp_p, u16 level, const char *ptr) sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } - /* We currently only support addrs containing '/'s for EPN addrs. + /* We currently only support addrs containing '/'s for EPN addrs. * For other addrs this would indicate multicast addrs. */ - /* Multicast host group addresses are defined to be the IP addresses - * whose high-order four bits are 1110, giving an address range from + /* Multicast host group addresses are defined to be the IP addresses + * whose high-order four bits are 1110, giving an address range from * 224.0.0.0 through 239.255.255.255 - */ + */ /* multicast addr check */ sstrncpy (mcast_str, conn_p->conn_addr, MCAST_STRING_LEN); @@ -600,24 +560,24 @@ sdp_result_e sdp_parse_connection (sdp_t *sdp_p, u16 level, const char *ptr) mcast_bits = (int) strtoul_result; - if ((mcast_bits >= SDP_MIN_MCAST_ADDR_HI_BIT_VAL ) && + if ((mcast_bits >= SDP_MIN_MCAST_ADDR_HI_BIT_VAL ) && (mcast_bits <= SDP_MAX_MCAST_ADDR_HI_BIT_VAL)) { - SDP_PRINT("%s Parsed to be a multicast address with mcast bits %d", + SDP_PRINT("%s Parsed to be a multicast address with mcast bits %d", sdp_p->debug_str, mcast_bits); conn_p->is_multicast = TRUE; - } - + } + if (conn_p->addrtype != SDP_AT_EPN) { slash_ptr = sdp_findchar(conn_p->conn_addr, "/"); if (slash_ptr[0] != '\0') { if (conn_p->is_multicast) { - SDP_PRINT("%s A multicast address with slash %s", + SDP_PRINT("%s A multicast address with slash %s", sdp_p->debug_str, conn_p->conn_addr); slash_ptr++; slash_ptr = sdp_getnextstrtok(slash_ptr, tmp, sizeof(tmp), "/", &result); if (result != SDP_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - SDP_ERROR("%s No ttl value specified for this multicast addr with a slash", + SDP_ERROR("%s No ttl value specified for this multicast addr with a slash", sdp_p->debug_str); } sdp_p->conf_p->num_invalid_param++; @@ -634,7 +594,7 @@ sdp_result_e sdp_parse_connection (sdp_t *sdp_p, u16 level, const char *ptr) } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); - } + } conn_p->ttl = (int) strtoul_result; @@ -645,7 +605,7 @@ sdp_result_e sdp_parse_connection (sdp_t *sdp_p, u16 level, const char *ptr) slash_ptr = sdp_findchar(slash_ptr, "/"); if (slash_ptr != NULL && slash_ptr[0] != '\0') { - SDP_PRINT("%s Found a num addr field for multicast addr %s ", + SDP_PRINT("%s Found a num addr field for multicast addr %s ", sdp_p->debug_str,slash_ptr); slash_ptr++; @@ -665,7 +625,7 @@ sdp_result_e sdp_parse_connection (sdp_t *sdp_p, u16 level, const char *ptr) } } else { sdp_p->conf_p->num_invalid_param++; - SDP_PRINT("%s Only multicast addresses allowed with slashes", + SDP_PRINT("%s Only multicast addresses allowed with slashes", sdp_p->debug_str); return (SDP_INVALID_PARAMETER); } @@ -680,10 +640,10 @@ sdp_result_e sdp_parse_connection (sdp_t *sdp_p, u16 level, const char *ptr) "address specified but not allowed.", sdp_p->debug_str); } } - + if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Parse connection: network %s, address type %s, " - "address %s ttl= %d num of addresses = %d", + "address %s ttl= %d num of addresses = %d", sdp_p->debug_str, sdp_get_network_name(conn_p->nettype), sdp_get_address_name(conn_p->addrtype), @@ -692,12 +652,10 @@ sdp_result_e sdp_parse_connection (sdp_t *sdp_p, u16 level, const char *ptr) return (SDP_SUCCESS); } -sdp_result_e sdp_build_connection (sdp_t *sdp_p, u16 level, char **ptr, - u16 len) +sdp_result_e sdp_build_connection (sdp_t *sdp_p, u16 level, flex_string *fs) { sdp_mca_t *mca_p; sdp_conn_t *conn_p; - char *endbuf_p = *ptr + len; if (level == SDP_SESSION_LEVEL) { conn_p = &(sdp_p->default_conn); @@ -709,37 +667,37 @@ sdp_result_e sdp_build_connection (sdp_t *sdp_p, u16 level, char **ptr, conn_p = &(mca_p->conn); } - if((conn_p->nettype == SDP_NT_ATM ) && + if((conn_p->nettype == SDP_NT_ATM ) && (conn_p->addrtype == SDP_AT_INVALID)) { /*allow c= line to be built without address type and address fields * This is a special case for ATM PVC*/ - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "c=%s\r\n", + flex_string_sprintf(fs, "c=%s\r\n", sdp_get_network_name(conn_p->nettype)); return SDP_SUCCESS; - } + } if ((conn_p->nettype >= SDP_MAX_NETWORK_TYPES) || (conn_p->addrtype >= SDP_MAX_ADDR_TYPES) || (conn_p->conn_addr[0] == '\0')) { /* Connection info isn't set - don't need to build the token. */ return (SDP_SUCCESS); } - + if (conn_p->is_multicast) { if (conn_p->num_of_addresses > 1) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "c=%s %s %s/%d/%d\r\n", + flex_string_sprintf(fs, "c=%s %s %s/%d/%d\r\n", sdp_get_network_name(conn_p->nettype), sdp_get_address_name(conn_p->addrtype), - conn_p->conn_addr, conn_p->ttl, + conn_p->conn_addr, conn_p->ttl, conn_p->num_of_addresses); } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "c=%s %s %s/%d\r\n", + flex_string_sprintf(fs, "c=%s %s %s/%d\r\n", sdp_get_network_name(conn_p->nettype), sdp_get_address_name(conn_p->addrtype), conn_p->conn_addr, conn_p->ttl); } } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "c=%s %s %s\r\n", + flex_string_sprintf(fs, "c=%s %s %s\r\n", sdp_get_network_name(conn_p->nettype), sdp_get_address_name(conn_p->addrtype), conn_p->conn_addr); @@ -751,7 +709,7 @@ sdp_result_e sdp_build_connection (sdp_t *sdp_p, u16 level, char **ptr, return (SDP_SUCCESS); } -/* +/* * sdp_parse_bandwidth * * This function parses a bandwidth field. The parsing is done in accordance @@ -760,7 +718,7 @@ sdp_result_e sdp_build_connection (sdp_t *sdp_p, u16 level, char **ptr, * bandwidth-fields = *("b=" bwtype ":" bandwidth CRLF) * bwtype = 1*(alpha-numeric) * bandwidth = 1*(DIGIT) - * + * * It currently supports three types of valid bwtypes - AS, CT and TIAS */ sdp_result_e sdp_parse_bandwidth (sdp_t *sdp_p, u16 level, const char *ptr) @@ -809,7 +767,7 @@ sdp_result_e sdp_parse_bandwidth (sdp_t *sdp_p, u16 level, const char *ptr) if (bw_modifier == SDP_BW_MODIFIER_UNSUPPORTED) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - SDP_ERROR("%s Error: BW Modifier type unsupported (%s).", + SDP_ERROR("%s Error: BW Modifier type unsupported (%s).", sdp_p->debug_str, tmp); } sdp_p->conf_p->num_invalid_param++; @@ -826,7 +784,7 @@ sdp_result_e sdp_parse_bandwidth (sdp_t *sdp_p, u16 level, const char *ptr) if ((result != SDP_SUCCESS)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - SDP_ERROR("%s Error: No BW Value specified ", + SDP_ERROR("%s Error: No BW Value specified ", sdp_p->debug_str); } sdp_p->conf_p->num_invalid_param++; @@ -849,23 +807,23 @@ sdp_result_e sdp_parse_bandwidth (sdp_t *sdp_p, u16 level, const char *ptr) /* * Enqueue the sdp_bw_data_t instance at the end of the list of - * sdp_bw_data_t instances. + * sdp_bw_data_t instances. */ if (bw_p->bw_data_list == NULL) { bw_p->bw_data_list = new_bw_data_p; } else { - for (bw_data_p = bw_p->bw_data_list; + for (bw_data_p = bw_p->bw_data_list; bw_data_p->next_p != NULL; bw_data_p = bw_data_p->next_p) { ; // Empty For } bw_data_p->next_p = new_bw_data_p; - } + } bw_p->bw_data_count++; if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Parsed bw type %s, value %d", sdp_p->debug_str, - sdp_get_bw_modifier_name(new_bw_data_p->bw_modifier), + sdp_get_bw_modifier_name(new_bw_data_p->bw_modifier), new_bw_data_p->bw_val); } @@ -877,12 +835,11 @@ sdp_result_e sdp_parse_bandwidth (sdp_t *sdp_p, u16 level, const char *ptr) * * Builds *all* the bandwith lines for the specified level. */ -sdp_result_e sdp_build_bandwidth (sdp_t *sdp_p, u16 level, char **ptr, u16 len) +sdp_result_e sdp_build_bandwidth (sdp_t *sdp_p, u16 level, flex_string *fs) { sdp_bw_t *bw_p; sdp_bw_data_t *bw_data_p; sdp_mca_t *mca_p; - char *endbuf_p; if (level == SDP_SESSION_LEVEL) { bw_p = &(sdp_p->bw); @@ -894,12 +851,9 @@ sdp_result_e sdp_build_bandwidth (sdp_t *sdp_p, u16 level, char **ptr, u16 len) bw_p = &(mca_p->bw); } - /* Find ptr to the end of the buf for recalculating len remaining. */ - endbuf_p = *ptr + len; - bw_data_p = bw_p->bw_data_list; while (bw_data_p) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "b=%s:%d\r\n", + flex_string_sprintf(fs, "b=%s:%d\r\n", sdp_get_bw_modifier_name(bw_data_p->bw_modifier), bw_data_p->bw_val); @@ -908,7 +862,7 @@ sdp_result_e sdp_build_bandwidth (sdp_t *sdp_p, u16 level, char **ptr, u16 len) sdp_get_bw_modifier_name(bw_data_p->bw_modifier), bw_data_p->bw_val); } - + bw_data_p = bw_data_p->next_p; } @@ -934,7 +888,7 @@ sdp_result_e sdp_parse_timespec (sdp_t *sdp_p, u16 level, const char *ptr) /* Make sure the start_time is numeric, even though we store it as * a string. */ - (void)sdp_getnextnumtok(timespec_p->start_time, + (void)sdp_getnextnumtok(timespec_p->start_time, (const char **)&tmpptr, " \t", &result); } if (result != SDP_SUCCESS) { @@ -952,7 +906,7 @@ sdp_result_e sdp_parse_timespec (sdp_t *sdp_p, u16 level, const char *ptr) /* Make sure the start_time is numeric, even though we store it as * a string. */ - (void)sdp_getnextnumtok(timespec_p->stop_time, + (void)sdp_getnextnumtok(timespec_p->stop_time, (const char **)&tmpptr, " \t", &result); } if (result != SDP_SUCCESS) { @@ -982,10 +936,8 @@ sdp_result_e sdp_parse_timespec (sdp_t *sdp_p, u16 level, const char *ptr) return (SDP_SUCCESS); } -sdp_result_e sdp_build_timespec (sdp_t *sdp_p, u16 level, char **ptr, u16 len) +sdp_result_e sdp_build_timespec (sdp_t *sdp_p, u16 level, flex_string *fs) { - char *endbuf_p = *ptr + len; - if ((sdp_p->timespec_p == NULL) || (sdp_p->timespec_p->start_time == '\0') || (sdp_p->timespec_p->stop_time == '\0')) { @@ -1003,7 +955,7 @@ sdp_result_e sdp_build_timespec (sdp_t *sdp_p, u16 level, char **ptr, u16 len) } /* Note: We only support one t= line currently. */ - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "t=%s %s\r\n", sdp_p->timespec_p->start_time, + flex_string_sprintf(fs, "t=%s %s\r\n", sdp_p->timespec_p->start_time, sdp_p->timespec_p->stop_time); if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { @@ -1030,7 +982,7 @@ sdp_result_e sdp_parse_repeat_time (sdp_t *sdp_p, u16 level, const char *ptr) return (SDP_SUCCESS); } -sdp_result_e sdp_build_repeat_time (sdp_t *sdp_p, u16 level, char **ptr, u16 len) +sdp_result_e sdp_build_repeat_time (sdp_t *sdp_p, u16 level, flex_string *fs) { /* Build repeat time line not supported. */ return (SDP_SUCCESS); @@ -1054,8 +1006,7 @@ sdp_result_e sdp_parse_timezone_adj (sdp_t *sdp_p, u16 level, const char *ptr) return (SDP_SUCCESS); } -sdp_result_e sdp_build_timezone_adj (sdp_t *sdp_p, u16 level, char **ptr, - u16 len) +sdp_result_e sdp_build_timezone_adj (sdp_t *sdp_p, u16 level, flex_string *fs) { /* Build timezone adjustment line not supported. */ return (SDP_SUCCESS); @@ -1100,7 +1051,7 @@ sdp_result_e sdp_parse_encryption (sdp_t *sdp_p, u16 level, const char *ptr) } if (encrypt_p->encrypt_type == SDP_ENCRYPT_UNSUPPORTED) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - SDP_WARN("%s Warning: Encryption type unsupported (%s).", + SDP_WARN("%s Warning: Encryption type unsupported (%s).", sdp_p->debug_str, tmp); } } @@ -1136,15 +1087,10 @@ sdp_result_e sdp_parse_encryption (sdp_t *sdp_p, u16 level, const char *ptr) } /* If the encryption info is valid, we build it. Else skip it. */ -sdp_result_e sdp_build_encryption (sdp_t *sdp_p, u16 level, char **ptr, - u16 len) +sdp_result_e sdp_build_encryption (sdp_t *sdp_p, u16 level, flex_string *fs) { sdp_encryptspec_t *encrypt_p; sdp_mca_t *mca_p; - char *endbuf_p; - - /* Find ptr to the end of the buf for recalculating len remaining. */ - endbuf_p = *ptr + len; if (level == SDP_SESSION_LEVEL) { encrypt_p = &(sdp_p->encrypt); @@ -1156,21 +1102,21 @@ sdp_result_e sdp_build_encryption (sdp_t *sdp_p, u16 level, char **ptr, encrypt_p = &(mca_p->encrypt); } - if ((encrypt_p->encrypt_type >= SDP_MAX_ENCRYPT_TYPES) || + if ((encrypt_p->encrypt_type >= SDP_MAX_ENCRYPT_TYPES) || ((encrypt_p->encrypt_type != SDP_ENCRYPT_PROMPT) && (encrypt_p->encrypt_key[0] == '\0'))) { /* Encryption info isn't set - don't need to build the token. */ return (SDP_SUCCESS); } - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "k=%s", + flex_string_sprintf(fs, "k=%s", sdp_get_encrypt_name(encrypt_p->encrypt_type)); if (encrypt_p->encrypt_type == SDP_ENCRYPT_PROMPT) { /* There is no key to print. */ - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "\r\n"); + flex_string_sprintf(fs, "\r\n"); } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), ":%s\r\n", encrypt_p->encrypt_key); + flex_string_sprintf(fs, ":%s\r\n", encrypt_p->encrypt_key); } if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { @@ -1183,7 +1129,7 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) { u16 i; u16 num_port_params=0; - int32 num[SDP_MAX_PORT_PARAMS]; + int32 num[SDP_MAX_PORT_PARAMS]; tinybool valid_param = FALSE; sdp_result_e result; sdp_mca_t *mca_p; @@ -1199,12 +1145,12 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) sdp_p->conf_p->num_no_resource++; return (SDP_NO_RESOURCE); } - + /* Find the media type. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - SDP_ERROR("%s No media type specified, parse failed.", + SDP_ERROR("%s No media type specified, parse failed.", sdp_p->debug_str); } SDP_FREE(mca_p); @@ -1220,14 +1166,14 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) } if (mca_p->media == SDP_MEDIA_UNSUPPORTED) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - SDP_WARN("%s Warning: Media type unsupported (%s).", + SDP_WARN("%s Warning: Media type unsupported (%s).", sdp_p->debug_str, tmp); } } - /* Find the port token parameters, but don't process it until - * we determine the transport protocol as that determines what - * port number formats are valid. + /* Find the port token parameters, but don't process it until + * we determine the transport protocol as that determines what + * port number formats are valid. */ ptr = sdp_getnextstrtok(ptr, port, sizeof(port), " \t", &result); if (result != SDP_SUCCESS) { @@ -1244,7 +1190,7 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) if (sdp_getchoosetok(port_ptr, &port_ptr, "/ \t", &result) == TRUE) { num[i] = SDP_CHOOSE_PARAM; } else { - num[i] = sdp_getnextnumtok(port_ptr, (const char **)&port_ptr, + num[i] = sdp_getnextnumtok(port_ptr, (const char **)&port_ptr, "/ \t", &result); if (result != SDP_SUCCESS) { break; @@ -1292,8 +1238,8 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) if ((mca_p->transport == SDP_TRANSPORT_RTPAVP) || (mca_p->transport == SDP_TRANSPORT_RTPSAVP) || (mca_p->transport == SDP_TRANSPORT_RTPSAVPF) || - (mca_p->transport == SDP_TRANSPORT_UDP) || - (mca_p->transport == SDP_TRANSPORT_TCP) || + (mca_p->transport == SDP_TRANSPORT_UDP) || + (mca_p->transport == SDP_TRANSPORT_TCP) || (mca_p->transport == SDP_TRANSPORT_UDPTL) || (mca_p->transport == SDP_TRANSPORT_UDPSPRT) || (mca_p->transport == SDP_TRANSPORT_LOCAL) || @@ -1331,12 +1277,12 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) if ((mca_p->transport == SDP_TRANSPORT_RTPAVP) || (mca_p->transport == SDP_TRANSPORT_RTPSAVP) || (mca_p->transport == SDP_TRANSPORT_RTPSAVPF) || - (mca_p->transport == SDP_TRANSPORT_UDP) || + (mca_p->transport == SDP_TRANSPORT_UDP) || (mca_p->transport == SDP_TRANSPORT_LOCAL)) { - /* Port format is /. Make sure choose - * params were not specified. + /* Port format is /. Make sure choose + * params were not specified. */ - if ((num[0] != SDP_CHOOSE_PARAM) && + if ((num[0] != SDP_CHOOSE_PARAM) && (num[1] != SDP_CHOOSE_PARAM)) { mca_p->port = num[0]; mca_p->num_ports = num[1]; @@ -1344,11 +1290,11 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) valid_param = TRUE; } } else if (mca_p->transport == SDP_TRANSPORT_UDPTL) { - /* Port format is /. Make sure choose + /* Port format is /. Make sure choose * params were not specified. For UDPTL, only "1" may * be specified for number of ports. */ - if ((num[0] != SDP_CHOOSE_PARAM) && + if ((num[0] != SDP_CHOOSE_PARAM) && (num[1] == 1)) { mca_p->port = num[0]; mca_p->num_ports = 1; @@ -1356,10 +1302,10 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) valid_param = TRUE; } } else if (mca_p->transport == SDP_TRANSPORT_CES10) { - /* Port format is /. Make sure choose - * params were not specified. + /* Port format is /. Make sure choose + * params were not specified. */ - if ((num[0] != SDP_CHOOSE_PARAM) && + if ((num[0] != SDP_CHOOSE_PARAM) && (num[1] != SDP_CHOOSE_PARAM)) { mca_p->vpi = num[0]; mca_p->vci = num[1]; @@ -1374,9 +1320,9 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) * are allowed by default and don't need to be allowed * through the appl config. */ - if (((num[0] != SDP_CHOOSE_PARAM) && + if (((num[0] != SDP_CHOOSE_PARAM) && (num[1] != SDP_CHOOSE_PARAM)) || - ((num[0] == SDP_CHOOSE_PARAM) && + ((num[0] == SDP_CHOOSE_PARAM) && (num[1] == SDP_CHOOSE_PARAM))) { mca_p->vcci = num[0]; mca_p->cid = num[1]; @@ -1387,10 +1333,10 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) break; case 3: if (mca_p->transport == SDP_TRANSPORT_AAL1AVP) { - /* Port format is //. Make sure choose - * params were not specified. + /* Port format is //. Make sure choose + * params were not specified. */ - if ((num[0] != SDP_CHOOSE_PARAM) && + if ((num[0] != SDP_CHOOSE_PARAM) && (num[1] != SDP_CHOOSE_PARAM) && (num[2] != SDP_CHOOSE_PARAM)) { mca_p->port = num[0]; @@ -1405,10 +1351,10 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) if ((mca_p->transport == SDP_TRANSPORT_AAL2_ITU) || (mca_p->transport == SDP_TRANSPORT_AAL2_ATMF) || (mca_p->transport == SDP_TRANSPORT_AAL2_CUSTOM)) { - /* Port format is ///. Make sure choose - * params were not specified. + /* Port format is ///. Make sure choose + * params were not specified. */ - if ((num[0] != SDP_CHOOSE_PARAM) && + if ((num[0] != SDP_CHOOSE_PARAM) && (num[1] != SDP_CHOOSE_PARAM) && (num[2] != SDP_CHOOSE_PARAM) && (num[3] != SDP_CHOOSE_PARAM)) { @@ -1433,13 +1379,13 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) return (SDP_INVALID_PARAMETER); } - /* Find payload formats. AAL2 media lines allow multiple + /* Find payload formats. AAL2 media lines allow multiple * transport/profile types per line, so these are handled differently. */ if ((mca_p->transport == SDP_TRANSPORT_AAL2_ITU) || (mca_p->transport == SDP_TRANSPORT_AAL2_ATMF) || (mca_p->transport == SDP_TRANSPORT_AAL2_CUSTOM)) { - if (sdp_parse_multiple_profile_payload_types(sdp_p, mca_p, ptr) != + if (sdp_parse_multiple_profile_payload_types(sdp_p, mca_p, ptr) != SDP_SUCCESS) { sdp_p->conf_p->num_invalid_param++; SDP_FREE(mca_p); @@ -1449,7 +1395,7 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) /* Transport is a non-AAL2 type. Parse payloads normally. */ sdp_parse_payload_types(sdp_p, mca_p, ptr); } - + /* Parse SCTP/DTLS port */ if (mca_p->transport == SDP_TRANSPORT_SCTPDTLS) { ptr = sdp_getnextstrtok(ptr, port, sizeof(port), " \t", &result); @@ -1489,39 +1435,39 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) } if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { - + SDP_PRINT("%s Parsed media type %s, ", sdp_p->debug_str, sdp_get_media_name(mca_p->media)); switch (mca_p->port_format) { - case SDP_PORT_NUM_ONLY: + case SDP_PORT_NUM_ONLY: SDP_PRINT("Port num %ld, ", mca_p->port); break; - case SDP_PORT_NUM_COUNT: - SDP_PRINT("Port num %ld, count %ld, ", + case SDP_PORT_NUM_COUNT: + SDP_PRINT("Port num %ld, count %ld, ", mca_p->port, mca_p->num_ports); break; - case SDP_PORT_VPI_VCI: + case SDP_PORT_VPI_VCI: SDP_PRINT("VPI/VCI %ld/%lu, ", mca_p->vpi, mca_p->vci); break; - case SDP_PORT_VCCI: + case SDP_PORT_VCCI: SDP_PRINT("VCCI %ld, ", mca_p->vcci); break; - case SDP_PORT_NUM_VPI_VCI: + case SDP_PORT_NUM_VPI_VCI: SDP_PRINT("Port %ld, VPI/VCI %ld/%lu, ", mca_p->port, mca_p->vpi, mca_p->vci); break; - case SDP_PORT_VCCI_CID: + case SDP_PORT_VCCI_CID: SDP_PRINT("VCCI %ld, CID %ld, ", mca_p->vcci, mca_p->cid); break; - case SDP_PORT_NUM_VPI_VCI_CID: + case SDP_PORT_NUM_VPI_VCI_CID: SDP_PRINT("Port %ld, VPI/VCI %ld/%lu, CID %ld, ", mca_p->port, mca_p->vpi, mca_p->vci, mca_p->cid); break; default: SDP_PRINT("Port format not valid, "); break; - } + } if ((mca_p->transport >= SDP_TRANSPORT_AAL2_ITU) && (mca_p->transport <= SDP_TRANSPORT_AAL2_CUSTOM)) { @@ -1539,16 +1485,12 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) return (SDP_SUCCESS); } -sdp_result_e sdp_build_media (sdp_t *sdp_p, u16 level, char **ptr, u16 len) +sdp_result_e sdp_build_media (sdp_t *sdp_p, u16 level, flex_string *fs) { int i, j; sdp_mca_t *mca_p; tinybool invalid_params=FALSE; sdp_media_profiles_t *profile_p; - char *endbuf_p; - - /* Find ptr to the end of the buf for recalculating len remaining. */ - endbuf_p = *ptr + len; /* Find the right media line */ mca_p = sdp_find_media_level(sdp_p, level); @@ -1573,30 +1515,30 @@ sdp_result_e sdp_build_media (sdp_t *sdp_p, u16 level, char **ptr, u16 len) } /* Build the media type */ - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "m=%s ", sdp_get_media_name(mca_p->media)); + flex_string_sprintf(fs, "m=%s ", sdp_get_media_name(mca_p->media)); /* Build the port based on the specified port format */ if (mca_p->port_format == SDP_PORT_NUM_ONLY) { if (mca_p->port == SDP_CHOOSE_PARAM) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "$ "); + flex_string_sprintf(fs, "$ "); } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "%u ", (u16)mca_p->port); + flex_string_sprintf(fs, "%u ", (u16)mca_p->port); } } else if (mca_p->port_format == SDP_PORT_NUM_COUNT) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "%u/%u ", (u16)mca_p->port, + flex_string_sprintf(fs, "%u/%u ", (u16)mca_p->port, (u16)mca_p->num_ports); } else if (mca_p->port_format == SDP_PORT_VPI_VCI) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "%u/%u ", + flex_string_sprintf(fs, "%u/%u ", (u16)mca_p->vpi, (u16)mca_p->vci); } else if (mca_p->port_format == SDP_PORT_VCCI) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "%u ", (u16)mca_p->vcci); + flex_string_sprintf(fs, "%u ", (u16)mca_p->vcci); } else if (mca_p->port_format == SDP_PORT_NUM_VPI_VCI) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "%u/%u/%u ", (u16)mca_p->port, + flex_string_sprintf(fs, "%u/%u/%u ", (u16)mca_p->port, (u16)mca_p->vpi, (u16)mca_p->vci); } else if (mca_p->port_format == SDP_PORT_VCCI_CID) { if ((mca_p->vcci == SDP_CHOOSE_PARAM) && (mca_p->cid == SDP_CHOOSE_PARAM)) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "$/$ "); + flex_string_sprintf(fs, "$/$ "); } else if ((mca_p->vcci == SDP_CHOOSE_PARAM) || (mca_p->cid == SDP_CHOOSE_PARAM)) { /* If one is set but not the other, this is an error. */ @@ -1607,11 +1549,11 @@ sdp_result_e sdp_build_media (sdp_t *sdp_p, u16 level, char **ptr, u16 len) sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "%u/%u ", + flex_string_sprintf(fs, "%u/%u ", (u16)mca_p->vcci, (u16)mca_p->cid); } } else if (mca_p->port_format == SDP_PORT_NUM_VPI_VCI_CID) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "%u/%u/%u/%u ", (u16)mca_p->port, + flex_string_sprintf(fs, "%u/%u/%u/%u ", (u16)mca_p->port, (u16)mca_p->vpi, (u16)mca_p->vci, (u16)mca_p->cid); } @@ -1621,16 +1563,16 @@ sdp_result_e sdp_build_media (sdp_t *sdp_p, u16 level, char **ptr, u16 len) (mca_p->transport == SDP_TRANSPORT_AAL2_CUSTOM)) { profile_p = mca_p->media_profiles_p; for (i=0; i < profile_p->num_profiles; i++) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "%s", + flex_string_sprintf(fs, "%s", sdp_get_transport_name(profile_p->profile[i])); for (j=0; j < profile_p->num_payloads[i]; j++) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), " %u", + flex_string_sprintf(fs, " %u", profile_p->payload_type[i][j]); } - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), " "); + flex_string_sprintf(fs, " "); } - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "\n"); + flex_string_sprintf(fs, "\n"); if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Built m= media line", sdp_p->debug_str); } @@ -1638,7 +1580,7 @@ sdp_result_e sdp_build_media (sdp_t *sdp_p, u16 level, char **ptr, u16 len) } /* Build the transport name */ - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "%s", + flex_string_sprintf(fs, "%s", sdp_get_transport_name(mca_p->transport)); if(mca_p->transport != SDP_TRANSPORT_SCTPDTLS) { @@ -1646,18 +1588,18 @@ sdp_result_e sdp_build_media (sdp_t *sdp_p, u16 level, char **ptr, u16 len) /* Build the format lists */ for (i=0; i < mca_p->num_payloads; i++) { if (mca_p->payload_indicator[i] == SDP_PAYLOAD_ENUM) { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), " %s", + flex_string_sprintf(fs, " %s", sdp_get_payload_name((sdp_payload_e)mca_p->payload_type[i])); } else { - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), " %u", mca_p->payload_type[i]); + flex_string_sprintf(fs, " %u", mca_p->payload_type[i]); } } } else { /* Add port to SDP if transport is SCTP/DTLS */ - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), " %u ", (u32)mca_p->sctpport); + flex_string_sprintf(fs, " %u ", (u32)mca_p->sctpport); } - *ptr += snprintf(*ptr, MAX((endbuf_p - *ptr), 0), "\r\n"); + flex_string_sprintf(fs, "\r\n"); if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Built m= media line", sdp_p->debug_str); @@ -1690,7 +1632,7 @@ void sdp_parse_payload_types (sdp_t *sdp_p, sdp_mca_t *mca_p, const char *ptr) /* If there are no more payload types, we're finished */ break; } - mca_p->payload_type[num_payloads] = (u16)sdp_getnextnumtok(tmp, + mca_p->payload_type[num_payloads] = (u16)sdp_getnextnumtok(tmp, (const char **)&tmp2, " \t", &result); if (result == SDP_SUCCESS) { @@ -1745,9 +1687,9 @@ void sdp_parse_payload_types (sdp_t *sdp_p, sdp_mca_t *mca_p, const char *ptr) } else { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { SDP_WARN("%s Warning: Payload type %s not valid for " - "media %s with transport %s.", + "media %s with transport %s.", sdp_p->debug_str, - sdp_get_payload_name((sdp_payload_e)i), + sdp_get_payload_name((sdp_payload_e)i), sdp_get_media_name(mca_p->media), sdp_get_transport_name(mca_p->transport)); } @@ -1762,7 +1704,7 @@ void sdp_parse_payload_types (sdp_t *sdp_p, sdp_mca_t *mca_p, const char *ptr) } if (mca_p->num_payloads == 0) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - SDP_WARN("%s Warning: No payload types specified.", + SDP_WARN("%s Warning: No payload types specified.", sdp_p->debug_str); } } @@ -1778,8 +1720,8 @@ void sdp_parse_payload_types (sdp_t *sdp_p, sdp_mca_t *mca_p, const char *ptr) * ptr The pointer to the list of payloads. * Returns: Nothing. */ -sdp_result_e sdp_parse_multiple_profile_payload_types (sdp_t *sdp_p, - sdp_mca_t *mca_p, +sdp_result_e sdp_parse_multiple_profile_payload_types (sdp_t *sdp_p, + sdp_mca_t *mca_p, const char *ptr) { u16 i; @@ -1853,7 +1795,7 @@ sdp_result_e sdp_parse_multiple_profile_payload_types (sdp_t *sdp_p, /* See if the payload type is numeric. */ if (prof < SDP_MAX_PROFILES && payload < SDP_MAX_PAYLOAD_TYPES) { - profile_p->payload_type[prof][payload] = (u16)sdp_getnextnumtok(tmp, + profile_p->payload_type[prof][payload] = (u16)sdp_getnextnumtok(tmp, (const char **)&tmp2, " \t", &result); if (result == SDP_SUCCESS) { diff --git a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_utils.c b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_utils.c index 0a5e3249eb91..6825e34952e2 100644 --- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_utils.c +++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_utils.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include @@ -147,22 +112,22 @@ static sdp_result_e next_token(const char **string_of_tokens, char *token, unsig /* * verify_sdescriptions_mki - * + * * Verifies the syntax of the MKI parameter. * - * mki = mki-value ":" mki-length - * mki-value = 1*DIGIT + * mki = mki-value ":" mki-length + * mki-value = 1*DIGIT * mki-length = 1*3DIGIT ; range 1..128 * * Inputs: - * buf - ptr to start of MKI string assumes NULL + * buf - ptr to start of MKI string assumes NULL * terminated string - * mkiValue - buffer to store the MKI value, assumes calling + * mkiValue - buffer to store the MKI value, assumes calling * function has provided memory for this. * mkiLen - integer to store the MKI length * * Outputs: - * Returns TRUE if syntax is correct and stores the + * Returns TRUE if syntax is correct and stores the * MKI value in mkiVal and stores the length in mkiLen. * Returns FALSE otherwise. */ @@ -177,13 +142,13 @@ verify_sdescriptions_mki (char *buf, char *mkiVal, u16 *mkiLen) int idx = 0; unsigned long strtoul_result; char *strtoul_end; - + ptr = buf; /* MKI must begin with a digit */ if (!ptr || (!isdigit((int) *ptr))) { return FALSE; } - + /* scan until we reach a non-digit or colon */ while (*ptr) { if (*ptr == ':') { @@ -196,17 +161,17 @@ verify_sdescriptions_mki (char *buf, char *mkiVal, u16 *mkiLen) } else { return FALSE; } - + ptr++; } - + /* there has to be a mki length */ if (*ptr == 0) { return FALSE; - } - + } + idx = 0; - + /* verify the mki length (max 3 digits) */ while (*ptr) { if (isdigit((int) *ptr) && (idx < 3)) { @@ -214,10 +179,10 @@ verify_sdescriptions_mki (char *buf, char *mkiVal, u16 *mkiLen) } else { return FALSE; } - + ptr++; } - + mkiLenBuf[idx] = 0; errno = 0; @@ -243,24 +208,24 @@ verify_sdescriptions_mki (char *buf, char *mkiVal, u16 *mkiLen) * lifetime = ["2^"] 1*(DIGIT) * * Inputs: - * buf - pointer to start of lifetime string. Assumes string is + * buf - pointer to start of lifetime string. Assumes string is * NULL terminated. * Outputs: * Returns TRUE if syntax is correct. Returns FALSE otherwise. */ - + tinybool verify_sdescriptions_lifetime (char *buf) { char *ptr; tinybool tokenFound = FALSE; - + ptr = buf; if (!ptr || *ptr == 0) { return FALSE; } - + while (*ptr) { if (*ptr == '^') { if (tokenFound) { @@ -271,7 +236,7 @@ verify_sdescriptions_lifetime (char *buf) /* Lifetime is in power of 2 format, make sure first and second * chars are 2^ */ - + if (buf[0] != '2' || buf[1] != '^') { return FALSE; } @@ -279,18 +244,18 @@ verify_sdescriptions_lifetime (char *buf) } else if (!isdigit((int) *ptr)) { return FALSE; } - + ptr++; - + } - + /* Make sure if the format is 2^ that there is a number after the ^. */ if (tokenFound) { if (strlen(buf) <= 2) { return FALSE; } } - + return TRUE; } @@ -316,7 +281,7 @@ sdp_validate_maxprate(const char *string_parm) while (isdigit((int)*string_parm)) { string_parm++; } - } + } if (*string_parm == '\0') { retval = TRUE; @@ -343,7 +308,7 @@ char *sdp_findchar (const char *ptr, char *char_list) } /* Locate the next token in a line. The delim characters are passed in - * as a param. The token also will not go past a new line char or the + * as a param. The token also will not go past a new line char or the * end of the string. Skip any delimiters before the token. */ const char *sdp_getnextstrtok (const char *str, char *tokenstr, unsigned tokenstr_len, @@ -370,7 +335,7 @@ const char *sdp_getnextstrtok (const char *str, char *tokenstr, unsigned tokenst * a new line char or the end of the string. Skip any delimiters before * the token. */ -u32 sdp_getnextnumtok_or_null (const char *str, const char **str_end, +u32 sdp_getnextnumtok_or_null (const char *str, const char **str_end, const char *delim, tinybool *null_ind, sdp_result_e *result) { @@ -416,11 +381,11 @@ u32 sdp_getnextnumtok_or_null (const char *str, const char **str_end, } -/* Locate the next numeric token in a string. The delim characters are - * passed in as a param. The token also will not go past a new line char +/* Locate the next numeric token in a string. The delim characters are + * passed in as a param. The token also will not go past a new line char * or the end of the string. Skip any delimiters before the token. */ -u32 sdp_getnextnumtok (const char *str, const char **str_end, +u32 sdp_getnextnumtok (const char *str, const char **str_end, const char *delim, sdp_result_e *result) { const char *token_list = str; @@ -455,9 +420,9 @@ u32 sdp_getnextnumtok (const char *str, const char **str_end, } -/* See if the next token in a string is the choose character. The delim - * characters are passed in as a param. The check also will not go past - * a new line char or the end of the string. Skip any delimiters before +/* See if the next token in a string is the choose character. The delim + * characters are passed in as a param. The check also will not go past + * a new line char or the end of the string. Skip any delimiters before * the token. */ tinybool sdp_getchoosetok (const char *str, const char **str_end, @@ -524,10 +489,10 @@ tinybool sdp_getchoosetok (const char *str, const char **str_end, * First a few common definitions. */ -/* - * Constants +/* + * Constants * - * crypto_string = The string used to identify the start of sensative + * crypto_string = The string used to identify the start of sensative * crypto data. * * inline_string = The string used to identify the start of key/salt @@ -536,7 +501,7 @@ tinybool sdp_getchoosetok (const char *str, const char **str_end, * star_string = The string used to overwrite sensative data. * * '*_strlen' = The length of '*_string' in bytes (not including '\0') - */ + */ static const char crypto_string[] = "X-crypto:"; static const int crypto_strlen = sizeof(crypto_string) - 1; static const char inline_string[] = "inline:"; @@ -558,19 +523,19 @@ static const int star_strlen = sizeof(star_string) - 1; * one character and one space is used before the "inline:", * then this translates to a size of (aligned by collumn from * the format shown above): - * + * * 9+ 1+ 1+7+ 1+ 2 = 21 * */ #define MIN_CRYPTO_STRING_SIZE_BYTES 21 -/* - * Utility macros +/* + * Utility macros * * CHAR_IS_WHITESPACE = macro to determine if the passed _test_char * is whitespace. * - * SKIP_WHITESPACE = Macro to advance _cptr to the next non-whitespace + * SKIP_WHITESPACE = Macro to advance _cptr to the next non-whitespace * character. _cptr will not be advanced past _max_cptr. * * FIND_WHITESPACE = Macro to advance _cptr until whitespace is found. @@ -594,8 +559,8 @@ static const int star_strlen = sizeof(star_string) - 1; /* Function: sdp_crypto_debug * Description: Check the passed buffer for sensitive data that should * not be output (such as SRTP Master Key/Salt) and output - * the buffer as debug. Sensitive data will be replaced - * with the '*' character(s). This function may be used + * the buffer as debug. Sensitive data will be replaced + * with the '*' character(s). This function may be used * to display very large buffers so this function ensures * that buginf is not overloaded. * Parameters: buffer pointer to the message buffer to filter. @@ -613,8 +578,8 @@ void sdp_crypto_debug (char *buffer, ulong length_bytes) * X-crypto: inline:|| * Where is the data to elide (filter). */ - for (start=current=buffer; - current<=last-MIN_CRYPTO_STRING_SIZE_BYTES; + for (start=current=buffer; + current<=last-MIN_CRYPTO_STRING_SIZE_BYTES; current++) { if ((*current == 'x') || (*current == 'X')) { result = cpr_strncasecmp(current, crypto_string, crypto_strlen); @@ -643,7 +608,7 @@ void sdp_crypto_debug (char *buffer, ulong length_bytes) if (*current == '|' || *current == '\n') { /* Done, print the stars */ while (star_count > star_strlen) { - /* + /* * This code is only for the case where * too much base64 data was supplied */ @@ -670,14 +635,14 @@ void sdp_crypto_debug (char *buffer, ulong length_bytes) } } -/* +/* * sdp_debug_msg_filter * * DESCRIPTION * Check the passed message buffer for sensitive data that should * not be output (such as SRTP Master Key/Salt). Sensitive data * will be replaced with the '*' character(s). - * + * * PARAMETERS * buffer: pointer to the message buffer to filter. * @@ -740,18 +705,18 @@ char * sdp_debug_msg_filter (char *buffer, ulong length_bytes) /* Function: sdp_checkrange - * Description: This checks the range of a ulong value to make sure its + * Description: This checks the range of a ulong value to make sure its * within the range of 0 and 4Gig. stroul cannot be used since - * for values greater greater than 4G, stroul will either wrap - * around or return ULONG_MAX. + * for values greater greater than 4G, stroul will either wrap + * around or return ULONG_MAX. * Parameters: sdp_p Pointer to the sdp structure * num The number to check the range for * u_val This variable get populated with the ulong value - * if the number is within the range. + * if the number is within the range. * Returns: tinybool - returns TRUE if the number passed is within the * range, FALSE otherwise */ -tinybool sdp_checkrange (sdp_t *sdp_p, char *num, ulong *u_val) +tinybool sdp_checkrange (sdp_t *sdp_p, char *num, ulong *u_val) { ulong l_val; char *endP = NULL; diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_callinfo.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_callinfo.c index 26868d8ed1fe..c76afd86a5f9 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_callinfo.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_callinfo.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include @@ -126,32 +91,32 @@ parse_call_info_parm (char *parm_p, cc_call_info_data_t * feature_data_p) feature_data_p->call_info_feat_data.security = CC_SECURITY_NOT_AUTHENTICATED; } else { CCSIP_DEBUG_ERROR(SIP_F_PREFIX "Unknown security" - " value %s\n", fname, parm_p); + " value %s\n", fname, parm_p); feature_data_p->call_info_feat_data.security = CC_SECURITY_UNKNOWN; } } else { break; } - } else if (!cpr_strncasecmp(parm_p, SIP_CI_POLICY, - sizeof(SIP_CI_POLICY) - 1)) { - parm_p = parm_p + sizeof(SIP_CI_POLICY) - 1; - SKIP_LWS(parm_p); - - if (*parm_p) { - feature_data_p->call_info_feat_data.feature_flag |= CC_POLICY; - if (!cpr_strncasecmp(parm_p, SIP_CI_POLICY_CHAPERONE , - sizeof(SIP_CI_POLICY_CHAPERONE) - 1)) { - feature_data_p->call_info_feat_data.policy = CC_POLICY_CHAPERONE; - } else if (!cpr_strncasecmp(parm_p, SIP_CI_POLICY_UNKNOWN, - sizeof(SIP_CI_POLICY_UNKNOWN) - 1)) { - feature_data_p->call_info_feat_data.policy = CC_POLICY_UNKNOWN; - } else { - CCSIP_DEBUG_ERROR("%s ERROR: Unknown policy" - " value %s\n", fname, parm_p) ; - feature_data_p->call_info_feat_data.policy = CC_POLICY_UNKNOWN; - } - } else { - break; + } else if (!cpr_strncasecmp(parm_p, SIP_CI_POLICY, + sizeof(SIP_CI_POLICY) - 1)) { + parm_p = parm_p + sizeof(SIP_CI_POLICY) - 1; + SKIP_LWS(parm_p); + + if (*parm_p) { + feature_data_p->call_info_feat_data.feature_flag |= CC_POLICY; + if (!cpr_strncasecmp(parm_p, SIP_CI_POLICY_CHAPERONE , + sizeof(SIP_CI_POLICY_CHAPERONE) - 1)) { + feature_data_p->call_info_feat_data.policy = CC_POLICY_CHAPERONE; + } else if (!cpr_strncasecmp(parm_p, SIP_CI_POLICY_UNKNOWN, + sizeof(SIP_CI_POLICY_UNKNOWN) - 1)) { + feature_data_p->call_info_feat_data.policy = CC_POLICY_UNKNOWN; + } else { + CCSIP_DEBUG_ERROR("%s ERROR: Unknown policy" + " value %s\n", fname, parm_p) ; + feature_data_p->call_info_feat_data.policy = CC_POLICY_UNKNOWN; + } + } else { + break; } } else if (!cpr_strncasecmp(parm_p, SIP_CI_ORIENTATION, sizeof(SIP_CI_ORIENTATION) - 1)) { @@ -168,7 +133,7 @@ parse_call_info_parm (char *parm_p, cc_call_info_data_t * feature_data_p) feature_data_p->call_info_feat_data.orientation = CC_ORIENTATION_TO; } else { CCSIP_DEBUG_ERROR(SIP_F_PREFIX "Unknown orientation info" - " value %s\n", fname, parm_p); + " value %s\n", fname, parm_p); feature_data_p->call_info_feat_data.orientation = CC_ORIENTATION_NONE; } } else { @@ -192,11 +157,11 @@ parse_call_info_parm (char *parm_p, cc_call_info_data_t * feature_data_p) feature_data_p->call_info_feat_data.ui_state = CC_UI_STATE_BUSY; } else { CCSIP_DEBUG_ERROR(SIP_F_PREFIX "Unknown call state" - " value %s\n", fname, parm_p); + " value %s\n", fname, parm_p); /* Unknown value, ignore the call state */ - feature_data_p->call_info_feat_data.feature_flag &= + feature_data_p->call_info_feat_data.feature_flag &= ~(CC_UI_STATE); - feature_data_p->call_info_feat_data.ui_state = + feature_data_p->call_info_feat_data.ui_state = CC_UI_STATE_NONE; } } else { @@ -213,7 +178,7 @@ parse_call_info_parm (char *parm_p, cc_call_info_data_t * feature_data_p) feature_data_p->call_info_feat_data.feature_flag |= CC_CALL_INSTANCE; /* Initialized the call instance id, just in case */ - feature_data_p->call_info_feat_data.caller_id.call_instance_id + feature_data_p->call_info_feat_data.caller_id.call_instance_id = 0; /* Parse instance id from line */ temp_p = parm_p; @@ -225,7 +190,7 @@ parse_call_info_parm (char *parm_p, cc_call_info_data_t * feature_data_p) /* Did not find any digit after "call_instance=" */ CCSIP_DEBUG_ERROR(SIP_F_PREFIX "no digits found for" " call_instance parameter.\n", fname); - feature_data_p->call_info_feat_data.feature_flag &= + feature_data_p->call_info_feat_data.feature_flag &= ~(CC_CALL_INSTANCE); break; } else { @@ -252,7 +217,7 @@ parse_call_info_parm (char *parm_p, cc_call_info_data_t * feature_data_p) if (*parm_p) { temp_p = parm_p; if ((!cpr_strncasecmp(parm_p, SIP_CI_PRIORITY_URGENT, - sizeof(SIP_CI_PRIORITY_URGENT) - 1)) || + sizeof(SIP_CI_PRIORITY_URGENT) - 1)) || (!cpr_strncasecmp(parm_p, SIP_CI_PRIORITY_EMERGENCY, sizeof(SIP_CI_PRIORITY_EMERGENCY) - 1))) { feature_data_p->call_info_feat_data.priority = CC_CALL_PRIORITY_URGENT; @@ -262,20 +227,20 @@ parse_call_info_parm (char *parm_p, cc_call_info_data_t * feature_data_p) strtoul_result = strtoul(temp_p, &strtoul_end, 10); if (errno || temp_p == strtoul_end || strtoul_result > MAX_INSTANCES) { - /* + /* * Call instance ID should not exceed max instances * or calls. */ CCSIP_DEBUG_ERROR(SIP_F_PREFIX "invalid call_instance" " value %u\n", fname, (unsigned) strtoul_result); - feature_data_p->call_info_feat_data.feature_flag &= + feature_data_p->call_info_feat_data.feature_flag &= ~(CC_CALL_INSTANCE); } else { instance_id = (uint16_t) strtoul_result; feature_data_p->call_info_feat_data.caller_id.call_instance_id = instance_id; } } - } + } } else if (!cpr_strncasecmp(parm_p, SIP_CI_GCID, sizeof(SIP_CI_GCID) - 1)) { parm_p = parm_p + sizeof(SIP_CI_GCID) - 1; @@ -284,7 +249,7 @@ parse_call_info_parm (char *parm_p, cc_call_info_data_t * feature_data_p) if (*parm_p) { temp_p = strchr(parm_p, SEMI_COLON); if (temp_p) { - unsigned int length = ((temp_p - parm_p)call_info_feat_data.global_call_id, parm_p, length); } else { @@ -561,18 +526,18 @@ ccsip_encode_call_info_hdr (cc_call_info_t *call_info_p, sstrncat(header, SIP_CI_SILENT_STR, MAX_SIP_HEADER_LENGTH - strlen(header)); break; - + case CC_MONITOR_COACHING : sstrncat(header, SIP_CI_COACHING_STR, MAX_SIP_HEADER_LENGTH - strlen(header)); break; - + default: break; - } - } + } + } break; - + case CC_FEAT_TOGGLE_TO_WHISPER_COACHING: sstrncat(header, "callinfo>", MAX_SIP_HEADER_LENGTH - strlen(header)); @@ -580,9 +545,9 @@ ccsip_encode_call_info_hdr (cc_call_info_t *call_info_p, MAX_SIP_HEADER_LENGTH - strlen(header)); sstrncat(header, SIP_CI_COACHING_STR, MAX_SIP_HEADER_LENGTH - strlen(header)); - + break; - + case CC_FEAT_TOGGLE_TO_SILENT_MONITORING: sstrncat(header, "callinfo>", MAX_SIP_HEADER_LENGTH - strlen(header)); @@ -590,9 +555,9 @@ ccsip_encode_call_info_hdr (cc_call_info_t *call_info_p, MAX_SIP_HEADER_LENGTH - strlen(header)); sstrncat(header, SIP_CI_SILENT_STR, MAX_SIP_HEADER_LENGTH - strlen(header)); - - break; - + + break; + default: cpr_free(header); return NULL; @@ -659,7 +624,7 @@ ccsip_process_call_info_header (sipMessage_t *request_p, ccsipCCB_t *ccb) SIP_HEADER_CALL_INFO, call_info_hdrs, MAX_CALL_INFO_HEADERS); - + if (num_call_info_headers > 0) { ccb->in_call_info = (cc_call_info_t *) cpr_calloc(1, sizeof(cc_call_info_t)); @@ -669,16 +634,16 @@ ccsip_process_call_info_header (sipMessage_t *request_p, ccsipCCB_t *ccb) // Parse each Call-Info header for (i = 0; i < MAX_CALL_INFO_HEADERS; i++) { - if (call_info_hdrs[i]) { + if (call_info_hdrs[i]) { ccsip_decode_call_info_hdr(call_info_hdrs[i], ccb->in_call_info); } } - + } else { ccb->in_call_info = NULL; } } - + } /* diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_cc.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_cc.c index 5e12ad4c918d..0a97efcc8b5c 100755 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_cc.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_cc.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "ccapi.h" diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_common_util.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_common_util.c index a767d99b8d45..170bd98e4d3e 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_common_util.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_common_util.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_in.h" #include "ccsip_common_cb.h" @@ -49,7 +14,7 @@ * * @param[in] cb_p - pointer to the header control block. * - * @return none + * @return none * * @pre (cb_p != NULL) */ @@ -81,7 +46,7 @@ void ccsip_common_util_set_dest_ipaddr_port (ccsip_common_cb_t *cb_p) * * @param[in] cb_p - pointer to the header control block. * - * @return none + * @return none * * @pre (cb_p != NULL) */ @@ -112,7 +77,7 @@ void ccsip_common_util_set_src_ipaddr (ccsip_common_cb_t *cb_p) * the first time with valid args. * * @param[in] cb_p - pointer to header control block. - * @param[out] timeout_p - returns the value to be used to set a timer. + * @param[out] timeout_p - returns the value to be used to set a timer. * * @return none * @@ -180,7 +145,7 @@ boolean ccsip_common_util_generate_auth (sipMessage_t *pSipMessage, ccsip_common cred_get_line_credentials(cb_p->dn_line, &credentials, sizeof(credentials.id), sizeof(credentials.pw)); - /* + /* * Extract Authenticate/Proxy-Authenticate header from the message. */ authenticate = sippmh_get_header_val(pSipMessage, AUTH_HDR(response_code), NULL); @@ -265,7 +230,7 @@ void ccsip_util_get_from_entity (sipMessage_t *pSipMessage, char *entity) if (sip_from != NULL) { from_loc = sippmh_parse_from_or_to((char *) sip_from, TRUE); if ((from_loc) && (from_loc->genUrl->schema == URL_TYPE_SIP) && (from_loc->genUrl->u.sipUrl->user)) { - sstrncpy(entity, from_loc->genUrl->u.sipUrl->user, CC_MAX_DIALSTRING_LEN); + sstrncpy(entity, from_loc->genUrl->u.sipUrl->user, CC_MAX_DIALSTRING_LEN); } } if (from_loc) { diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_core.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_core.c index 4852fcbce1d5..1ec92992eec6 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_core.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_core.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdlib.h" @@ -128,7 +93,7 @@ static char *ccsip_find_preallocated_sip_call_id(line_t dn_line); static void ccsip_free_preallocated_sip_call_id(line_t dn_line); static boolean ccsip_handle_cc_hook_event(sipSMEvent_t *sip_sm_event); -extern cc_int32_t dnsGetHostByName (const char *hname, cpr_ip_addr_t *ipaddr_ptr, cc_int32_t timeout, cc_int32_t retries); +extern cc_int32_t dnsGetHostByName (const char *hname, cpr_ip_addr_t *ipaddr_ptr, cc_int32_t timeout, cc_int32_t retries); //CPR TODO: need reference for extern char *Basic_is_phone_forwarded(line_t line); @@ -818,7 +783,7 @@ static const sipSMEventActionFn_t ccsip_handle_default_ev_cc_feature, /*56*//*H_DEFAULT_RECVREQ_ACK_PENDING_EV_CC_FEATURE */ - ccsip_handle_default_recvreq_ack_pending_ev_cc_feature, + ccsip_handle_default_recvreq_ack_pending_ev_cc_feature, /*57*//*H_OOD_REFER_RESPONSE_EV_SIP_1xx */ ccsip_handle_sent_ood_refer_ev_sip_1xx, @@ -836,7 +801,7 @@ static const sipSMEventActionFn_t ccsip_handle_ev_cc_info, /*62*//* H_RELEASE_EV_RELEASE, */ - ccsip_handle_release_ev_release, + ccsip_handle_release_ev_release, }; static uint32_t get_callref(const char *tag) { @@ -849,7 +814,7 @@ static uint32_t get_callref(const char *tag) { sscanf ( ref, "-%d", &callref); break; } - } + } return callref; } @@ -976,7 +941,7 @@ sip_util_extract_sdp (ccsipCCB_t *ccb, sipMessage_t *message) CCSIP_DEBUG_STATE(DEB_F_PREFIX"\nmultipart/mixed No SDP Found!\n", DEB_F_PREFIX_ARGS(SIP_SDP, fname)); } else { for (i = 0; i < message->num_body_parts; i++) { - if (message->mesg_body[i].msgContentTypeValue == + if (message->mesg_body[i].msgContentTypeValue == SIP_CONTENT_TYPE_SDP_VALUE) { content_type = SIP_CONTENT_TYPE_SDP_VALUE; content_length = message->mesg_body[i].msgLength; @@ -987,7 +952,7 @@ sip_util_extract_sdp (ccsipCCB_t *ccb, sipMessage_t *message) } /* - * Check for content + * Check for content */ if ((content_type != SIP_CONTENT_TYPE_SDP_VALUE) || (content_length <= 0)) { @@ -1008,13 +973,13 @@ sip_util_extract_sdp (ccsipCCB_t *ccb, sipMessage_t *message) return (SIP_SDP_ERROR); } /* - * Pasrse the SDP body + * Pasrse the SDP body */ if (sdp_parse(sip_msg_sdp->dest_sdp, &sdp_data, (uint16_t)content_length) != SDP_SUCCESS) { /* unable to parse the SDP */ CCSIP_DEBUG_ERROR(get_debug_string(DEBUG_SIP_PARSE_SDP_ERROR), fname); - + sipsdp_src_dest_free(CCSIP_DEST_SDP_BIT, &sip_msg_sdp); return (SIP_SDP_ERROR); } @@ -1037,7 +1002,7 @@ sip_util_extract_sdp (ccsipCCB_t *ccb, sipMessage_t *message) * Check to see if the sdp->session_id and version_id are * the same. If they are, it could be a session audit. * In most cases, this is handled the same as - * SIP_SDP_SUCCESS. + * SIP_SDP_SUCCESS. */ if (sip_msg_sdp->dest_sdp) { const char *new_session_id = NULL; @@ -1583,7 +1548,7 @@ ccsip_is_special_name_to_mask_display_number (const char *name) if (cpr_strncasecmp(name, INDEX_STR_PRIVATE, 2) == 0) { return (TRUE); } - + /* * Detect monitoring display number. */ @@ -1597,7 +1562,7 @@ ccsip_is_special_name_to_mask_display_number (const char *name) if (cpr_strncasecmp(name, INDEX_STR_COACHING, 2) == 0) { return (TRUE); } - + return (FALSE); } @@ -1618,8 +1583,8 @@ ccsip_is_special_name_to_mask_display_number (const char *name) * the unescaped data (along with the un-inspected host data). However, * various usages in the code calls this with possible input string of * "userinfo@host" or "userinfo" where "userinfo" could contain '@' which - * correctly needs not be escaped. Since the input is flexible as described, - * we've changed to escape the entire input string although the + * correctly needs not be escaped. Since the input is flexible as described, + * we've changed to escape the entire input string although the * host portion, when present, should never has an escaped character anyway. */ @@ -1976,7 +1941,7 @@ ccsip_parse_rpid (ccsipCCB_t *ccb, sipMessage_t *msg) * * Description: Determines if host string received in a SIP URL should * be appended to the calling number for UI display and - * storage in the missed/received calls directory. + * storage in the missed/received calls directory. * Domain from the receive SIP URL will be appended to the * calling number under the following conditions. * 1. Received domain is FQDN and receiving line's proxy address @@ -1985,7 +1950,7 @@ ccsip_parse_rpid (ccsipCCB_t *ccb, sipMessage_t *msg) * is a FQDN that differs from the received domain. * 3. If received domain is dotted ip, it is NOT appended to * the calling number under any condtion. - * + * */ static string_t ccsip_set_url_domain (char *host, string_t callingNumber, string_t calledNumber, line_t line) { @@ -2006,7 +1971,7 @@ static string_t ccsip_set_url_domain (char *host, string_t callingNumber, string if (!address) { /* * Host is not a dotted ip. Treat as a domain name. - * Validate the domain name and then compare the domain name + * Validate the domain name and then compare the domain name * to what is configured for the line. */ target = cpr_strdup(host); @@ -2039,7 +2004,7 @@ static string_t ccsip_set_url_domain (char *host, string_t callingNumber, string include_domain = TRUE; } else { if (strncmp(host, buffer, MAX_SIP_URL_LENGTH) != 0) { - /* + /* * Configured domain differs from received domain */ include_domain = TRUE; @@ -2064,7 +2029,7 @@ static string_t ccsip_set_url_domain (char *host, string_t callingNumber, string * * Returns: char *: pointer to alt_callback_number. * - * Description: Checks to see the x-cisco-callback-number params + * Description: Checks to see the x-cisco-callback-number params * Copies the value to ccb->altCallingNumber * * assumes ccb->best_rpid->loc->genUrl valid @@ -2078,7 +2043,7 @@ void ccsip_set_alt_callback_number(ccsipCCB_t *ccb) while ( (ptr = ccb->best_rpid->loc->genUrl->other_params[param_idx++]) != NULL ) { if ( ! strncasecmp ( ptr, RPID_CALLBACK, RPID_CALLBACK_LEN)) { - ccb->altCallingNumber = + ccb->altCallingNumber = strlib_update(ccb->altCallingNumber, ptr + RPID_CALLBACK_LEN); return; } @@ -2093,7 +2058,7 @@ void ccsip_set_alt_callback_number(ccsipCCB_t *ccb) * Parameters: ccb: call control block * calling: boolean value indicating if message is a * request or response. - * display_enabled: boolean indicating if callerid is blocked. + * display_enabled: boolean indicating if callerid is blocked. * * Returns: boolean: TRUE indicates call id was obtained from RPID. * @@ -2112,7 +2077,7 @@ ccsip_set_caller_id_from_rpid (ccsipCCB_t *ccb, boolean request, boolean update_ char *pUser = NULL; string_t *name; string_t *number; - boolean display_number = TRUE; + boolean display_number = TRUE; boolean private_num = FALSE; line_t line = 0; @@ -2161,10 +2126,10 @@ ccsip_set_caller_id_from_rpid (ccsipCCB_t *ccb, boolean request, boolean update_ if (private_num) { /* * Need to distinguish between privacy=uri and privacy=full - */ + */ if (cpr_strncasecmp(ccb->best_rpid->privacy, PRIVACY_FULL, sizeof(PRIVACY_FULL)) == 0) { /* - * This is used for anonymous call block + * This is used for anonymous call block */ *display_enabled = display_number = FALSE; } else { @@ -2175,13 +2140,13 @@ ccsip_set_caller_id_from_rpid (ccsipCCB_t *ccb, boolean request, boolean update_ } } - /* + /* * Update the alt Calling number if received in the RPID */ if ( (!private_num) ) { ccsip_set_alt_callback_number(ccb); - } + } /* * Append host portion of url if needed. If in CCM mode, skip this step. @@ -2252,7 +2217,7 @@ ccsip_send_callinfo (ccsipCCB_t *ccb, boolean update_caller_id, data.call_info.ui_state = feat_data->ui_state; data.call_info.caller_id.call_instance_id = feat_data->caller_id.call_instance_id; data.call_info.dusting = feat_data->dusting; - sstrncpy(data.call_info.global_call_id, + sstrncpy(data.call_info.global_call_id, ccb->in_call_info->data.call_info_feat_data.global_call_id, CC_GCID_LEN); } @@ -2320,13 +2285,13 @@ ccsip_send_callinfo (ccsipCCB_t *ccb, boolean update_caller_id, data.call_info.caller_id.display_calling_number = FALSE; if(ccb->best_rpid != NULL && ccb->best_rpid->loc->genUrl->u.sipUrl->user != NULL) data.call_info.caller_id.orig_rpid_number = (const char *) ccb->best_rpid->loc->genUrl->u.sipUrl->user; - } + } } /* Include diversion information * Note that a valid ccb->div_info pointer here does not indicate that call is of - * type Forward. It simply means a call to parse diversion header had been made. - */ + * type Forward. It simply means a call to parse diversion header had been made. + */ if (ccb->div_info) { data.call_info.caller_id.last_redirect_name = ccb->div_info->last_redirect_name; data.call_info.caller_id.last_redirect_number = ccb->div_info->last_redirect_number; @@ -2338,8 +2303,8 @@ ccsip_send_callinfo (ccsipCCB_t *ccb, boolean update_caller_id, data.call_info.caller_id.orig_called_name = strlib_empty(); data.call_info.caller_id.orig_called_number = strlib_empty(); } - data.call_info.caller_id.call_type = ccb->call_type; - + data.call_info.caller_id.call_type = ccb->call_type; + /* Set UP update delay flag */ data.call_info.feature_flag &= ~(CC_DELAY_UI_UPDATE); if (delay_update) { @@ -2719,7 +2684,7 @@ ccsip_handle_idle_ev_sip_invite (ccsipCCB_t *ccb, sipSMEvent_t *event) /* * Make sure we have a valid called_number. - */ + */ if ((ccb->calledNumber == NULL) || (ccb->calledNumber[0] == '\0')) { (void) sipSPISendErrorResponse(request, SIP_CLI_ERR_NOT_FOUND, SIP_CLI_ERR_NOT_FOUND_PHRASE, @@ -2832,7 +2797,7 @@ ccsip_handle_idle_ev_sip_invite (ccsipCCB_t *ccb, sipSMEvent_t *event) ccb->wastransferred = TRUE; check_send_487 = TRUE; } else { - is_previous_call_id = sip_sm_is_previous_call_id(replaces_t->callid, + is_previous_call_id = sip_sm_is_previous_call_id(replaces_t->callid, &previous_call_index); replaces_ccb = sip_sm_get_ccb_by_callid(replaces_t->callid); if (replaces_ccb != NULL && replaces_ccb->state == SIP_STATE_RELEASE) { @@ -3027,7 +2992,7 @@ ccsip_handle_idle_ev_sip_invite (ccsipCCB_t *ccb, sipSMEvent_t *event) config_get_value(CFGID_TIMER_T1, &delta, sizeof(delta)); delta = (2 * delta) / 1000; CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"Starting INVITE Local Expires %d" - "timer (%d sec)\n", + "timer (%d sec)\n", DEB_L_C_F_PREFIX_ARGS(SIP_TIMER, ccb->dn_line, ccb->gsm_id, fname), ccb->index, local_expires_timeout + delta); /* @@ -3070,7 +3035,7 @@ ccsip_handle_idle_ev_sip_invite (ccsipCCB_t *ccb, sipSMEvent_t *event) } sipSPISendInviteResponse100(ccb, TRUE); - + /* Inform CSM */ cc_call_id = cc_get_new_call_id(); ccb->gsm_id = cc_call_id; @@ -3115,7 +3080,7 @@ ccsip_handle_idle_ev_sip_invite (ccsipCCB_t *ccb, sipSMEvent_t *event) /* Info Package stuff */ ccsip_parse_send_info_header(request, &recv_info_list); - + if (ccb->wastransferred) { sip_cc_setup(cc_call_id, dn_line, @@ -3246,7 +3211,7 @@ ccsip_attempt_backup_proxy (ccsipCCB_t *ccb) * This fucntion sends mid-call INVITE. * * @param[in] ccb Pointer to ccsipCCB_t structure. - * @param[in] hold_initiated boolean indicating whther this is + * @param[in] hold_initiated boolean indicating whther this is * a mid-call INVITE for HOLD feature. * * @pre (ccb not_eq NULL) @@ -3521,7 +3486,7 @@ ccsip_handle_idle_ev_cc_setup (ccsipCCB_t *ccb, sipSMEvent_t *event) if (!ccsip_attempt_backup_proxy(ccb)) { CCSIP_DEBUG_TASK(DEB_F_PREFIX"Attempt to reach backup proxy failed.\n", DEB_F_PREFIX_ARGS(SIP_PROXY, fname)); - CCSIP_DEBUG_TASK(DEB_F_PREFIX"INVITE will be broadcast.\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"INVITE will be broadcast.\n", DEB_F_PREFIX_ARGS(SIP_PROXY, fname)); } } @@ -3579,7 +3544,7 @@ ccsip_handle_idle_ev_cc_setup (ccsipCCB_t *ccb, sipSMEvent_t *event) ccb->calledNumberLen = (uint16_t) strlen(ccb->calledNumber); } - CCSIP_DEBUG_STATE(DEB_F_PREFIX"All digits collected. Placing the call\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"All digits collected. Placing the call\n", DEB_F_PREFIX_ARGS(SIP_CALL_STATUS, fname)); config_get_line_string(CFGID_LINE_NAME, line_name, ccb->dn_line, sizeof(line_name)); ccb->callingNumber = strlib_update(ccb->callingNumber, line_name); @@ -3594,7 +3559,7 @@ ccsip_handle_idle_ev_cc_setup (ccsipCCB_t *ccb, sipSMEvent_t *event) /* Save the GSM's msg. bodies for future used */ ccsip_save_local_msg_body(ccb, &event->u.cc_msg->msg.setup.msg_body); - + /* * CC_REDIRECT_REASON_DEFLECTION shows that this is an attended transfer */ @@ -3691,7 +3656,7 @@ ccsip_handle_sentinvite_ev_sip_1xx (ccsipCCB_t *ccb, sipSMEvent_t *event) { sipsdp_status_t sdp_status; CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"%d: %s <- SIP 180 RINGING\n", - DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), + DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), ccb->index, sip_util_state2string(ccb->state)); /* check for alert-info in header. @@ -3704,7 +3669,7 @@ ccsip_handle_sentinvite_ev_sip_1xx (ccsipCCB_t *ccb, sipSMEvent_t *event) } */ sdp_status = sip_util_extract_sdp(ccb, response); - + switch (sdp_status) { case SIP_SDP_SUCCESS: case SIP_SDP_SESSION_AUDIT: @@ -3785,14 +3750,14 @@ ccsip_handle_sentinvite_ev_sip_1xx (ccsipCCB_t *ccb, sipSMEvent_t *event) sip_cc_alerting(ccb->gsm_id, ccb->dn_line, response, TRUE); /*UI-STATE tag with value of "BUSY" is being sent to indicate the busy line - *and to support callback feature. GSM needs to be informed so it can + *and to support callback feature. GSM needs to be informed so it can *trigger the LSM to transition to BUSY state and display appropriate - *softkeys. + *softkeys. */ if ((ccb->in_call_info) && (ccb->in_call_info->data.call_info_feat_data.feature_flag & CC_UI_STATE) && (ccb->in_call_info->data.call_info_feat_data.ui_state == CC_UI_STATE_BUSY)) { - CCSIP_DEBUG_STATE(DEB_F_PREFIX"DETECTED UI_STATE=BUSY IN 183.\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"DETECTED UI_STATE=BUSY IN 183.\n", DEB_F_PREFIX_ARGS(SIP_CALL_STATUS, fname)); sip_cc_release(ccb->gsm_id, ccb->dn_line, CC_CAUSE_UI_STATE_BUSY, NULL); } @@ -3802,7 +3767,7 @@ ccsip_handle_sentinvite_ev_sip_1xx (ccsipCCB_t *ccb, sipSMEvent_t *event) case SIP_1XX_CALL_FWD: CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"%d: %s <- SIP 181 CALL IS BEING" - "FORWARDED\n", + "FORWARDED\n", DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), ccb->index, sip_util_state2string(ccb->state)); /* Update connected party info from RPID and Call-Info header */ @@ -3950,7 +3915,7 @@ ccsip_handle_sentinvite_ev_sip_2xx (ccsipCCB_t *ccb, sipSMEvent_t *event) /* * Parse the diversion header which could be present, as in case of - * Auto Pick up + * Auto Pick up */ ccsip_parse_diversion_header (ccb, response); @@ -4250,7 +4215,7 @@ ccsip_handle_sendbye_ev_supervision_disconnect (ccsipCCB_t *ccb, /** * - * Handler for SIP_STATE_RELEASE features. Currently only CANCEL feature is + * Handler for SIP_STATE_RELEASE features. Currently only CANCEL feature is * supported in this state. * * @param line, ccb, event @@ -4291,7 +4256,7 @@ ccsip_handle_release_ev_cc_feature (ccsipCCB_t *ccb, sipSMEvent_t *event) /** * - * Handler for event RELEASE at SIP_STATE_RELEASE. + * Handler for event RELEASE at SIP_STATE_RELEASE. * sipstack is waiting for RELEASE_COMPLETE from gsm, but it got RELEASE from gsm. * so we know that gsm also want to release the call. * to avoid defects like CSCtg46399, we need to send RELEASE_COMPLETE to both sipstack & gsm, @@ -4307,7 +4272,7 @@ ccsip_handle_release_ev_release (ccsipCCB_t *ccb, sipSMEvent_t *event) ccb->index, ccb->dn_line, fname, sip_util_state2string(ccb->state), "sipstack at SIP_STATE_RELEASE received a RELEASE event from gsm"); - + /* send RELEASE_COMPLETE to sipstack */ ccsip_handle_release_complete(ccb, event); @@ -4433,13 +4398,13 @@ ccsip_handle_sentbye_ev_sip_fxx (ccsipCCB_t *ccb, sipSMEvent_t *event) switch (status_code) { case SIP_CLI_ERR_UNAUTH: case SIP_CLI_ERR_PROXY_REQD: - CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"%d: %s\n", - DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), + CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"%d: %s\n", + DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), ccb->index, AUTH_BUGINF(status_code)); if (cred_get_credentials_r(ccb, &credentials) == FALSE) { CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"retries exceeded: %d/%d\n", - DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), + DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), ccb->index, ccb->authen.cred_type, MAX_RETRIES_401); free_sip_message(response); @@ -4450,7 +4415,7 @@ ccsip_handle_sentbye_ev_sip_fxx (ccsipCCB_t *ccb, sipSMEvent_t *event) authenticate = sippmh_get_header_val(response, AUTH_HDR(status_code), NULL); if (authenticate != NULL) { - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Authenticate header %s= %s\n", DEB_F_PREFIX_ARGS(SIP_STATE, fname), + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Authenticate header %s= %s\n", DEB_F_PREFIX_ARGS(SIP_STATE, fname), AUTH_HDR_STR(status_code), authenticate); ccb->retx_counter = 0; sip_authen = sippmh_parse_authenticate(authenticate); @@ -4656,7 +4621,7 @@ ccsip_handle_sentinvite_ev_sip_3xx (ccsipCCB_t *ccb, sipSMEvent_t *event) break; default: CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"%d %d unsupported\n", - DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), + DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), ccb->index, status_code); break; } @@ -4709,7 +4674,7 @@ handle_error_for_state (ccsipCCB_t *ccb, int status_code) sip_sm_change_state(ccb, SIP_STATE_RELEASE); } else if (status_code == SIP_CLI_ERR_REQ_CANCEL) { sip_cc_release(ccb->gsm_id, ccb->dn_line, CC_CAUSE_NO_USER_ANS, NULL); - sip_sm_change_state(ccb, SIP_STATE_RELEASE); + sip_sm_change_state(ccb, SIP_STATE_RELEASE); } else { /* * This should take care of miscellaneous errors including 400 @@ -4764,7 +4729,7 @@ handle_error_for_state (ccsipCCB_t *ccb, int status_code) } else { fail_reason = CC_CAUSE_ERROR; } - + /* ack the feature */ sip_cc_feature_ack(ccb->gsm_id, ccb->dn_line, ccb->featuretype, NULL, fail_reason); @@ -4800,8 +4765,8 @@ handle_error_for_state (ccsipCCB_t *ccb, int status_code) } -void -ccsip_handle_sentinvite_ev_sip_fxx (ccsipCCB_t *ccb, sipSMEvent_t *event) +void +ccsip_handle_sentinvite_ev_sip_fxx (ccsipCCB_t *ccb, sipSMEvent_t *event) { const char *fname = "sentinvite_ev_sip_fxx"; sipMessage_t *response; @@ -4886,7 +4851,7 @@ ccsip_handle_sentinvite_ev_sip_fxx (ccsipCCB_t *ccb, sipSMEvent_t *event) case CC_FEATURE_SELECT: case CC_FEATURE_CANCEL: if (status_code != SIP_CLI_ERR_UNAUTH && status_code != SIP_CLI_ERR_PROXY_REQD) { - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Received error response for ext refer\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Received error response for ext refer\n", DEB_F_PREFIX_ARGS(SIP_CALL_STATUS, fname)); sip_cc_feature_ack(ccb->gsm_id, ccb->dn_line, ccb->featuretype, NULL, CC_CAUSE_ERROR); @@ -4905,8 +4870,8 @@ ccsip_handle_sentinvite_ev_sip_fxx (ccsipCCB_t *ccb, sipSMEvent_t *event) switch (status_code) { case SIP_CLI_ERR_UNAUTH: case SIP_CLI_ERR_PROXY_REQD: - CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"SIP_CLI_ERR_PROXY_REQD: %d: %s\n", - DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), + CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"SIP_CLI_ERR_PROXY_REQD: %d: %s\n", + DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), ccb->index, AUTH_BUGINF(status_code)); /* Send ACK */ @@ -4916,7 +4881,7 @@ ccsip_handle_sentinvite_ev_sip_fxx (ccsipCCB_t *ccb, sipSMEvent_t *event) if (cred_get_credentials_r(ccb, &credentials) == FALSE) { CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"retries exceeded: %d/%d\n", - DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), + DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), ccb->authen.cred_type, MAX_RETRIES_401); /* * Retries exceeded for 40X could be due to remote end @@ -4934,7 +4899,7 @@ ccsip_handle_sentinvite_ev_sip_fxx (ccsipCCB_t *ccb, sipSMEvent_t *event) authenticate = sippmh_get_header_val(response, AUTH_HDR(status_code), NULL); if (authenticate != NULL) { - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Authenticate header %s= %s\n", DEB_F_PREFIX_ARGS(SIP_AUTH, fname), + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Authenticate header %s= %s\n", DEB_F_PREFIX_ARGS(SIP_AUTH, fname), AUTH_HDR_STR(status_code), authenticate); ccb->retx_counter = 0; @@ -5126,7 +5091,7 @@ ccsip_handle_sentinvite_ev_sip_fxx (ccsipCCB_t *ccb, sipSMEvent_t *event) case SIP_CLI_ERR_REQ_PENDING: if (method == sipMethodInvite) { CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"%d Glare detected!\n", - DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), + DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), ccb->index); sipSPISendFailureResponseAck(ccb, response, FALSE, 0); // The other side has detected a glare condition - @@ -5277,7 +5242,7 @@ ccsip_handle_recvinvite_ev_cc_connected (ccsipCCB_t *ccb, sipSMEvent_t *event) (void) sip_platform_localexpires_timer_stop(ccb->index); - CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"SIPSM %d: connected\n", + CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"SIPSM %d: connected\n", DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), ccb->index); /* Send 200 OK */ @@ -5304,7 +5269,7 @@ ccsip_handle_recvinvite_ev_expires_timer (ccsipCCB_t *ccb, sipSMEvent_t *event) { const char *fname = "recvinvite_ev_expires_timer"; - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Sent 200OK but received no ACK\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Sent 200OK but received no ACK\n", DEB_F_PREFIX_ARGS(SIP_ACK, fname)); // Stop the retry timer, if any @@ -5368,7 +5333,7 @@ ccsip_handle_recvinvite_ev_sip_ack (ccsipCCB_t *ccb, sipSMEvent_t *event) return; } else { ccb->oa_state = OA_IDLE; - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Using the SDP in INVITE\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Using the SDP in INVITE\n", DEB_F_PREFIX_ARGS(SIP_ACK, fname)); } break; @@ -5394,7 +5359,7 @@ ccsip_handle_recvinvite_ev_sip_ack (ccsipCCB_t *ccb, sipSMEvent_t *event) sip_sm_change_state(ccb, SIP_STATE_RELEASE); return; } else { - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Using the SDP in INVITE\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Using the SDP in INVITE\n", DEB_F_PREFIX_ARGS(SIP_ACK, fname)); } } @@ -5513,7 +5478,7 @@ ccsip_handle_disconnect_local (ccsipCCB_t *ccb, sipSMEvent_t *event) /* Send BYE message */ ccb->authen.cred_type = 0; - + sipSPISendBye(ccb, alsoString, NULL); if (ccb->state == SIP_STATE_SENT_MIDCALL_INVITE) { sip_sm_change_state(ccb, SIP_STATE_RELEASE); @@ -5542,7 +5507,7 @@ ccsip_handle_disconnect_media_change (ccsipCCB_t *ccb, sipSMEvent_t *event) * Send Invite Response with correct cause message */ code = ccsip_cc_to_sip_cause(cause, &phrase); - if (ccb->state == SIP_STATE_RECV_MIDCALL_INVITE_CCFEATUREACK_PENDING) { + if (ccb->state == SIP_STATE_RECV_MIDCALL_INVITE_CCFEATUREACK_PENDING) { sipSPISendInviteResponse(ccb, (uint16_t) code, phrase, 0, NULL, FALSE /* no SDP */, TRUE /* reTx */); ccb->wait_for_ack = TRUE; @@ -5605,7 +5570,7 @@ ccsip_handle_disconnect_local_early (ccsipCCB_t *ccb, sipSMEvent_t *event) } else { // Defer the CANCEL - Note we'll move to the RELEASE state even if we // defer the CANCEL - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Received CC disconnect without 1xx from far side\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Received CC disconnect without 1xx from far side\n", DEB_F_PREFIX_ARGS(SIP_CALL_STATUS, fname)); CCSIP_DEBUG_STATE(get_debug_string(DEBUG_SIP_ENTRY), ccb->index, ccb->dn_line, fname, @@ -5834,8 +5799,8 @@ ccsip_handle_disconnect_remote (ccsipCCB_t *ccb, sipSMEvent_t *event) cc_feature_data_t data; CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"%d Far end requested Call Transfer, " - "destination=<%s>\n", - DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), + "destination=<%s>\n", + DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), ccb->index, alsoString); sstrncpy(data.xfer.dialstring, alsoString, strlen(alsoString) + 1); data.xfer.cause = CC_CAUSE_XFER_REMOTE; @@ -5849,14 +5814,14 @@ ccsip_handle_disconnect_remote (ccsipCCB_t *ccb, sipSMEvent_t *event) } else { /* Send BYE response message */ if (event->type == E_SIP_BYE) { - /* - * We want to wait for release_complete from GSM before sending - * the 200 OK out, in order to collect call_stats + /* + * We want to wait for release_complete from GSM before sending + * the 200 OK out, in order to collect call_stats */ ccb->flags |= RECD_BYE; } else { (void) sipSPISendByeOrCancelResponse(ccb, request, sipMethodCancel); - // if the reason header contains a reason code of 200 + // if the reason header contains a reason code of 200 // we should pass this forward to gsm reasonHdr = sippmh_get_header_val(request, SIP_HEADER_REASON, NULL); if ( reasonHdr && strcasestr(reasonHdr, "cause=200;") ) { @@ -6182,7 +6147,7 @@ ccsip_handle_process_in_call_options_request (ccsipCCB_t *ccb, sipMessage_t *request; sipMethod_t method = sipMethodInvalid; - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Processing within-dialog OPTIONS request\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Processing within-dialog OPTIONS request\n", DEB_F_PREFIX_ARGS(SIP_CALL_STATUS, fname)); /* Unpack the event */ @@ -6294,7 +6259,7 @@ sip_sm_process_event (sipSMEvent_t *pEvent) if ((event_handler = get_handler_index(ccb->state, pEvent->type)) != H_INVALID_EVENT) { CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"Processing SM event: %d: --0x%08lx--%21s: %s <- %s\n", - DEB_L_C_F_PREFIX_ARGS(SIP_EVT, ccb->dn_line, ccb->gsm_id, fname), + DEB_L_C_F_PREFIX_ARGS(SIP_EVT, ccb->dn_line, ccb->gsm_id, fname), ccb->index, EVENT_ACTION_SM(event_handler), "", sip_util_state2string(ccb->state), sip_util_event2string(pEvent->type)); @@ -6358,7 +6323,7 @@ sip_sm_process_cc_event (cprBuffer_t buf) if (!sip_sm_event.ccb) { sip_cc_release(pCCMsg->msg.setup.call_id, pCCMsg->msg.setup.line, CC_CAUSE_ERROR, NULL); - CCSIP_DEBUG_TASK(DEB_F_PREFIX"No free lines available\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"No free lines available\n", DEB_F_PREFIX_ARGS(SIP_CALL_STATUS, fname)); cc_free_msg_data(sip_sm_event.u.cc_msg); cpr_free(pCCMsg); @@ -6413,7 +6378,7 @@ sip_sm_process_cc_event (cprBuffer_t buf) sip_cc_release(pCCMsg->msg.setup.call_id, pCCMsg->msg.setup.line, CC_CAUSE_ERROR, NULL); } - CCSIP_DEBUG_TASK(DEB_F_PREFIX"No ccb with matching gsm_id = <%d>\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"No ccb with matching gsm_id = <%d>\n", DEB_F_PREFIX_ARGS(SIP_CALL_STATUS, fname), pCCMsg->msg.setup.call_id); cc_free_msg_data(sip_sm_event.u.cc_msg); @@ -6519,7 +6484,7 @@ sip_sm_call_cleanup (ccsipCCB_t *ccb) int i = 0; if (ccb == NULL) { - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Null CCB passed into function.\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Null CCB passed into function.\n", DEB_F_PREFIX_ARGS(SIP_CALL_STATUS, fname)); return; } @@ -6536,7 +6501,7 @@ sip_sm_call_cleanup (ccsipCCB_t *ccb) CCSIP_DEBUG_STATE(get_debug_string(DEBUG_SIP_ENTRY), ccb->index, ccb->dn_line, fname, "Cleaning up the call"); - /* + /* * If there are any shared pointers because of duping * make sure we have taken care of those */ @@ -7154,7 +7119,7 @@ sip_util_get_new_call_id (ccsipCCB_t *ccb) temp_call_id = ccsip_find_preallocated_sip_call_id(ccb->dn_line); if (temp_call_id != NULL) { sstrncpy(ccb->sipCallID, temp_call_id, MAX_SIP_CALL_ID); - CCSIP_DEBUG_STATE(DEB_F_PREFIX"using pre allocated call ID\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"using pre allocated call ID\n", DEB_F_PREFIX_ARGS(SIP_CALL_STATUS, fname)); ccsip_free_preallocated_sip_call_id(ccb->dn_line); return; @@ -7198,9 +7163,9 @@ sip_sm_init (void) int sdpmode = 0; config_get_value(CFGID_SDPMODE, &sdpmode, sizeof(sdpmode)); - + if (!sdpmode) { - + if (ccsip_register_init() == SIP_ERROR) { CCSIP_DEBUG_ERROR(SIP_F_PREFIX"registration initialization failed\n", fname); return SIP_ERROR; @@ -7244,7 +7209,7 @@ sip_sm_init (void) if (sip_subsManager_init() != SIP_OK) { return SIP_ERROR; } - + } /* Initialize SDP Parser */ @@ -7271,7 +7236,7 @@ ccsip_handle_sip_shutdown () case SIP_STATE_RECV_INVITE_PROCEEDING: case SIP_STATE_RECV_INVITE_ALERTING: CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"Received invite: %d: STATE: %s\n", - DEB_L_C_F_PREFIX_ARGS(SIP_STATE, ccb->dn_line, ccb->gsm_id, fname), + DEB_L_C_F_PREFIX_ARGS(SIP_STATE, ccb->dn_line, ccb->gsm_id, fname), ccb->index, sip_util_state2string(ccb->state)); sipSPISendInviteResponse(ccb, SIP_SERV_ERR_INTERNAL, SIP_SERV_ERR_INTERNAL_PHRASE, 0, NULL, @@ -7286,19 +7251,19 @@ ccsip_handle_sip_shutdown () case SIP_STATE_RECV_INVITE_CONNECTED: case SIP_STATE_ACTIVE: default: - CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"Clearing %d STATE: %s\n", - DEB_L_C_F_PREFIX_ARGS(SIP_STATE, ccb->dn_line, ccb->gsm_id, fname), + CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"Clearing %d STATE: %s\n", + DEB_L_C_F_PREFIX_ARGS(SIP_STATE, ccb->dn_line, ccb->gsm_id, fname), ccb->index, sip_util_state2string(ccb->state)); sipSPISendBye(ccb, NULL, NULL); sip_sm_change_state(ccb, SIP_STATE_IDLE); - // send this to make sure GSM goes IDLE if it's currently in CONNECTED - sip_cc_release(ccb->gsm_id, ccb->dn_line, CC_CAUSE_ERROR, NULL); + // send this to make sure GSM goes IDLE if it's currently in CONNECTED + sip_cc_release(ccb->gsm_id, ccb->dn_line, CC_CAUSE_ERROR, NULL); sip_sm_call_cleanup(ccb); break; case SIP_STATE_SENT_INVITE: - CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"Sent invite: Clearing %d STATE: %s\n", - DEB_L_C_F_PREFIX_ARGS(SIP_STATE, ccb->dn_line, ccb->gsm_id, fname), + CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"Sent invite: Clearing %d STATE: %s\n", + DEB_L_C_F_PREFIX_ARGS(SIP_STATE, ccb->dn_line, ccb->gsm_id, fname), ccb->index, sip_util_state2string(ccb->state)); sipSPISendCancel(ccb); sip_sm_change_state(ccb, SIP_STATE_IDLE); @@ -7308,8 +7273,8 @@ ccsip_handle_sip_shutdown () break; case SIP_STATE_SENT_INVITE_CONNECTED: - CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"Sent invite connected: Clearing %d STATE: %s\n", - DEB_L_C_F_PREFIX_ARGS(SIP_STATE, ccb->dn_line, ccb->gsm_id, fname), + CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"Sent invite connected: Clearing %d STATE: %s\n", + DEB_L_C_F_PREFIX_ARGS(SIP_STATE, ccb->dn_line, ccb->gsm_id, fname), ccb->index, sip_util_state2string(ccb->state)); if (sipSPISendAck(ccb, NULL) == FALSE) { CCSIP_DEBUG_ERROR(get_debug_string(DEBUG_GENERAL_FUNCTIONCALL_FAILED), @@ -7323,7 +7288,7 @@ ccsip_handle_sip_shutdown () break; case SIP_STATE_RELEASE: - CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"Release: Clearing %d STATE: %s\n", + CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"Release: Clearing %d STATE: %s\n", DEB_L_C_F_PREFIX_ARGS(SIP_STATE, ccb->dn_line, ccb->gsm_id, fname), ccb->index, sip_util_state2string(ccb->state)); sip_sm_change_state(ccb, SIP_STATE_IDLE); @@ -7370,7 +7335,7 @@ sip_shutdown (void) // Shutdown Subscription Manager (void) sip_subsManager_shut(); - //reset publish handler + //reset publish handler publish_reset(); // Close all sockets @@ -7428,7 +7393,7 @@ sip_restart (void) sip_mode_quiet = FALSE; sip_reg_all_failed = FALSE; ccsip_remove_wlan_classifiers(); - + // Initialize all GSM modules cc_fail_fallback_gsm(CC_SRC_SIP, CC_RSP_COMPLETE, CC_REG_FAILOVER_RSP); } @@ -7436,7 +7401,7 @@ sip_restart (void) void sip_shutdown_phase2 (int action) { - DEF_DEBUG(DEB_F_PREFIX"(%d)\n", + DEF_DEBUG(DEB_F_PREFIX"(%d)\n", DEB_F_PREFIX_ARGS(SIP_CTRL, "sip_shutdown_phase2"), action); sip.taskInited = TRUE; // Forcing sip_shutdown() to execute DEF_DEBUG(DEB_F_PREFIX"sip.taskInited is set to true\n", DEB_F_PREFIX_ARGS(SIP_CTRL, "sip_shutdown_phase2")); @@ -7452,7 +7417,7 @@ sip_shutdown_phase2 (int action) void sip_shutdown_phase1 (int action, int reason) { - DEF_DEBUG(DEB_F_PREFIX"In sip_shutdown_phase1 (%d)\n", + DEF_DEBUG(DEB_F_PREFIX"In sip_shutdown_phase1 (%d)\n", DEB_F_PREFIX_ARGS(SIP_CTRL, "sip_shutdown_phase1"), action); if (sip_reg_all_failed) { // NO CCM available; need not wait for unreg timer @@ -7492,7 +7457,7 @@ sip_sm_get_ccb_by_ccm_id_and_index (int ccmid, line_t idx) ccb = fallback_ccb->ccb; } } - if (ccb != NULL) { + if (ccb != NULL) { if ((ccb->cc_cfg_table_entry == NULL) || (((ti_config_table_t *)(ccb->cc_cfg_table_entry))->ti_specific.ti_ccm.ccm_id != ccm_id)) { /* @@ -7503,7 +7468,7 @@ sip_sm_get_ccb_by_ccm_id_and_index (int ccmid, line_t idx) * that standby cucm has sent. Should not do much harm. */ DEF_DEBUG(DEB_F_PREFIX"ccb index has moved or cfg_table not initialized for the cucm=%s. " - "index=%d ccb=%d. Throwing away the msg.\n",DEB_F_PREFIX_ARGS(SIP_BRANCH, fname), + "index=%d ccb=%d. Throwing away the msg.\n",DEB_F_PREFIX_ARGS(SIP_BRANCH, fname), CCM_ID_PRINT(ccm_id), idx, ccb); ccb = NULL; } @@ -7631,9 +7596,9 @@ sip_sm_get_ccb_next_available (line_t *line_number) /** * sip_sm_get_ccb_by_gsm_id - * + * * This fucntion tries to match the ccbs given the gsm id - * The algorithm tries to match the non duplicate CCB first + * The algorithm tries to match the non duplicate CCB first * If the only match is a DUP_CCB it shall be returned as a match * @param[in] gsm_id GSM ID in the CCB * @@ -7665,7 +7630,7 @@ sip_sm_get_ccb_by_gsm_id (callid_t gsm_id) /** * sip_sm_ccb_match_branch_cseq * - * This fucntion tries to match the Branch and Cseq ID for a + * This fucntion tries to match the Branch and Cseq ID for a * given CCB to see if the values match in the response with the * values sent in the request. * @@ -7677,7 +7642,7 @@ sip_sm_get_ccb_by_gsm_id (callid_t gsm_id) * @pre (sipCseq not_eq NULL) * @pre (via_this not_eq NULL) * - * @return TRUE/FALSE + * @return TRUE/FALSE * */ static boolean @@ -7706,7 +7671,7 @@ sip_sm_ccb_match_branch_cseq (ccsipCCB_t *ccb, " Via's branch parameter in response:" "ccb=0x%x,%d, cseq(trx,msg)=(%d,%d)," "branch(trx,msg)=(%s,%s)\n", - ccb->dn_line, ccb->gsm_id, fname, ccb, + ccb->dn_line, ccb->gsm_id, fname, ccb, ccb->index, trx->cseq_number, sipCseq->number, trx->u.sip_via_branch, via_this->branch_param); @@ -7717,7 +7682,7 @@ sip_sm_ccb_match_branch_cseq (ccsipCCB_t *ccb, CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Method index not found\n", fname); return (FALSE); } - + // The function below attempts to determine more intelligently if there // is an existing dialog to which an incoming message should be directed. // In addition to call-id, it also considers the Req-URI, CSeq, etc. @@ -7761,12 +7726,12 @@ sip_sm_determine_ccb (const char *callid, if (ccb->sip_to_tag[0] != '\0') { if (strcmp(to_loc->tag, ccb->sip_to_tag) == 0) { *ccb_ret = ccb; - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Matched to_tag\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Matched to_tag\n", DEB_F_PREFIX_ARGS(SIP_CALL_STATUS, fname)); break; } else if (strcmp(to_loc->tag, ccb->sip_from_tag) == 0) { *ccb_ret = ccb; - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Matched from_tag\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Matched from_tag\n", DEB_F_PREFIX_ARGS(SIP_CALL_STATUS, fname)); break; } @@ -7819,7 +7784,7 @@ sip_sm_determine_ccb (const char *callid, ccb = &(gGlobInfo.ccbs[i]); if (ccb->ReqURI[0] != '\0') { if (strcmp(ccb->ReqURI, reqURI) == 0) { - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Matched reqURI\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Matched reqURI\n", DEB_F_PREFIX_ARGS(SIP_CALL_STATUS, fname)); *ccb_ret = ccb; break; @@ -7835,7 +7800,7 @@ sip_sm_determine_ccb (const char *callid, (ccb->state < SIP_STATE_ACTIVE)) { // Return this CCB if we match call-id but have // not connected yet - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Matched Call-id - not active.\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Matched Call-id - not active.\n", DEB_F_PREFIX_ARGS(SIP_CALL_STATUS, fname)); *ccb_ret = ccb; break; @@ -7953,7 +7918,7 @@ sip_sm_determine_ccb (const char *callid, } /* - * If the CCB is not NULL and this is a response, then check + * If the CCB is not NULL and this is a response, then check * if the branch and Cseq match. */ if ((*ccb_ret != NULL) && !is_request) { @@ -7977,7 +7942,7 @@ ccsip_handle_default (ccsipCCB_t *ccb, sipSMEvent_t *event) const char *fname = "ccsip_handle_default"; CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"%d No action -> %s\n", - DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), + DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), ccb->index, sip_util_state2string(ccb->state)); } @@ -8040,7 +8005,7 @@ ccsip_handle_default_sip_message (ccsipCCB_t *ccb, sipSMEvent_t *event) * ccsip_handle_default_ev_cc_feature * * The function is a default function for handling CC_FEATURE in the - * state that does not expect CC_FEATURE. + * state that does not expect CC_FEATURE. * * @param[in] ccb Pointer to ccsipCCB_t structure. * @param[in] event Pointer to sipSMEvent_t structure. @@ -8048,7 +8013,7 @@ ccsip_handle_default_sip_message (ccsipCCB_t *ccb, sipSMEvent_t *event) * @pre (ccb not_eq NULL) * * @return N/A - * + * */ void ccsip_handle_default_ev_cc_feature (ccsipCCB_t *ccb, sipSMEvent_t *event) @@ -8087,7 +8052,7 @@ void ccsip_handle_default_recvreq_ack_pending_ev_cc_feature (ccsipCCB_t *ccb, sipSMEvent_t *event) { - const char *fname = + const char *fname = "ccsip_handle_default_recvreq_ack_pending_ev_cc_feature"; cc_features_t feature_type; @@ -8204,8 +8169,8 @@ ccsip_restart_reTx_timer (ccsipCCB_t *ccb, sipMethod_t messageType) } } CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"%d: Restarting timer (%d msec)" - " (msg is %s)\n", - DEB_L_C_F_PREFIX_ARGS(SIP_TIMER, ccb->dn_line, ccb->gsm_id, fname), + " (msg is %s)\n", + DEB_L_C_F_PREFIX_ARGS(SIP_TIMER, ccb->dn_line, ccb->gsm_id, fname), ccb->index, timeout, sipGetMethodString(messageType)); ccb->retx_flag = TRUE; @@ -8288,7 +8253,7 @@ ccsip_handle_obp_error (ccsipCCB_t *ccb, sipMethod_t messageType, cpr_ip_addr_t if (sipSPISendLastMessage(ccb) == TRUE) { ccb->retx_counter++; CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"%d: Resent message: #%d\n", - DEB_L_C_F_PREFIX_ARGS(SIP_MSG_SEND, ccb->dn_line, ccb->gsm_id, fname), + DEB_L_C_F_PREFIX_ARGS(SIP_MSG_SEND, ccb->dn_line, ccb->gsm_id, fname), ccb->index, ccb->retx_counter); ccsip_restart_reTx_timer(ccb, messageType); if (ccb->state == SIP_STATE_RELEASE) { @@ -8376,7 +8341,7 @@ ccsip_pick_a_proxy (ccsipCCB_t *ccb) * Or we are not using DNS SRV and we need to try the backup */ if (dns_error_code != DNS_OK) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Unable to reach proxy, attempting backup.\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Unable to reach proxy, attempting backup.\n", DEB_F_PREFIX_ARGS(SIP_PROXY, fname)); if (ccsip_attempt_backup_proxy(ccb)) { @@ -8426,7 +8391,7 @@ ccsip_pick_a_proxy (ccsipCCB_t *ccb) /* Backup proxy failed as well. Broadcast once */ } else { CCSIP_DEBUG_TASK(DEB_F_PREFIX"Attempt to reach backup proxy" - " failed. Message will be broadcast.\n", + " failed. Message will be broadcast.\n", DEB_F_PREFIX_ARGS(SIP_PROXY, fname)); return 1; } @@ -8474,7 +8439,7 @@ ccsip_handle_icmp_unreachable (ccsipCCB_t *ccb, sipSMEvent_t *event) //we are in a dialog // NOT USED: sipMessage_t *response; - CCSIP_DEBUG_TASK(DEB_F_PREFIX"ICMP received within a dialog.\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"ICMP received within a dialog.\n", DEB_F_PREFIX_ARGS(SIP_CALL_STATUS, fname)); /* * At this point we should be checking to see if we picked up an @@ -8494,7 +8459,7 @@ ccsip_handle_icmp_unreachable (ccsipCCB_t *ccb, sipSMEvent_t *event) sip_cc_release_complete(ccb->gsm_id, ccb->dn_line, CC_CAUSE_NORMAL); sip_sm_call_cleanup(ccb); } else { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"ICMP received outside of a dialog.\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"ICMP received outside of a dialog.\n", DEB_F_PREFIX_ARGS(SIP_CALL_STATUS, fname)); //ccb->retx_counter = 100; //to cause failover to next proxy if one is available ccsip_handle_default_sip_timer(ccb, event); @@ -8561,7 +8526,7 @@ ccsip_handle_default_sip_timer (ccsipCCB_t *ccb, sipSMEvent_t *event) /* Determine if msg to outbound proxy bounced or timed out */ util_ntohl(&out_ip, &event->u.UsrInfo); if ((util_compare_ip(&out_ip, &(ccb->outBoundProxyAddr))) || - ((event->u.UsrInfo.type == CPR_IP_ADDR_INVALID) && + ((event->u.UsrInfo.type == CPR_IP_ADDR_INVALID) && util_check_if_ip_valid(&(ccb->outBoundProxyAddr)))) { ccsip_handle_obp_error(ccb, retxMessageType, &(event->u.UsrInfo)); return; @@ -8586,7 +8551,7 @@ ccsip_handle_default_sip_timer (ccsipCCB_t *ccb, sipSMEvent_t *event) if (ccb->retx_counter <= max_retx) { if (sipSPISendLastMessage(ccb) == TRUE) { CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"%d:Resent message: #%d\n", - DEB_L_C_F_PREFIX_ARGS(SIP_MSG_SEND, ccb->dn_line, ccb->gsm_id, fname), + DEB_L_C_F_PREFIX_ARGS(SIP_MSG_SEND, ccb->dn_line, ccb->gsm_id, fname), ccb->index, ccb->retx_counter); } if (ccb->state == SIP_STATE_RELEASE) { @@ -8888,15 +8853,15 @@ sip_sm_check_retx_timers (ccsipCCB_t *ccb, sipMessage_t *canceller_message) } /* In the case of TCP/TLS, no messages are retransmitted unless there was a - * socket open (CPR_ENOTCONN) error. Hence there are no retx timers started - * in this case. If any retx timers were started, then, in the - * sip_platform_msg_timer_start procedure, the message_buffer_len would be + * socket open (CPR_ENOTCONN) error. Hence there are no retx timers started + * in this case. If any retx timers were started, then, in the + * sip_platform_msg_timer_start procedure, the message_buffer_len would be * set to a valid non-zero value. */ conn_type = sipTransportGetTransportType(1, TRUE, ccb); if ((!cpr_strcasecmp(conn_type, "TCP") || !cpr_strcasecmp(conn_type, "TLS")) && 0 == sipPlatformUISMTimers[ccb->index].message_buffer_len) { - /* This is not an error in case of TCP/TLS. + /* This is not an error in case of TCP/TLS. */ return; } @@ -8983,8 +8948,8 @@ sip_sm_check_retx_timers (ccsipCCB_t *ccb, sipMessage_t *canceller_message) (strcmp(canceller_callid, retx_callid) == 0)) { sip_platform_msg_timer_stop(ccb->index); CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"%d: Stopping reTx timer.\n" - "(callid=%s, cseq=%u, cseq_method=%s)\n", - DEB_L_C_F_PREFIX_ARGS(SIP_TIMER, ccb->dn_line, ccb->gsm_id, fname), + "(callid=%s, cseq=%u, cseq_method=%s)\n", + DEB_L_C_F_PREFIX_ARGS(SIP_TIMER, ccb->dn_line, ccb->gsm_id, fname), ccb->index, retx_callid, retx_cseq, sipGetMethodString(retx_cseq_method)); @@ -9005,9 +8970,9 @@ sip_sm_check_retx_timers (ccsipCCB_t *ccb, sipMessage_t *canceller_message) } else { CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"%d:CSeq mismatch:\n(Rx: callid=%s," " cseq=%u, cseq_method=%s),\n(reTx: callid=%s," - " cseq=%u, cseq_method=%s)\n", - DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), - ccb->index, + " cseq=%u, cseq_method=%s)\n", + DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), + ccb->index, canceller_callid, canceller_cseq, sipGetMethodString(canceller_cseq_method), retx_callid, retx_cseq, @@ -9344,7 +9309,7 @@ sip_sm_update_to_from_on_callsetup_finalresponse (ccsipCCB_t *ccb, /* ccb->sip_to_tag[0] = '\0'; */ } CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"%d: Recorded to_tag=<%s>\n", - DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), + DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), ccb->index, ccb->sip_to_tag); sippmh_free_location(to_loc); } @@ -9444,7 +9409,7 @@ ccsip_handle_active_ev_cc_feature (ccsipCCB_t *ccb, sipSMEvent_t *event) } break; case CC_FEATURE_B2BCONF: - case CC_FEATURE_SELECT: + case CC_FEATURE_SELECT: case CC_FEATURE_B2B_JOIN: case CC_FEATURE_CANCEL: break; @@ -9609,7 +9574,7 @@ ccsip_handle_active_ev_cc_feature_xfer (ccsipCCB_t *ccb, sipSMEvent_t *event) */ *domainloc++ = '@'; xfer_ccb = sip_sm_get_ccb_by_target_call_id(ccb->con_call_id); - if ((xfer_ccb != NULL) && + if ((xfer_ccb != NULL) && util_check_if_ip_valid(&(xfer_ccb->dest_sip_addr)) && (ccb->featuretype == CC_FEATURE_XFER)) { /* @@ -9812,7 +9777,7 @@ ccsip_handle_active_ev_sip_invite (ccsipCCB_t *ccb, sipSMEvent_t *event) // If we have an outstanding INVITE that we sent then we have glare if (get_method_request_trx_index(ccb, sipMethodInvite, TRUE) > -1) { CCSIP_DEBUG_STATE(DEB_L_C_F_PREFIX"%d Glare condition detected \n", - DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), + DEB_L_C_F_PREFIX_ARGS(SIP_CALL_STATUS, ccb->dn_line, ccb->gsm_id, fname), ccb->index); // return 491 (void) sipSPISendErrorResponse(request, SIP_CLI_ERR_REQ_PENDING, @@ -9922,7 +9887,7 @@ ccsip_handle_active_ev_sip_invite (ccsipCCB_t *ccb, sipSMEvent_t *event) /*FALLTHROUGH*/ default: - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Waiting for SDP in ACK\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Waiting for SDP in ACK\n", DEB_F_PREFIX_ARGS(SIP_SDP, fname)); /* * Update connected party info from RPID and Call-Info header. @@ -9976,14 +9941,14 @@ ccsip_handle_active_2xx (ccsipCCB_t *ccb, sipSMEvent_t *event) /** * ccsip_handle_sentinvite_midcall_ev_cc_feature - * + * * The function handles for CC_FEATURE during mid call invite. - * + * * @param[in] ccb Pointer to ccsipCCB_t structure. * @param[in] event Pointer to sipSMEvent_t structure. - * + * * @pre (ccb not_eq NULL) - * + * * @return N/A */ void ccsip_handle_sentinvite_midcall_ev_cc_feature (ccsipCCB_t *ccb, @@ -10029,7 +9994,7 @@ void ccsip_handle_sentinvite_midcall_ev_cc_feature (ccsipCCB_t *ccb, * * @return N/A */ -void ccsip_handle_sentinvite_midcall_ev_sip_2xx (ccsipCCB_t *ccb, +void ccsip_handle_sentinvite_midcall_ev_sip_2xx (ccsipCCB_t *ccb, sipSMEvent_t *event) { const char *fname = "ccsip_handle_sentinvite_midcall_ev_sip_2xx"; @@ -10082,7 +10047,7 @@ void ccsip_handle_sentinvite_midcall_ev_sip_2xx (ccsipCCB_t *ccb, &data, CC_CAUSE_NORMAL); break; case CC_FEATURE_RESUME: - case CC_FEATURE_MEDIA: + case CC_FEATURE_MEDIA: sip_cc_mv_msg_body_to_cc_msg(&data.resume.msg_body, response); sip_cc_feature_ack(ccb->gsm_id, ccb->dn_line, ccb->featuretype, &data, CC_CAUSE_NORMAL); @@ -10090,9 +10055,9 @@ void ccsip_handle_sentinvite_midcall_ev_sip_2xx (ccsipCCB_t *ccb, default: /* * Other features are not expected. - */ + */ CCSIP_DEBUG_ERROR(DEB_L_C_F_PREFIX"%d: unexpected feature %d\n", - ccb->dn_line, ccb->gsm_id, fname, + ccb->dn_line, ccb->gsm_id, fname, ccb->index, ccb->featuretype); sip_cc_feature_ack(ccb->gsm_id, ccb->dn_line, ccb->featuretype, NULL, CC_CAUSE_ERROR); @@ -10226,7 +10191,7 @@ ccsip_handle_recvmidcallinvite_ccfeatureackpending_ev_cc_feature_ack ( } sipSPISendInviteResponse200(ccb); /* HOLD */ - sip_sm_change_state(ccb, + sip_sm_change_state(ccb, SIP_STATE_RECV_MIDCALL_INVITE_SIPACK_PENDING); break; @@ -10238,7 +10203,7 @@ ccsip_handle_recvmidcallinvite_ccfeatureackpending_ev_cc_feature_ack ( msg_body = &event->u.cc_msg->msg.feature_ack.data.resume.msg_body; ccsip_save_local_msg_body(ccb, msg_body); } - if (event->u.cc_msg->msg.feature_ack.cause == CC_CAUSE_PAYLOAD_MISMATCH || + if (event->u.cc_msg->msg.feature_ack.cause == CC_CAUSE_PAYLOAD_MISMATCH || event->u.cc_msg->msg.feature_ack.cause == CC_CAUSE_NO_MEDIA || event->u.cc_msg->msg.feature_ack.cause == CC_CAUSE_ERROR) { /* @@ -10271,7 +10236,7 @@ void ccsip_handle_recvmidcallinvite_sipackpending_ev_sip_ack (ccsipCCB_t *ccb, sipSMEvent_t *event) { - const char *fname = + const char *fname = "ccsip_handle_recvmidcallinvite_sipackpending_ev_sip_ack"; sipMessage_t *request; uint16_t request_check_reason_code = 0; @@ -11145,7 +11110,7 @@ ccsip_handle_active_ev_sip_update (ccsipCCB_t *ccb, sipSMEvent_t *event) switch (sdp_status) { case SIP_SDP_SESSION_AUDIT: - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Received Session Audit SDP in UPDATE\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Received Session Audit SDP in UPDATE\n", DEB_F_PREFIX_ARGS(SIP_SDP, fname)); /*FALLTHROUGH*/ @@ -11227,7 +11192,7 @@ ccsip_handle_active_ev_sip_update (ccsipCCB_t *ccb, sipSMEvent_t *event) * Function: ccsip_handle_recvupdatemedia_ccfeatureackpending_ev_cc_feature_ack * * Description: This function handles a CC_FEATURE_ACK from GSM that the - * GSM sends in response to an new media SDP or hold received in an UPDATE + * GSM sends in response to an new media SDP or hold received in an UPDATE * message and sent to it. ***********************************************************************/ void @@ -11262,7 +11227,7 @@ ccsip_handle_recvupdatemedia_ccfeatureackpending_ev_cc_feature_ack ( if (cause == CC_CAUSE_NORMAL || cause == CC_CAUSE_NO_RESUME) { cause = CC_CAUSE_OK; } - + /* new media acks put the sdp in the resume area as well */ if (event->u.cc_msg->msg.feature_ack.data_valid) { msg_body = &event->u.cc_msg->msg.feature_ack.data.resume.msg_body; @@ -11343,7 +11308,7 @@ ccsip_get_notify_service_control (sipMessage_t *pSipMessage) return NULL; } if (pSipMessage->mesg_body[0].msgContentTypeValue != SIP_CONTENT_TYPE_TEXT_PLAIN_VALUE) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received NOTIFY with unknown body type\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received NOTIFY with unknown body type\n", DEB_F_PREFIX_ARGS(SIP_NOTIFY, fname)); if (sipSPISendErrorResponse(pSipMessage, SIP_CLI_ERR_BAD_REQ, SIP_CLI_ERR_BAD_REQ_PHRASE, @@ -11360,7 +11325,7 @@ ccsip_get_notify_service_control (sipMessage_t *pSipMessage) pSipMessage->mesg_body[0].msgLength); if (scp == NULL) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received NOTIFY but couldn't parse body\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received NOTIFY but couldn't parse body\n", DEB_F_PREFIX_ARGS(SIP_NOTIFY, fname)); if (sipSPISendErrorResponse(pSipMessage, SIP_CLI_ERR_BAD_REQ, SIP_CLI_ERR_BAD_REQ_PHRASE, @@ -11374,7 +11339,7 @@ ccsip_get_notify_service_control (sipMessage_t *pSipMessage) } // Verify common mandatory parms if (scp->registerCallID == NULL) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received NOTIFY but no mandatory params\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received NOTIFY but no mandatory params\n", DEB_F_PREFIX_ARGS(SIP_NOTIFY, fname)); if (sipSPISendErrorResponse(pSipMessage, SIP_CLI_ERR_BAD_REQ, SIP_CLI_ERR_BAD_REQ_PHRASE, @@ -11395,7 +11360,7 @@ ccsip_get_notify_service_control (sipMessage_t *pSipMessage) (scp->dialplanVersionStamp != NULL) && (scp->softkeyVersionStamp != NULL)) ? TRUE : FALSE; if (!all_provided) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received NOTIFY but no mandatory params\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received NOTIFY but no mandatory params\n", DEB_F_PREFIX_ARGS(SIP_NOTIFY, fname)); if (sipSPISendErrorResponse(pSipMessage, SIP_CLI_ERR_BAD_REQ, SIP_CLI_ERR_BAD_REQ_PHRASE, @@ -11417,7 +11382,7 @@ ccsip_get_notify_service_control (sipMessage_t *pSipMessage) * firmwareInactiveLoadId is not mandatory field because of backward * compatibility purposes. So, it is not included in the following * check. - */ + */ all_provided = ((scp->configVersionStamp != NULL) && (scp->dialplanVersionStamp != NULL) && (scp->softkeyVersionStamp != NULL) && @@ -11425,7 +11390,7 @@ ccsip_get_notify_service_control (sipMessage_t *pSipMessage) (scp->firmwareLoadId != NULL) && (scp->loadServer != NULL) && (scp->logServer != NULL)) ? TRUE : FALSE; - if (!all_provided) + if (!all_provided) { CCSIP_DEBUG_TASK(SIP_F_PREFIX "Incorrect message format or missing " "param value for [configVer/cucmResult] in" @@ -11436,7 +11401,7 @@ ccsip_get_notify_service_control (sipMessage_t *pSipMessage) "\nppid=%s\n\n", fname, (scp->configVersionStamp != NULL) ? scp->configVersionStamp : "", - (scp->dialplanVersionStamp != NULL) ? + (scp->dialplanVersionStamp != NULL) ? scp->dialplanVersionStamp:"", (scp->softkeyVersionStamp != NULL) ? scp->softkeyVersionStamp : "", @@ -11481,7 +11446,7 @@ ccsip_get_notify_service_control (sipMessage_t *pSipMessage) // Call Platform API for actually performing the called for action if (param_match && ccb != NULL) { if (sip_regmgr_get_cc_mode(ccb->dn_line) != REG_MODE_CCM) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received NOTIFY in non CCM mode\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received NOTIFY in non CCM mode\n", DEB_F_PREFIX_ARGS(SIP_NOTIFY, fname)); if (sipSPISendErrorResponse(pSipMessage, SIP_CLI_ERR_BAD_REQ, SIP_CLI_ERR_BAD_REQ_PHRASE, @@ -11493,7 +11458,7 @@ ccsip_get_notify_service_control (sipMessage_t *pSipMessage) return NULL; } } else { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received NOTIFY, callid doesn't match\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received NOTIFY, callid doesn't match\n", DEB_F_PREFIX_ARGS(SIP_NOTIFY, fname)); if (sipSPISendErrorResponse(pSipMessage, SIP_CLI_ERR_BAD_REQ, SIP_CLI_ERR_BAD_REQ_PHRASE, @@ -11506,7 +11471,7 @@ ccsip_get_notify_service_control (sipMessage_t *pSipMessage) } /* NOTIFY message validated and scp allocated */ - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received NOTIFY, callid matches\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received NOTIFY, callid matches\n", DEB_F_PREFIX_ARGS(SIP_NOTIFY, fname)); return scp; } @@ -11538,7 +11503,7 @@ ccsip_handle_unsolicited_notify (ccsipCCB_t *ccb, sipSMEvent_t *event) } } else { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Unsupported unsolicited notify event\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Unsupported unsolicited notify event\n", DEB_F_PREFIX_ARGS(SIP_NOTIFY, fname)); if (sipSPISendErrorResponse(request, SIP_CLI_ERR_BAD_REQ, SIP_CLI_ERR_BAD_REQ_PHRASE, @@ -11565,7 +11530,7 @@ void free_duped (ccsipCCB_t *dup_ccb) /** * This function dups the origCCB and returns a new ccb. It applies - * to only TEL CCBs. The contents of the new CCB is determined by dupCCBFlags. + * to only TEL CCBs. The contents of the new CCB is determined by dupCCBFlags. * * dupCCBFlag values are: * DUPED_CCB 0x01 @@ -11573,17 +11538,17 @@ void free_duped (ccsipCCB_t *dup_ccb) * DUP_CCB_INIT_STATE 0x04 * DUP_CCB_REINIT_DNS 0x08 * DUP_CCB_STOLEN_FEAT_DATA 0x10 - * if this flag is set and ccb->feature_data is NULL, then + * if this flag is set and ccb->feature_data is NULL, then * feature data was stolen from this ccb. - * + * * if this flag is set and ccb->feature_data is non-NULL, then * this ccb stole the feature_data pointer from the mother_ccb. * - * The concept of duping is to maximize sharing of + * The concept of duping is to maximize sharing of * data structures by pointer sharing where it makes sense. * The companion function of freeDupedCCB() is aware that * of the duping. ccb->dup_flags will remember the duping - * attributes (flags shown above) and will free members + * attributes (flags shown above) and will free members * appropriately. * * @param origCCB @@ -11629,11 +11594,11 @@ create_dupCCB (ccsipCCB_t *origCCB, int dup_flags) if (!(dup_flags & DUP_CCB_REINIT_DNS)) { dupCCB->SRVhandle = NULL; dupCCB->ObpSRVhandle = NULL; - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Reiniting DNS fields in duped ccb\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Reiniting DNS fields in duped ccb\n", DEB_F_PREFIX_ARGS(SIP_CALL_STATUS, fname)); } else { //TBD - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Not reiniting DNS fields in duped ccb\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Not reiniting DNS fields in duped ccb\n", DEB_F_PREFIX_ARGS(SIP_CALL_STATUS, fname)); } @@ -11648,12 +11613,12 @@ create_dupCCB (ccsipCCB_t *origCCB, int dup_flags) sip_util_get_new_call_id(dupCCB); sstrncpy(dupCCB->sipCallID, outOfDialogPrefix, sizeof(dupCCB->sipCallID)); - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Using new Call-ID for OutofDialog ccb\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Using new Call-ID for OutofDialog ccb\n", DEB_F_PREFIX_ARGS(SIP_CALL_STATUS, fname)); } else { dupCCB->record_route_info = sippmh_copy_record_route(origCCB->record_route_info); - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Copied mother CCB's route set.\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Copied mother CCB's route set.\n", DEB_F_PREFIX_ARGS(SIP_CALL_STATUS, fname)); } @@ -11750,7 +11715,7 @@ create_dupCCB (ccsipCCB_t *origCCB, int dup_flags) return dupCCB; } -void +void ccsip_handle_sent_ood_refer_ev_sip_1xx (ccsipCCB_t *ccb, sipSMEvent_t *event) { const char *fname = "ccsip_handle_sent_ood_refer_ev_sip_1xx"; @@ -11763,7 +11728,7 @@ ccsip_handle_sent_ood_refer_ev_sip_1xx (ccsipCCB_t *ccb, sipSMEvent_t *event) ccsip_handle_sentinvite_ev_sip_1xx(ccb, event); } -void +void ccsip_handle_sent_ood_refer_ev_sip_2xx (ccsipCCB_t *ccb, sipSMEvent_t *event) { const char *fname = "ccsip_handle_sent_ood_refer_ev_sip_2xx"; @@ -11777,7 +11742,7 @@ ccsip_handle_sent_ood_refer_ev_sip_2xx (ccsipCCB_t *ccb, sipSMEvent_t *event) sip_sm_call_cleanup(ccb); } -void +void ccsip_handle_sent_ood_refer_ev_sip_fxx (ccsipCCB_t *ccb, sipSMEvent_t *event) { const char *fname = "ccsip_handle_sent_ood_refer_ev_sip_fxx"; @@ -12033,12 +11998,12 @@ ccsip_get_join_info (ccsipCCB_t *ccb, sipMessage_t *request) /* OK to continue to send CC_MSG_SETUP because DCSM will hold CC_FEATURE_JOIN until */ /* DEF is in the CONNECTED state to process the JOIN msg. */ } - + ff_check = cpr_strcasecmp(join_ccb->sip_from_tag, ccb->join_info->from_tag); ft_check = cpr_strcasecmp(join_ccb->sip_from_tag, ccb->join_info->to_tag); tt_check = cpr_strcasecmp(join_ccb->sip_to_tag, ccb->join_info->to_tag); tf_check = cpr_strcasecmp(join_ccb->sip_to_tag, ccb->join_info->from_tag); - + // In this issue, the correct match is to match F/F and T/T, or to match F/T and T/F. // All other cases are error. // So, (ff_check==0 && tt_check==0) || (ft_check==0 && tf_check==0) is the correct match @@ -12282,7 +12247,7 @@ ccsip_handle_cc_hook_event (sipSMEvent_t *sip_sm_event) } if (sip_regmgr_get_cc_mode(line_number) != REG_MODE_CCM) { /* this is not CCM environment */ - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Exiting Not CCM mode\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Exiting Not CCM mode\n", DEB_F_PREFIX_ARGS(SIP_CALL_STATUS, fname)); return TRUE; } diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_debug.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_debug.c index 68fa1570f1b4..b7d571e4f76e 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_debug.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_debug.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "debug.h" #include "phone_debug.h" @@ -52,8 +17,8 @@ cc_int32_t SipDebugTask = 1; /* SIP Task output */ cc_int32_t SipDebugRegState = 0; /* SIP Registration State Mach. output */ /** - * SipRelDevEnabled flag is not a debug print flag. It actually turns - * on and off reliable delivery module in sip layer. We will keep + * SipRelDevEnabled flag is not a debug print flag. It actually turns + * on and off reliable delivery module in sip layer. We will keep * this on as retransmissions are enabled on CUCM by default even for TCP transport */ int32_t SipRelDevEnabled = 1; /* Is reliable delivery on? */ @@ -92,7 +57,7 @@ cc_int32_t g_dcsmDebug = 0; * valid cc_remote_ipaddr) */ -void ccsip_dump_send_msg_info (char *msg, sipMessage_t *pSIPMessage, +void ccsip_dump_send_msg_info (char *msg, sipMessage_t *pSIPMessage, cpr_ip_addr_t *cc_remote_ipaddr, uint16_t cc_remote_port) { @@ -119,7 +84,7 @@ void ccsip_dump_send_msg_info (char *msg, sipMessage_t *pSIPMessage, if (callid == NULL) { /* No REQ CSEQ, fill with blank */ callid = ""; - } + } /* For messages starting with SIP add 8 byte. default * debugs do not show all the SIP message information @@ -132,7 +97,7 @@ void ccsip_dump_send_msg_info (char *msg, sipMessage_t *pSIPMessage, disp_buf = &msg[8]; } else { disp_buf = msg; - } + } if ((strncmp(disp_buf, SIP_METHOD_REGISTER, sizeof(SIP_METHOD_REGISTER)-1) == 0) && (!dump_reg_msg)) { return; @@ -142,18 +107,18 @@ void ccsip_dump_send_msg_info (char *msg, sipMessage_t *pSIPMessage, disp_buf = NULL; } - + if (disp_buf != NULL) { DEF_DEBUG(DEB_F_PREFIX"<%s:%-4d>:%c%c%c%c%c%c%c: %-10s :%-6s::%s\n", DEB_F_PREFIX_ARGS(SIP_MSG_SEND, fname), ipaddr_str, cc_remote_port, - disp_buf[0], - disp_buf[1], - disp_buf[2], - disp_buf[3], - disp_buf[4], - disp_buf[5], - disp_buf[6], + disp_buf[0], + disp_buf[1], + disp_buf[2], + disp_buf[3], + disp_buf[4], + disp_buf[5], + disp_buf[6], req_uri, cseq, callid); } else { @@ -179,7 +144,7 @@ void ccsip_dump_send_msg_info (char *msg, sipMessage_t *pSIPMessage, * valid cc_remote_ipaddr) */ -void ccsip_dump_recv_msg_info (sipMessage_t *pSIPMessage, +void ccsip_dump_recv_msg_info (sipMessage_t *pSIPMessage, cpr_ip_addr_t *cc_remote_ipaddr, uint16_t cc_remote_port) { @@ -208,7 +173,7 @@ void ccsip_dump_recv_msg_info (sipMessage_t *pSIPMessage, if (callid == NULL) { /* No REQ CSEQ, fill with blank */ callid = ""; - } + } if (!dump_reg_msg) { if (strstr(cseq, SIP_METHOD_REGISTER) != NULL) { @@ -230,23 +195,23 @@ void ccsip_dump_recv_msg_info (sipMessage_t *pSIPMessage, } } else { /* - * It is possible that this function is called with + * It is possible that this function is called with * invalid message or partially received. */ disp_buf = NULL; } - + if (disp_buf != NULL) { DEF_DEBUG(DEB_F_PREFIX"<%s:%-4d>:%c%c%c%c%c%c%c: %-10s :%-6s::%s\n", DEB_F_PREFIX_ARGS(SIP_MSG_RECV, fname), ipaddr_str, cc_remote_port, - disp_buf[0], - disp_buf[1], - disp_buf[2], - disp_buf[3], - disp_buf[4], - disp_buf[5], - disp_buf[6], + disp_buf[0], + disp_buf[1], + disp_buf[2], + disp_buf[3], + disp_buf[4], + disp_buf[5], + disp_buf[6], req_uri, cseq, callid); } else { diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_info.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_info.c index 25051aed184f..d58b022785a6 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_info.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_info.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdio.h" diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_messaging.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_messaging.c index b936a9d09f3e..d9a79651e953 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_messaging.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_messaging.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "plstr.h" #include "cpr_types.h" @@ -564,7 +529,7 @@ sipSPISetRPID (ccsipCCB_t *ccb, boolean request) sizeof(display_name)); ip_type = sipTransportGetPrimServerAddress(ccb->dn_line, src_addr_str); - + sstrncpy(remote_party_id_buf, "\"", MAX_SIP_URL_LENGTH); escaped_url_len = 1; escaped_url_len += @@ -1032,8 +997,8 @@ sipSPISendInviteMidCall (ccsipCCB_t *ccb, boolean expires) /* Successfully constructed msg with new URI for this INVITE to send out. * Update URIOriginal before sending out. */ - ccb->ReqURIOriginal = strlib_update(ccb->ReqURIOriginal, ccb->ReqURI); - + ccb->ReqURIOriginal = strlib_update(ccb->ReqURIOriginal, ccb->ReqURI); + /* Enable reTx and send */ ccb->retx_counter = 0; if (SendRequest(ccb, request, sipMethodInvite, TRUE, TRUE, TRUE) == FALSE) { @@ -1100,7 +1065,7 @@ sipSPISendAck (ccsipCCB_t *ccb, sipMessage_t *response) } response_cseq_number = response_cseq_structure->number; cpr_free(response_cseq_structure); - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Cseq from response = %d \n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Cseq from response = %d \n", DEB_F_PREFIX_ARGS(SIP_ACK, "sipSPISendAck"), response_cseq_number); } else { trx_index = get_method_request_trx_index(ccb, sipMethodInvite, TRUE); @@ -1108,7 +1073,7 @@ sipSPISendAck (ccsipCCB_t *ccb, sipMessage_t *response) return (FALSE); } response_cseq_number = ccb->sent_request[trx_index].cseq_number; - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Cseq from ccb = %d \n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Cseq from ccb = %d \n", DEB_F_PREFIX_ARGS(SIP_ACK, "sipSPISendAck"), response_cseq_number); } @@ -2468,8 +2433,8 @@ sipSPISendInviteResponse (ccsipCCB_t *ccb, if (statusCode != SIP_1XX_TRYING) { /* * The RPID header is not sent in the 100 Trying because the response is directly - * sent from the SIP stack.The information needed for building the RPID is updated - * by the gsm later. + * sent from the SIP stack.The information needed for building the RPID is updated + * by the gsm later. */ rpid_flag = sipSPISetRPID(ccb, FALSE); if (rpid_flag == RPID_ENABLED) { @@ -2490,7 +2455,7 @@ sipSPISendInviteResponse (ccsipCCB_t *ccb, UPDATE_FLAGS(flag, tflag); tflag = sipSPIAddCallStats(ccb, response); - + UPDATE_FLAGS(flag, tflag); /* If build error detected, cleanup and do not send message */ if (flag != STATUS_SUCCESS) { @@ -2727,7 +2692,7 @@ sipSPISendErrorResponse (sipMessage_t *msg, "en"); UPDATE_FLAGS(flag, tflag); } - + if (status_code == SIP_CLI_ERR_NOT_ALLOWED) { // Add Allow snprintf(temp, MAX_SIP_HEADER_LENGTH, "%s,%s,%s,%s,%s,%s,%s,%s,%s", @@ -2735,7 +2700,7 @@ sipSPISendErrorResponse (sipMessage_t *msg, SIP_METHOD_INVITE, SIP_METHOD_NOTIFY, SIP_METHOD_OPTIONS, SIP_METHOD_REFER, SIP_METHOD_UPDATE, SIP_METHOD_SUBSCRIBE); tflag = sippmh_add_text_header(response, SIP_HEADER_ALLOW, temp); - UPDATE_FLAGS(flag, tflag); + UPDATE_FLAGS(flag, tflag); } /* Write CSeq */ @@ -3512,7 +3477,7 @@ sipSPIAddRouteHeaders (sipMessage_t *msg, ccsipCCB_t *ccb, if (route[0] != '\0') { if (sippmh_add_text_header(msg, SIP_HEADER_ROUTE, route) == STATUS_SUCCESS) { - CCSIP_DEBUG_MESSAGE(DEB_F_PREFIX"Adding route = %s\n", + CCSIP_DEBUG_MESSAGE(DEB_F_PREFIX"Adding route = %s\n", DEB_F_PREFIX_ARGS(SIP_ROUTE, fname), route); if (result_route) { sstrncpy(result_route, route, result_route_length); @@ -4001,7 +3966,7 @@ sipSPICheckRequest (ccsipCCB_t *ccb, sipMessage_t *request) "current= %d, last= %d.\n", DEB_F_PREFIX_ARGS(SIP_CSEQ, fname), request_cseq_number, ccb->last_recv_request_cseq); - + return (SIP_CLI_ERR_BAD_REQ); } if (request_cseq_number == ccb->last_recv_request_cseq) { @@ -4011,7 +3976,7 @@ sipSPICheckRequest (ccsipCCB_t *ccb, sipMessage_t *request) DEB_F_PREFIX_ARGS(SIP_CSEQ, fname), sipGetMethodString(request_cseq_method), sipGetMethodString(ccb->last_recv_request_cseq_method)); - + return (SIP_CLI_ERR_BAD_REQ); } } @@ -4618,7 +4583,7 @@ sipSPICheckResponse (ccsipCCB_t *ccb, sipMessage_t *response) return (SIP_MESSAGING_ERROR_STALE_RESP); } CCSIP_DEBUG_MESSAGE(DEB_F_PREFIX"Response match: callid=%s, cseq=%u, " - "cseq_method=%s\n", DEB_F_PREFIX_ARGS(SIP_RESP, fname), + "cseq_method=%s\n", DEB_F_PREFIX_ARGS(SIP_RESP, fname), callID, response_cseq_number, sipGetMethodString(response_method)); @@ -5854,7 +5819,7 @@ is_extended_feature (ccsipCCB_t *ccb) if (ccb) { switch (ccb->featuretype) { case CC_FEATURE_B2BCONF: - case CC_FEATURE_CANCEL: + case CC_FEATURE_CANCEL: return TRUE; default: return FALSE; @@ -5902,14 +5867,14 @@ sipSPIGenRequestURI (ccsipCCB_t *ccb, sipMethod_t sipmethod, boolean initInvite) sstrncpy(dest_sip_addr_str, ccb->reg.proxy, MAX_IPADDR_STR_LEN); - if (ccb->reg.addr.type == CPR_IP_ADDR_IPV6) { + if (ccb->reg.addr.type == CPR_IP_ADDR_IPV6) { *domainloc++ = '['; } sstrncpy(domainloc, dest_sip_addr_str, MAX_SIP_URL_LENGTH - (domainloc - ccb->ReqURI)); - if (ccb->reg.addr.type == CPR_IP_ADDR_IPV6) { + if (ccb->reg.addr.type == CPR_IP_ADDR_IPV6) { *domainloc++ = ']'; } } @@ -6035,7 +6000,7 @@ sipSPIGenRequestURI (ccsipCCB_t *ccb, sipMethod_t sipmethod, boolean initInvite) (lr || (ccb->state >= SIP_STATE_SENT_INVITE_CONNECTED))) { // Use Contact info ONLY if loose routing or // if we're fully connected - otherwise use proxy - CCSIP_DEBUG_STATE(DEB_F_PREFIX"Forming Req-URI: using Contact\n", + CCSIP_DEBUG_STATE(DEB_F_PREFIX"Forming Req-URI: using Contact\n", DEB_F_PREFIX_ARGS(SIP_REQ_URI, fname)); if ((sipMethodInvite == sipmethod) && @@ -6333,7 +6298,7 @@ sipSPIAddContactHeader (ccsipCCB_t *ccb, sipMessage_t *request) } /** - * Convert phone name to upper case + * Convert phone name to upper case * * @param phone_name - phone name * @@ -6353,14 +6318,14 @@ void convert_phone_name_to_upper_case(char *phone_name) * * eg: Reason: SIP;cause=200;text="cisco:22 Name=SEP000000000000 * Load=SIP70.8-2-25 Last=reset-reset - * + * * @param ccb call control block * @param request sip message * - * @return status + * @return status * success: STATUS_SUCCESS * failure: STATUS_FAILURE - * + * * @pre (ccb not_eq NULL) * @pre (request not_eq NULL) * @@ -6375,14 +6340,14 @@ sipSPIAddReasonHeader (ccsipCCB_t *ccb, sipMessage_t *request) char image_a[MAX_LOAD_ID_STRING]; char image_b[MAX_LOAD_ID_STRING]; int active_partition; - int unreg_reason_code = 0; + int unreg_reason_code = 0; char unreg_reason_str[MAX_UNREG_REASON_STR_LEN]; - if (ccb->send_reason_header) { + if (ccb->send_reason_header) { // should only be set when the phone is registering after a restart/reset platform_get_wired_mac_address(mac_address); - - snprintf(phone_name, MAX_PHONE_NAME_LEN, "SEP%04x%04x%04x", mac_address[0] * 256 + mac_address[1], + + snprintf(phone_name, MAX_PHONE_NAME_LEN, "SEP%04x%04x%04x", mac_address[0] * 256 + mac_address[1], mac_address[2] * 256 + mac_address[3], mac_address[4] * 256 + mac_address[5]); @@ -6394,11 +6359,11 @@ sipSPIAddReasonHeader (ccsipCCB_t *ccb, sipMessage_t *request) unreg_reason_str[0] = '\0'; get_reason_string(unreg_reason_code, unreg_reason_str, MAX_UNREG_REASON_STR_LEN); active_partition = platGetActiveInactivePhoneLoadName(image_a, image_b, MAX_LOAD_ID_STRING); - snprintf(pReasonStr, MAX_SIP_HEADER_LENGTH, + snprintf(pReasonStr, MAX_SIP_HEADER_LENGTH, "SIP;cause=200;text=\"cisco-alarm:%d Name=%s ActiveLoad=%s InactiveLoad=%s Last=%s", unreg_reason_code, phone_name, (active_partition == 1) ? image_a:image_b, (active_partition == 1) ? image_b:image_a, unreg_reason_str); - sstrncat(pReasonStr, "\"", + sstrncat(pReasonStr, "\"", MAX_SIP_HEADER_LENGTH - strlen(pReasonStr) - 1); return (sippmh_add_text_header(request, SIP_HEADER_REASON, pReasonStr)); } else { @@ -6408,12 +6373,12 @@ sipSPIAddReasonHeader (ccsipCCB_t *ccb, sipMessage_t *request) } /** - * Return the reason string that is to be returned + * Return the reason string that is to be returned * corresponding to the unreg reason that is to be sent * in the register message. - * - * @param unreg_reason - unreg reason code - * @param char * - reason string corresponding to the code + * + * @param unreg_reason - unreg reason code + * @param char * - reason string corresponding to the code * @return none * */ @@ -7128,7 +7093,7 @@ AddGeneralHeaders (ccsipCCB_t *ccb, time_exp); break; - case SIP_HEADER_REASON_BIT: + case SIP_HEADER_REASON_BIT: tflag = sipSPIAddReasonHeader(ccb, request); break; @@ -7268,8 +7233,8 @@ AddGeneralHeaders (ccsipCCB_t *ccb, if (ip_mode == CPR_IP_MODE_DUAL) { tflag = sippmh_add_text_header(request, SIP_HEADER_REQUIRE, "sdp-anat"); } - break; - + break; + case SIP_HEADER_RETRY_AFTER_BIT: tflag = sippmh_add_int_header(request, SIP_HEADER_RETRY_AFTER, @@ -7491,7 +7456,7 @@ sipSPISendNotifyResponse (ccsipCCB_t *ccb, cc_causes_t cause) * @pre (ccb not_eqs NULL) * */ -boolean +boolean sipSPIGenerateReferredByHeader (ccsipCCB_t *ccb) { char line_name[MAX_LINE_NAME_SIZE]; @@ -7500,7 +7465,7 @@ sipSPIGenerateReferredByHeader (ccsipCCB_t *ccb) char pReferByStr[MAX_SIP_URL_LENGTH]; boolean retval = FALSE; cpr_ip_type ip_type; - + /* Initialize */ line_name[0] = '\0'; escaped_line_name[0] = '\0'; @@ -7521,7 +7486,7 @@ sipSPIGenerateReferredByHeader (ccsipCCB_t *ccb) } ip_type = sipTransportGetPrimServerAddress(ccb->dn_line, dest_sip_addr_str); - + if (escaped_line_name[0] != '\0') { if (ip_type == CPR_IP_ADDR_IPV6) { snprintf(pReferByStr, MAX_SIP_URL_LENGTH, "", @@ -7543,7 +7508,7 @@ sipSPIGenerateReferredByHeader (ccsipCCB_t *ccb) /* * Function: sipSPIBuildRegisterHeaders * - * Parameters: + * Parameters: * ccsipCCB_t * - pointer to the ccb used for registration * const char * user - used to build the headers * int expires_int - registration expiry time @@ -7555,7 +7520,7 @@ sipSPIGenerateReferredByHeader (ccsipCCB_t *ccb) * */ sipMessage_t * -sipSPIBuildRegisterHeaders(ccsipCCB_t *ccb, +sipSPIBuildRegisterHeaders(ccsipCCB_t *ccb, const char *user, int expires_int) { @@ -7642,7 +7607,7 @@ sipSPIBuildRegisterHeaders(ccsipCCB_t *ccb, messageflag.flags |= SIP_HEADER_AUTHENTICATION_BIT; } - if (ccb->send_reason_header) { + if (ccb->send_reason_header) { messageflag.flags |= SIP_HEADER_REASON_BIT; } diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform.c index ebb52c3c6222..de752158a28e 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdio.h" @@ -140,7 +105,7 @@ sip_platform_handle_service_control_notify (sipServiceControl_t *scp) case SERVICE_CONTROL_ACTION_APPLY_CONFIG: // call the function to process apply config NOTIFY message. - platform_apply_config(scp->configVersionStamp, + platform_apply_config(scp->configVersionStamp, scp->dialplanVersionStamp, scp->fcpVersionStamp, scp->cucm_result, @@ -149,7 +114,7 @@ sip_platform_handle_service_control_notify (sipServiceControl_t *scp) scp->loadServer, scp->logServer, scp->ppid); - break; + break; default: break; diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform_tcp.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform_tcp.c index 0ee6b9ece628..bbc09c320662 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform_tcp.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform_tcp.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_ipc.h" @@ -64,9 +29,9 @@ */ extern cc_config_table_t CC_Config_Table[]; extern ccm_act_stdby_table_t CCM_Active_Standby_Table; -extern cpr_sockaddr_t *sip_set_sockaddr(cpr_sockaddr_storage *psock_storage, uint16_t family, +extern cpr_sockaddr_t *sip_set_sockaddr(cpr_sockaddr_storage *psock_storage, uint16_t family, cpr_ip_addr_t ip_addr, uint16_t port, uint16_t *addr_len); -extern void ccsip_dump_recv_msg_info(sipMessage_t *pSIPMessage, +extern void ccsip_dump_recv_msg_info(sipMessage_t *pSIPMessage, cpr_ip_addr_t *cc_remote_ipaddr, uint16_t cc_remote_port); @@ -158,11 +123,11 @@ ccsipSocketSetPushBit (cpr_socket_t fd, int optval) } #endif /* NOT_AVAILABLE_WIN32 */ -static boolean ccsipIsSecureType(sipSPIConnId_t connid) +static boolean ccsipIsSecureType(sipSPIConnId_t connid) { if (sip_tcp_conn_tab[connid].soc_type == SIP_SOC_TLS) { return TRUE; - } + } return FALSE; } /** @@ -279,7 +244,7 @@ sip_tcp_set_sock_options (int fd) if (status != SIP_SUCCESS) { return FALSE; } - + /* Set the keepalive option */ status = ccsipSocketSetKeepAlive(fd, optval); if (status != SIP_SUCCESS) { @@ -396,13 +361,13 @@ sip_tcp_purge_entry (sipSPIConnId_t connid) return; } secure = ccsipIsSecureType(connid); - + (void) sip_tcp_detach_socket(entry->fd); (void) sipSocketClose(entry->fd, secure); CCSIP_DEBUG_MESSAGE(DEB_F_PREFIX"Socket fd: %d closed for connid %ld with " "address: %i, remote port: %u\n", DEB_F_PREFIX_ARGS(SIP_TCP_MSG, fname), entry->fd, connid, entry->ipaddr, entry->port); - + entry->fd = -1; /* Free the connection table entry in the BEGINNING ! */ sipTcpFlushRetrySendQueue(entry); entry->ipaddr = ip_addr_invalid; @@ -484,14 +449,14 @@ sip_tcp_create_connection (sipSPIMessage_t *spi_msg) (void) sipSocketClose(new_fd, FALSE); return INVALID_SOCKET; } - + if (sip_tcp_set_sock_options(new_fd) != TRUE) { CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Socket set option failed.\n", fname); } sip_config_get_net_device_ipaddr(&local_ipaddr); - + memset(&local_sock_addr, 0, sizeof(local_sock_addr)); (void) sip_set_sockaddr(&local_sock_addr, af_listen, local_ipaddr, 0, &addr_len); @@ -505,11 +470,11 @@ sip_tcp_create_connection (sipSPIMessage_t *spi_msg) (void) sipSocketClose(new_fd, FALSE); sip_tcp_conn_tab[idx].fd = INVALID_SOCKET; return INVALID_SOCKET; - } + } memset(&sock_addr, 0, sizeof(sock_addr)); - (void) sip_set_sockaddr(&sock_addr, af_listen, create_msg->addr, + (void) sip_set_sockaddr(&sock_addr, af_listen, create_msg->addr, (uint16_t)(create_msg->port), &addr_len); sip_tcp_conn_tab[idx].fd = new_fd; @@ -518,17 +483,17 @@ sip_tcp_create_connection (sipSPIMessage_t *spi_msg) sip_tcp_conn_tab[idx].context = spi_msg->context; sip_tcp_conn_tab[idx].dirtyFlag = FALSE; sip_tcp_conn_tab[idx].addr = sock_addr; - + if (cprConnect(new_fd, (cpr_sockaddr_t *)&sock_addr, addr_len) == CPR_FAILURE) { if (errno == EWOULDBLOCK || errno == EINPROGRESS) { char ipaddr_str[MAX_IPADDR_STR_LEN]; ipaddr2dotted(ipaddr_str, &create_msg->addr); - + /* connect in progress. Include this socket in select */ sip_tcp_conn_tab[idx].state = SOCK_CONNECT_PENDING; - + CCSIP_DEBUG_MESSAGE(SIP_F_PREFIX"socket connection in progress errno:%d" "ipaddr: %s, port: %d\n", fname, errno, ipaddr_str, create_msg->port); @@ -737,15 +702,15 @@ sip_tcp_createconnfailed_to_spi (cpr_ip_addr_t *ipaddr, int last_cpr_err = cpr_errno; CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"Active server going down due to " "%s. ip_addr:%s\n", DEB_F_PREFIX_ARGS(SIP_TCP_MSG, fname), - last_cpr_err == CPR_ETIMEDOUT ? "ETIMEDOUT": - last_cpr_err == CPR_ECONNABORTED ? "ECONNABORTED": + last_cpr_err == CPR_ETIMEDOUT ? "ETIMEDOUT": + last_cpr_err == CPR_ECONNABORTED ? "ECONNABORTED": last_cpr_err == CPR_ECONNRESET ? "CM_RESET_TCP": "CM_CLOSED_TCP", ip_addr_str); ccb = sip_sm_get_ccb_by_index(REG_CCB_START); ccm_table_entry = ccm_active_table_entry; - - } else if (standby_ti_common && + + } else if (standby_ti_common && util_compare_ip(&(standby_ti_common->addr), ipaddr) && standby_ti_common->port == port) { /* @@ -753,7 +718,7 @@ sip_tcp_createconnfailed_to_spi (cpr_ip_addr_t *ipaddr, */ CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"Standby server going down " "ip_addr=%s\n", - DEB_F_PREFIX_ARGS(SIP_TCP_MSG, fname), + DEB_F_PREFIX_ARGS(SIP_TCP_MSG, fname), ip_addr_str); ccb = sip_sm_get_ccb_by_index(REG_BACKUP_CCB); @@ -804,14 +769,14 @@ sip_tcp_createconnfailed_to_spi (cpr_ip_addr_t *ipaddr, config_get_value(CFGID_SIP_RETX, &retx_value, sizeof(retx_value)); ccb->retx_counter = retx_value + 1; CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"send a SIP_TMR_REG_RETRY" - "message so this cucm ip:%s can be put in fallback list \n", + "message so this cucm ip:%s can be put in fallback list \n", DEB_F_PREFIX_ARGS(SIP_TCP_MSG, fname), ip_addr_str); if (ccsip_register_send_msg(SIP_TMR_REG_RETRY, ccb->index) != SIP_REG_OK) { CCSIP_DEBUG_ERROR(SIP_F_PREFIX"REG send message failed.\n", fname); ccsip_register_cleanup(ccb, TRUE); } - + } } } @@ -841,7 +806,7 @@ sip_tcp_read_socket (cpr_socket_t this_fd) connid = sip_tcp_fd_to_connid(this_fd); if (connid == -1) { - CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Read failed for unknown socket %d.\n", + CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Read failed for unknown socket %d.\n", fname, this_fd); return; } @@ -875,7 +840,7 @@ sip_tcp_read_socket (cpr_socket_t this_fd) sip_tcp_conn_tab[connid].prev_bytes = 0; if (sip_tcp_buf == NULL) { - CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Unable to realloc tcp_msg buffer memory.\n", + CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Unable to realloc tcp_msg buffer memory.\n", fname); cpr_free(sip_tcp_conn_tab[connid].prev_msg); sip_tcp_conn_tab[connid].prev_msg = NULL; @@ -895,7 +860,7 @@ sip_tcp_read_socket (cpr_socket_t this_fd) fname, (nbytes + offset), (MAX_PAYLOAD_SIZE + 1)); - CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Dropping SIP message %s", + CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Dropping SIP message %s", fname, sip_tcp_buf); cpr_free(sip_tcp_buf); return; @@ -903,7 +868,7 @@ sip_tcp_read_socket (cpr_socket_t this_fd) } else { sip_tcp_buf = (char *) cpr_malloc(CPR_MAX_MSG_SIZE + 1); if (sip_tcp_buf == NULL) { - CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Unable to malloc tcp_msg buffer memory.\n", + CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Unable to malloc tcp_msg buffer memory.\n", fname); return; } @@ -920,7 +885,7 @@ sip_tcp_read_socket (cpr_socket_t this_fd) * Remote connection closure or broken pipe - post a message * to sip transport and wait for connection close command. */ - CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"CUCM closed TCP connection.\n", + CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"CUCM closed TCP connection.\n", DEB_F_PREFIX_ARGS(SIP_TCP_MSG, fname)); sip_tcp_conn_tab[connid].error_cause = SOCKET_REMOTE_CLOSURE; @@ -986,14 +951,14 @@ sipTcpQueueSendData (int total_len, int connid, if (entry->sendQueue == NULL) { entry->sendQueue = sll_create(sip_tcp_find_msg); if (entry->sendQueue == NULL) { - CCSIP_DEBUG_ERROR("%s Failed to create sendQueue to buffer data!\n", fname); + CCSIP_DEBUG_ERROR("%s Failed to create sendQueue to buffer data!\n", fname); return; } } sendData = (ccsipTCPSendData_t *) cpr_malloc(sizeof(ccsipTCPSendData_t)); if (sendData == NULL) { - CCSIP_DEBUG_ERROR("%s Failed to allocate memory for sendData!\n", fname); + CCSIP_DEBUG_ERROR("%s Failed to allocate memory for sendData!\n", fname); return; } memset(sendData, 0, sizeof(ccsipTCPSendData_t)); @@ -1003,7 +968,7 @@ sipTcpQueueSendData (int total_len, int connid, if (sendData->data) { sstrncpy(sendData->data, buf, total_len); } else { - CCSIP_DEBUG_ERROR("%s Failed to allocate memory for sendData->data!\n", fname); + CCSIP_DEBUG_ERROR("%s Failed to allocate memory for sendData->data!\n", fname); cpr_free(sendData); return; } @@ -1015,7 +980,7 @@ sipTcpQueueSendData (int total_len, int connid, sendData->ip_sig_tos = ip_sig_tos; (void) sll_append(entry->sendQueue, sendData); - CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"Data queued length %d\n", + CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"Data queued length %d\n", DEB_F_PREFIX_ARGS(SIP_TCP_MSG, fname), total_len); if (send_msg_q_size > max_tcp_send_msg_q_size) { @@ -1057,7 +1022,7 @@ sip_tcp_resend (int connid) boolean secure; if (!VALID_CONNID(connid)) { - CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Resend failed for unknown socket %d.\n", + CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Resend failed for unknown socket %d.\n", fname, connid); return; } @@ -1088,7 +1053,7 @@ sip_tcp_resend (int connid) sip_tcp_conn_tab[connid].port, sip_tcp_conn_tab[connid].context, SOCKET_CONNECT_ERROR, connid); - CCSIP_DEBUG_ERROR("%s: Socket send error." + CCSIP_DEBUG_ERROR("%s: Socket send error." "Purge queued entry data.\n", fname); } return; @@ -1098,7 +1063,7 @@ sip_tcp_resend (int connid) cpr_free(qElem->data); (void) sll_remove(entry->sendQueue, qElem); cpr_free(qElem); - CCSIP_DEBUG_REG_STATE("%s: sent out successfully, dequeue an entry.\n", fname); + CCSIP_DEBUG_REG_STATE("%s: sent out successfully, dequeue an entry.\n", fname); qElem = (ccsipTCPSendData_t *) sll_next(entry->sendQueue, NULL); } /* while qElem */ @@ -1126,17 +1091,17 @@ sip_tcp_channel_send (cpr_socket_t s, char *buf, uint32_t len) sip_tcp_conn_t *entry; boolean secure; - /* convert socket to connid */ + /* convert socket to connid */ connid = sip_tcp_fd_to_connid(s); if (!VALID_CONNID(connid)) { CCSIP_DEBUG_ERROR("%s: Couldn't map socket to a valid connid!\n", fname); - return SIP_TCP_SEND_ERROR; + return SIP_TCP_SEND_ERROR; } - /* use connid we can get this socket's entry in sip_tcp_conn_tab[] */ + /* use connid we can get this socket's entry in sip_tcp_conn_tab[] */ entry = sip_tcp_conn_tab + connid; /* secd requires that the socket should be in connected state - * to send message. Return if the status is pending. + * to send message. Return if the status is pending. * Currently this gets control in fallback state. The retry timer * event in fallback state will resend the message. */ @@ -1157,7 +1122,7 @@ sip_tcp_channel_send (cpr_socket_t s, char *buf, uint32_t len) sip_tcp_createconnfailed_to_spi(&(sip_tcp_conn_tab[connid].ipaddr), sip_tcp_conn_tab[connid].port, sip_tcp_conn_tab[connid].context, - SOCKET_CONNECT_ERROR, connid); + SOCKET_CONNECT_ERROR, connid); CCSIP_DEBUG_ERROR(SIP_F_PREFIX"TLS socket connect failed %d\n", fname, s); return SIP_TCP_SEND_ERROR; @@ -1198,7 +1163,7 @@ sip_tcp_channel_send (cpr_socket_t s, char *buf, uint32_t len) TRUE, 0x0); break; } - if (cpr_errno != CPR_ENOTCONN) { + if (cpr_errno != CPR_ENOTCONN) { CCSIP_DEBUG_ERROR(SIP_F_PREFIX"socket error=%d=\n", fname, errno); sip_tcp_createconnfailed_to_spi(&(sip_tcp_conn_tab[connid].ipaddr), sip_tcp_conn_tab[connid].port, @@ -1225,7 +1190,7 @@ sipTcpFreeSendQueue (int connid) static const char *fname = "sipTcpFreeSendQueue"; sip_tcp_conn_t *entry; - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Free TCP send queue for connid %d \n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Free TCP send queue for connid %d \n", DEB_F_PREFIX_ARGS(SIP_TCP_MSG, fname), connid); if (!VALID_CONNID(connid)) { return; @@ -1246,10 +1211,10 @@ sipTcpFreeSendQueue (int connid) */ cpr_socket_t sip_tcp_create_conn_using_blocking_socket (sipSPIMessage_t *spi_msg) { - + cpr_socket_t server_conn_handle = INVALID_SOCKET; server_conn_handle = sip_tcp_create_connection(spi_msg); - + return server_conn_handle; } diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform_timers.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform_timers.c index b9da1d9ff465..7de215d44815 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform_timers.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform_timers.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_string.h" @@ -818,7 +783,7 @@ sip_platform_subnot_periodic_timer_callback (void *data) /** ** sip_platform_reg_all_fail_timer_start * Starts a timer when all registrations fail. - * + * * @param msec Value of the timer to be started * * @return SIP_OK if timer could be started; else SIP_ERROR @@ -845,8 +810,8 @@ sip_platform_reg_all_fail_timer_start (uint32_t msec) /** ** sip_platform_reg_all_fail_timer_stop - * Stops the Reg-All Fail timer - * + * Stops the Reg-All Fail timer + * * @param none * * @return SIP_OK if timer could be stopped; else SIP_ERROR @@ -987,16 +952,16 @@ int sip_platform_pass_through_timer_start (uint32_t sec) { static const char fname[] = "sip_platform_pass_through_timer_start"; - + if (sip_platform_pass_through_timer_stop() == SIP_ERROR) { return SIP_ERROR; - } + } if (cprStartTimer(sipPassThroughTimer, sec*1000, NULL) == CPR_FAILURE) { CCSIP_DEBUG_STATE(get_debug_string(DEBUG_SIP_FUNCTIONCALL_FAILED), 0, 0, fname, "cprStartTimer"); return SIP_ERROR; } - + CCSIP_DEBUG_REG_STATE("%s: Regmgr Pass Through Timer started for %lu secs\n", fname, sec); return SIP_OK; } @@ -1014,7 +979,7 @@ int sip_platform_pass_through_timer_stop (void) { static const char fname[] = "sip_platform_pass_through_timer_stop"; - + if (cprCancelTimer(sipPassThroughTimer) == CPR_FAILURE) { CCSIP_DEBUG_STATE(get_debug_string(DEBUG_SIP_FUNCTIONCALL_FAILED), 0, 0, fname, "cprCancelTimer"); diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform_tls.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform_tls.c index 567c7621f05d..7183841780c1 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform_tls.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform_tls.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_ipc.h" @@ -63,7 +28,7 @@ cpr_socket_t sip_tls_create_connection(sipSPIMessage_t *spi_msg, boolean blocking, sec_level_t sec); -extern cpr_sockaddr_t *sip_set_sockaddr(cpr_sockaddr_storage *psock_storage, uint16_t family, +extern cpr_sockaddr_t *sip_set_sockaddr(cpr_sockaddr_storage *psock_storage, uint16_t family, cpr_ip_addr_t ip_addr, uint16_t port, uint16_t *addr_len); /* @@ -121,7 +86,7 @@ sip_tls_create_connection (sipSPIMessage_t *spi_msg, boolean blocking, ipaddr2dotted(ipaddr_str, &create_msg->addr); ret = platSecIsServerSecure(); if (ret != PLAT_SOCK_SECURE) { - CCSIP_DEBUG_ERROR(SIP_F_PREFIX + CCSIP_DEBUG_ERROR(SIP_F_PREFIX "Secure connection is not created because" " there is no secure servers\n", fname); return INVALID_SOCKET; @@ -137,7 +102,7 @@ sip_tls_create_connection (sipSPIMessage_t *spi_msg, boolean blocking, } else if (sec == ENCRYPTED) { conn_mode = PLAT_SOCK_ENCRYPTED; } else { - CCSIP_DEBUG_ERROR(SIP_F_PREFIX + CCSIP_DEBUG_ERROR(SIP_F_PREFIX "Secure connection is not created. Security mode was" " not encrypyted or authenticated.\n", fname); conn_mode = PLAT_SOCK_NON_SECURE; @@ -149,10 +114,10 @@ sip_tls_create_connection (sipSPIMessage_t *spi_msg, boolean blocking, tos_dscp_val, /* TOS value */ conn_mode, /* The mode (Auth/Encry/None) */ &sec_port); /* local port */ - + if (sock < 0) { - CCSIP_DEBUG_ERROR(SIP_F_PREFIX + CCSIP_DEBUG_ERROR(SIP_F_PREFIX "Secure connect failed!!\n",fname); return INVALID_SOCKET; } @@ -162,13 +127,13 @@ sip_tls_create_connection (sipSPIMessage_t *spi_msg, boolean blocking, conn_status = platSecSockIsConnected(sock); if (conn_status == PLAT_SOCK_CONN_FAILED) { (void)sipSocketClose(sock, TRUE); - CCSIP_DEBUG_ERROR(SIP_F_PREFIX + CCSIP_DEBUG_ERROR(SIP_F_PREFIX "Establish non-blocking mode secure" " connection failed!!\n", fname); return INVALID_SOCKET; } } else { - conn_status = PLAT_SOCK_CONN_OK; + conn_status = PLAT_SOCK_CONN_OK; } if (sip_tcp_set_sock_options(sock) != TRUE) { CCSIP_DEBUG_ERROR(SIP_F_PREFIX "Socket set option failure\n", @@ -186,7 +151,7 @@ sip_tls_create_connection (sipSPIMessage_t *spi_msg, boolean blocking, } memset(&sock_addr, 0, sizeof(sock_addr)); - (void) sip_set_sockaddr(&sock_addr, af_listen, create_msg->addr, + (void) sip_set_sockaddr(&sock_addr, af_listen, create_msg->addr, (uint16_t)(create_msg->port), &addr_len); sip_tcp_conn_tab[idx].fd = sock; diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform_udp.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform_udp.c index c32668798b5e..0b09bbc79232 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform_udp.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform_udp.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_socket.h" @@ -70,15 +35,15 @@ static uint16_t af_family_connect = AF_INET6; * ip_addr ip address * port * addr_len legth returned based on family - * + * * * @return pointer to cpr_sockaddr, which is also psock_storage - * + * * @pre none * */ -cpr_sockaddr_t *sip_set_sockaddr (cpr_sockaddr_storage *psock_storage, uint16_t family, +cpr_sockaddr_t *sip_set_sockaddr (cpr_sockaddr_storage *psock_storage, uint16_t family, cpr_ip_addr_t ip_addr, uint16_t port, uint16_t *addr_len) { static const char fname[] = "sip_set_sockaddr"; @@ -185,14 +150,14 @@ sip_platform_udp_channel_listen (cpr_ip_mode_e ip_mode, cpr_socket_t *s, *s = cprSocket(af_family_listen, SOCK_DGRAM, 0); if (*s == INVALID_SOCKET) { CCSIP_DEBUG_ERROR(get_debug_string(DEBUG_GENERAL_SYSTEMCALL_FAILED), - fname, "cprSocket unable to open socket for IPv4", + fname, "cprSocket unable to open socket for IPv4", cpr_errno); return SIP_ERROR; } } } - (void) sip_set_sockaddr(&sock_addr, af_family_listen, *local_ipaddr, + (void) sip_set_sockaddr(&sock_addr, af_family_listen, *local_ipaddr, local_port, &addr_len); if (cprBind(*s, (cpr_sockaddr_t *)&sock_addr, addr_len) == CPR_FAILURE) { @@ -239,7 +204,7 @@ sip_platform_udp_channel_create (cpr_ip_mode_e ip_mode, cpr_socket_t *s, *s = cprSocket(af_family_connect, SOCK_DGRAM, 0); if (*s == INVALID_SOCKET) { CCSIP_DEBUG_ERROR(get_debug_string(DEBUG_GENERAL_SYSTEMCALL_FAILED), - fname, "cprSocket unable to open socket", + fname, "cprSocket unable to open socket", cpr_errno); /* Try opening ipv4 socket */ if (ip_mode == CPR_IP_MODE_DUAL) { @@ -275,7 +240,7 @@ sip_platform_udp_channel_create (cpr_ip_mode_e ip_mode, cpr_socket_t *s, /* * Connect to remote address */ - (void) sip_set_sockaddr(&sock_addr, af_family_connect, *remote_ipaddr, + (void) sip_set_sockaddr(&sock_addr, af_family_connect, *remote_ipaddr, remote_port, &addr_len); /* if (cprConnect(*s, (cpr_sockaddr_t *)&sock_addr, addr_len) == CPR_FAILURE) { @@ -416,7 +381,7 @@ sip_platform_udp_read_socket (cpr_socket_t s) cpr_sockaddr_storage from; cpr_socklen_t from_len; const char *fname = "sip_platform_udp_read_socket"; - + if (af_family_listen == AF_INET6) { from_len = sizeof(cpr_sockaddr_in6_t); } else { @@ -450,7 +415,7 @@ sip_platform_udp_channel_sendto (cpr_socket_t s, char *buf, uint32_t len, * Connect to remote address */ dest_ip_addr = *dst_ipaddr; - (void) sip_set_sockaddr(&sock_addr, af_family_connect, dest_ip_addr, + (void) sip_set_sockaddr(&sock_addr, af_family_connect, dest_ip_addr, dst_port, &addr_len); diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_pmh.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_pmh.c index fc4bddee97f2..e298993c0975 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_pmh.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_pmh.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * Routines that parse SIP messages into individual components @@ -114,7 +79,7 @@ trim_right (char *pstr) * @param pstr address string * * @return none - * + * * @pre none * */ @@ -427,7 +392,7 @@ url_add_headers_to_list (char *url_strp, sipUrl_t *sip_url) sip_url->num_headers = num_head; num_head = 0; - url_strp = PL_strtok_r(url_strp, "&?", &lasts); + url_strp = PL_strtok_r(url_strp, "&?", &lasts); while ((url_strp != NULL) && (num_head < sip_url->num_headers)) { tmp_ptr = strchr(url_strp, EQUAL_SIGN); @@ -506,7 +471,7 @@ parseUrlParams (char *url_param, sipUrl_t *sipUrl, genUrl_t *genUrl) SKIP_SIP_TOKEN(url_param); SKIP_LWS(url_param); if (*url_param != SEMI_COLON && *url_param != 0) { - CCSIP_DEBUG_ERROR(ERROR_3, fname, url_param); + CCSIP_DEBUG_ERROR(ERROR_3, fname, url_param); return PARSE_ERR_SYNTAX; } } @@ -519,7 +484,7 @@ parseUrlParams (char *url_param, sipUrl_t *sipUrl, genUrl_t *genUrl) } else if (cpr_strncasecmp(url_param, "ip", 2) == 0) { url_param += 2; } else { - CCSIP_DEBUG_ERROR(ERROR_3, fname, url_param); + CCSIP_DEBUG_ERROR(ERROR_3, fname, url_param); return PARSE_ERR_SYNTAX; } } else if (cpr_strncasecmp(url_param, "method=", 7) == 0) { @@ -544,7 +509,7 @@ parseUrlParams (char *url_param, sipUrl_t *sipUrl, genUrl_t *genUrl) url_param++; /* Atmost 3 digits allowed in ttl value */ if ((url_param - param_val) > 3) { - CCSIP_DEBUG_ERROR(ERROR_3, fname, url_param); + CCSIP_DEBUG_ERROR(ERROR_3, fname, url_param); return PARSE_ERR_SYNTAX; } } @@ -624,7 +589,7 @@ parseUrlParams (char *url_param, sipUrl_t *sipUrl, genUrl_t *genUrl) if (i == SIP_MAX_LOCATIONS) { cpr_free(url_other_param); CCSIP_DEBUG_ERROR(SIP_F_PREFIX"parseUrlParams: Too many unknown parameters" - " in URL of Contact header", fname); + " in URL of Contact header", fname); } else { genUrl->other_params[i] = url_other_param; url_other_param = NULL; @@ -638,7 +603,7 @@ parseUrlParams (char *url_param, sipUrl_t *sipUrl, genUrl_t *genUrl) return 0; } if (*url_param != SEMI_COLON) { - CCSIP_DEBUG_ERROR(ERROR_3, fname, url_param); + CCSIP_DEBUG_ERROR(ERROR_3, fname, url_param); return PARSE_ERR_SYNTAX; } *url_param++ = 0; /* Zero the ';' and advance pointer */ @@ -777,13 +742,13 @@ parseSipUrl (char *url_start, genUrl_t *genUrl) if (*url_main == COLON || *url_main == AT_SIGN) { if (separator_cnt == 3) { /* Too many separators */ - CCSIP_DEBUG_ERROR(ERROR_3_1, fname, *url_main); + CCSIP_DEBUG_ERROR(ERROR_3_1, fname, *url_main); return PARSE_ERR_SYNTAX; } separator[separator_cnt++] = *url_main; *url_main++ = 0; /* Zero the separator */ SKIP_LWS(url_main); - + if (*url_main == LEFT_SQUARE_BRACKET) { *url_main++ = 0; /* Must be IPv6 address */ ipv6_addr = TRUE; @@ -835,7 +800,7 @@ parseSipUrl (char *url_start, genUrl_t *genUrl) case 3: if (separator[0] == separator[1]) { /* Cannot have 2 successive entries of : or @ */ - CCSIP_DEBUG_ERROR(ERROR_3_1, fname, separator[1]); + CCSIP_DEBUG_ERROR(ERROR_3_1, fname, separator[1]); return PARSE_ERR_SYNTAX; } if (separator[0] == AT_SIGN) { @@ -873,7 +838,7 @@ parseSipUrl (char *url_start, genUrl_t *genUrl) sipUrl->port = 0; } } else { - CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Bad separator sequence", fname); + CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Bad separator sequence", fname); return PARSE_ERR_SYNTAX; } break; @@ -885,13 +850,13 @@ parseSipUrl (char *url_start, genUrl_t *genUrl) /* Verify the Port */ if (sipUrl->port == 0) { - CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Received Bad Port", fname); + CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Received Bad Port", fname); return PARSE_ERR_SYNTAX; } /* Verify the host portion */ if (sipSPI_validate_ip_addr_name(sipUrl->host) == FALSE) { - CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Received Bad Host", fname); + CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Received Bad Host", fname); return PARSE_ERR_SYNTAX; } @@ -959,7 +924,7 @@ parseTelUrl (char *url_start, genUrl_t *genUrl) */ if (!url_start) { - CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Missing user field", fname); + CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Missing user field", fname); return PARSE_ERR_SYNTAX; } @@ -997,15 +962,15 @@ parseTelUrl (char *url_start, genUrl_t *genUrl) return 0; /* no fields to parse */ } else { CCSIP_DEBUG_ERROR(SIP_F_PREFIX"local-phone-number must have area-specifier", - fname); + fname); return PARSE_ERR_SYNTAX; } } - if (url_main) { + if (url_main) { if ((*url_main) && (*url_main == SEMI_COLON)) { *url_main++ = 0; /* skip separator */ } else { - CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Need ';' before parameters", fname); + CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Need ';' before parameters", fname); return PARSE_ERR_SYNTAX; } } @@ -1024,7 +989,7 @@ parseTelUrl (char *url_start, genUrl_t *genUrl) url_main += 13; SKIP_LWS(url_main); if (*url_main != EQUAL_SIGN) { - CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Bad syntax in phone_context field", fname); + CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Bad syntax in phone_context field", fname); return PARSE_ERR_SYNTAX; } *url_main++ = 0; /* skip "=" */ @@ -1034,7 +999,7 @@ parseTelUrl (char *url_start, genUrl_t *genUrl) url_main += 3; SKIP_LWS(url_main); if (*url_main != EQUAL_SIGN) { - CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Bad syntax in service-provider field", fname); + CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Bad syntax in service-provider field", fname); return PARSE_ERR_SYNTAX; } *url_main++ = 0; /* skip "=" */ @@ -1043,13 +1008,13 @@ parseTelUrl (char *url_start, genUrl_t *genUrl) } else { /* future extension */ if (telUrl->future_ext) { - CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Only one future extension allowed", fname); + CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Only one future extension allowed", fname); return PARSE_ERR_SYNTAX; } SKIP_LWS(url_main); url_main = strchr(url_main, EQUAL_SIGN); if (!url_main) { - CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Bad field value", fname); + CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Bad field value", fname); return PARSE_ERR_SYNTAX; } else { *url_main++ = 0; @@ -1064,7 +1029,7 @@ parseTelUrl (char *url_start, genUrl_t *genUrl) } if ((is_local_subscriber) && (!genUrl->phone_context)) { /* local-phone-number must have area-specifier */ - CCSIP_DEBUG_ERROR(SIP_F_PREFIX"local-phone-number requires area-specifier", fname); + CCSIP_DEBUG_ERROR(SIP_F_PREFIX"local-phone-number requires area-specifier", fname); return PARSE_ERR_SYNTAX; } return 0; /* Success */ @@ -1177,7 +1142,7 @@ sippmh_parse_url (char *url, boolean dup_flag) if (parse_errno == PARSE_ERR_NO_MEMORY) { parse_errno = 0; /* Not really a parse error (out of mem) */ } else { - CCSIP_DEBUG_ERROR(parse_errors[parse_errno], "sippmh_parse_url"); + CCSIP_DEBUG_ERROR(parse_errors[parse_errno], "sippmh_parse_url"); } } sippmh_genurl_free(genUrl); @@ -1201,7 +1166,7 @@ sippmh_parse_url (char *url, boolean dup_flag) if (parse_errno == PARSE_ERR_NO_MEMORY) { parse_errno = 0; /* Not really a parse error (out of mem) */ } else { - CCSIP_DEBUG_ERROR(parse_errors[parse_errno], "sippmh_parse_url"); + CCSIP_DEBUG_ERROR(parse_errors[parse_errno], "sippmh_parse_url"); } } sippmh_genurl_free(genUrl); @@ -1268,7 +1233,7 @@ parse_display_name (char *ptr) /* ptr should now be pointing to '<' */ if (*ptr != LEFT_ANGULAR_BRACKET) { parse_errno = PARSE_ERR_UNMATCHED_BRACKET; - CCSIP_DEBUG_ERROR(parse_errors[parse_errno], fname); + CCSIP_DEBUG_ERROR(parse_errors[parse_errno], fname); return NULL; } @@ -1278,7 +1243,7 @@ parse_display_name (char *ptr) } parse_errno = PARSE_ERR_UNTERMINATED_STRING; - CCSIP_DEBUG_ERROR(parse_errors[parse_errno], fname); + CCSIP_DEBUG_ERROR(parse_errors[parse_errno], fname); return NULL; /* Unmatched " */ } @@ -1396,7 +1361,7 @@ sippmh_parse_nameaddr_or_addrspec (char *input_loc_ptr, cpr_free(sipLoc); parse_errno = PARSE_ERR_UNMATCHED_BRACKET; CCSIP_DEBUG_ERROR(parse_errors[parse_errno], - "sippmh_parse_nameaddr_or_addrspec"); + "sippmh_parse_nameaddr_or_addrspec"); return NULL; } @@ -1558,7 +1523,7 @@ sippmh_parse_from_or_to (char *input_loc_ptr, boolean dup_flag) /* if we had a ; without any addr-params */ if (more_ptr == NULL) { parse_errno = PARSE_ERR_UNEXPECTED_EOS; - CCSIP_DEBUG_ERROR(parse_errors[parse_errno], fname); + CCSIP_DEBUG_ERROR(parse_errors[parse_errno], fname); } else { /* parse the tag but skip any addr-extensions */ while (more_ptr && tag_found == FALSE) { @@ -1574,7 +1539,7 @@ sippmh_parse_from_or_to (char *input_loc_ptr, boolean dup_flag) } else if (*more_ptr) { parse_errno = PARSE_ERR_SYNTAX; - CCSIP_DEBUG_ERROR(parse_errors[parse_errno], fname, more_ptr); + CCSIP_DEBUG_ERROR(parse_errors[parse_errno], fname, more_ptr); } } @@ -2205,7 +2170,7 @@ sippmh_parse_contact (const char *input_contact) if (contact && *contact) { parse_errno = PARSE_ERR_SYNTAX; CCSIP_DEBUG_ERROR(parse_errors[parse_errno], "sippmh_parse_contact", - contact); + contact); sippmh_free_contact(sipContact); sipContact = NULL; } @@ -2402,7 +2367,7 @@ sippmh_parse_via (const char *input_via) SKIP_LWS(via); if (*via == 0) { parse_errno = PARSE_ERR_UNEXPECTED_EOS; - CCSIP_DEBUG_ERROR(parse_errors[parse_errno], fname); + CCSIP_DEBUG_ERROR(parse_errors[parse_errno], fname); break; } @@ -2412,7 +2377,7 @@ sippmh_parse_via (const char *input_via) if (parse_errno) { if (parse_errno == PARSE_ERR_SYNTAX) { - CCSIP_DEBUG_ERROR(parse_errors[parse_errno], fname, via ? via : input_via); + CCSIP_DEBUG_ERROR(parse_errors[parse_errno], fname, via ? via : input_via); } sippmh_free_via(sipVia); return NULL; @@ -2736,7 +2701,7 @@ sippmh_parse_record_route (const char *input_record_route) if (record_route && *record_route) { parse_errno = PARSE_ERR_SYNTAX; CCSIP_DEBUG_ERROR(parse_errors[parse_errno], - "sippmh_parse_record_route", record_route); + "sippmh_parse_record_route", record_route); sippmh_free_record_route(sipRecordRoute); sipRecordRoute = NULL; } @@ -2752,7 +2717,7 @@ sippmh_parse_record_route (const char *input_record_route) /* * This function is a placeholder for future expansion. - * If deep copy of the record route is needed from one ccb to another + * If deep copy of the record route is needed from one ccb to another * this function can be used. */ sipRecordRoute_t * @@ -3775,7 +3740,7 @@ sippmh_parse_remote_party_id_params (char *params, } else { params_good = TRUE; } - } + } SKIP_LWS(params); if (*params == SEMI_COLON) { @@ -4199,7 +4164,7 @@ sippmh_parse_authenticate (const char *input_char) *input++ = 0; SKIP_WHITE_SPACE(input); } - + sippmh_free_authen(sip_authen); return NULL; } @@ -4388,15 +4353,15 @@ sippmh_parse_user (char *url_main) /* * Function: sippmh_parse_message_summary * - * Parameters: The incoming SIP message and a container to be - * filled with the parsed message body. + * Parameters: The incoming SIP message and a container to be + * filled with the parsed message body. * * Description: This function will parse the incoming MWI NTFY SIP message - * and fill the passed in structure with the + * and fill the passed in structure with the * contents of the parsed message.Basic Error checking is done on - * the passed in message. + * the passed in message. * - * Returns: SIP_ERROR on error.SIP_OK otherwise. + * Returns: SIP_ERROR on error.SIP_OK otherwise. */ int32_t sippmh_parse_message_summary(sipMessage_t *pSipMessage, sipMessageSummary_t *mesgSummary) @@ -4446,7 +4411,7 @@ sippmh_parse_message_summary(sipMessage_t *pSipMessage, sipMessageSummary_t *mes return SIP_ERROR; } } else { - return SIP_ERROR; + return SIP_ERROR; } if (cpr_strcasecmp(temp, "no") == 0) { @@ -4456,11 +4421,11 @@ sippmh_parse_message_summary(sipMessage_t *pSipMessage, sipMessageSummary_t *mes } else { return SIP_ERROR; } - + /* p = strstr(pSipMessage->mesg_body[0].msgBody, "Message-Account"); - - if (p) { + + if (p) { trim_right(p); val = strstr(p, ":"); @@ -4480,14 +4445,14 @@ sippmh_parse_message_summary(sipMessage_t *pSipMessage, sipMessageSummary_t *mes } } mesgSummary->message_account[i] = '\0'; - } else { + } else { return SIP_ERROR; } } */ p = strstr(pSipMessage->mesg_body[0].msgBody, "Voice-Message"); - + if (p) { mesgSummary->type = mwiVoiceType; memset(temp, '\0', MAX_SIP_URL_LENGTH); @@ -4801,7 +4766,7 @@ sippmh_parse_supported_require (const char *header, char **punsupported_tokens) } if (bad_token != NULL) { - CCSIP_DEBUG_MESSAGE(DEB_F_PREFIX"Invalid tag in Require/Supported %s\n", + CCSIP_DEBUG_MESSAGE(DEB_F_PREFIX"Invalid tag in Require/Supported %s\n", DEB_F_PREFIX_ARGS(SIP_TAG, fname), bad_token); //allocate memory for unsupported options if necessary @@ -5088,7 +5053,7 @@ sippmh_parse_service_control_body (char *msgBody, int msgLength) } else if (!strncasecmp(value, "apply-config", sizeof("apply-config") - 1)) { scp->action = SERVICE_CONTROL_ACTION_APPLY_CONFIG; - + } else { scp->action = SERVICE_CONTROL_ACTION_INVALID; } @@ -5189,17 +5154,17 @@ sippmh_parse_service_control_body (char *msgBody, int msgLength) } } } - } else if (!strncasecmp(line, "CUCMResult", + } else if (!strncasecmp(line, "CUCMResult", sizeof("CUCMResult") - 1)) { if (value == NULL) { scp->cucm_result = NULL; } else { int len =0; - if ((strncasecmp(value, "no_change", + if ((strncasecmp(value, "no_change", len = strlen("no_change")) == 0) || - (strncasecmp(value, "config_applied", + (strncasecmp(value, "config_applied", len = strlen("config_applied")) == 0) || - (strncasecmp(value, "reregister_needed", + (strncasecmp(value, "reregister_needed", len = strlen("reregister_needed")) == 0)) { scp->cucm_result = (char *) cpr_calloc(1,len + 1); if (scp->cucm_result) { @@ -5291,14 +5256,14 @@ sippmh_parse_service_control_body (char *msgBody, int msgLength) scp->ppid = TRUE; } else if (!strncasecmp(value, "disabled", sizeof("disabled") - 1)) { - scp->ppid = FALSE; + scp->ppid = FALSE; } else { scp->ppid = FALSE; } } cpr_free(line); - + } else { body_read = TRUE; } @@ -5330,10 +5295,10 @@ sippmh_free_service_control_info (sipServiceControl_t *scp) cpr_free(scp->cucm_result); if (scp->loadServer) cpr_free(scp->loadServer); - if (scp->firmwareLoadId) - cpr_free(scp->firmwareLoadId); + if (scp->firmwareLoadId) + cpr_free(scp->firmwareLoadId); if (scp->logServer) - cpr_free(scp->logServer); + cpr_free(scp->logServer); cpr_free(scp); } @@ -5357,10 +5322,10 @@ sippmh_parse_max_forwards (const char *max_fwd_hdr) /* * Function: sippmh_parse_url_from_hdr * - * Parameters: String that needs to be parsed + * Parameters: String that needs to be parsed * - * Description: This function will strip out the tags and - * other characters in the header to retreive + * Description: This function will strip out the tags and + * other characters in the header to retreive * a string that could be used as the request uri. * Note that the input string needs to be well formed. * @@ -5372,9 +5337,9 @@ sippmh_get_url_from_hdr (char *input_str) { char *left_bracket, *right_bracket = NULL; - /* - This function is only intended for properly - formed headers. + /* + This function is only intended for properly + formed headers. */ left_bracket = strpbrk(input_str, ",<"); if (left_bracket) { diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_publish.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_publish.c index 61e556d6f0ee..acde663e9f55 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_publish.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_publish.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "ccsip_publish.h" #include "phntask.h" @@ -249,7 +214,7 @@ static boolean append_pending_reqs (ccsip_publish_cb_t *pcb_p, pub_req_t *msg_p) * * @param[in] list - pending requests list handle * - * @return none + * @return none * */ static void free_pending_reqs (sll_handle_t list) @@ -279,7 +244,7 @@ static void free_pending_reqs (sll_handle_t list) * @param[in] callback_task - task in which the application resides. * @param[in] resp_msg_id - messageID posted to the task. * - * @return none + * @return none */ static void send_resp_to_app (int resp_code, pub_handle_t pub_handle, pub_handle_t app_handle, cc_srcs_t callback_task, int resp_msg_id) @@ -319,10 +284,10 @@ int publish_handle_ev_app_publish (cprBuffer_t buf) /* * If this is initial PUBLISH, allocate a PCB. * Otherwise, look up for PCB based on pub_handle. - */ + */ if (msg_p->pub_handle != NULL_PUBLISH_HANDLE) { pcb_p = find_pcb(msg_p->pub_handle); - + if (pcb_p == NULL) { send_resp_to_app(PUBLISH_FAILED_NOCONTEXT, msg_p->pub_handle, msg_p->app_handle, msg_p->callback_task, msg_p->resp_msg_id); @@ -394,7 +359,7 @@ int publish_handle_ev_app_publish (cprBuffer_t buf) msg_p->callback_task, msg_p->resp_msg_id); CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Failed to send PUBLISH request\n", fname); return SIP_ERROR; - + } @@ -409,7 +374,7 @@ int publish_handle_ev_app_publish (cprBuffer_t buf) * * @pre (pcb_p != NULL) */ -static boolean sipSPISendPublish (ccsip_publish_cb_t *pcb_p, boolean authen) +static boolean sipSPISendPublish (ccsip_publish_cb_t *pcb_p, boolean authen) { static const char fname[] = "sipSPISendPublish"; static uint32_t cseq = 0; @@ -424,7 +389,7 @@ static boolean sipSPISendPublish (ccsip_publish_cb_t *pcb_p, boolean authen) static uint16_t count = 1; sipMessage_t *request = NULL; int timeout = 0; - + request = GET_SIP_MESSAGE(); if (!request) { return FALSE; @@ -463,7 +428,7 @@ static boolean sipSPISendPublish (ccsip_publish_cb_t *pcb_p, boolean authen) return (FALSE); } - // Add local Via + // Add local Via snprintf(via, sizeof(via), "SIP/2.0/%s %s:%d;%s=%s%.8x", sipTransportGetTransportType(1, TRUE, NULL), src_addr_str, pcb_p->hb.local_port, VIA_BRANCH, @@ -492,7 +457,7 @@ static boolean sipSPISendPublish (ccsip_publish_cb_t *pcb_p, boolean authen) return (FALSE); } - // Add Call-ID Header. + // Add Call-ID Header. platform_get_wired_mac_address(mac_address); count++; snprintf(pcb_p->hb.sipCallID, MAX_SIP_CALL_ID, "%.4x%.4x-%.4x%.4x-%.8x-%.8x@%s", // was MAX_SIP_URL_LENGTH @@ -520,7 +485,7 @@ static boolean sipSPISendPublish (ccsip_publish_cb_t *pcb_p, boolean authen) return (FALSE); } - // Add Cseq. + // Add Cseq. cseq++; if (cseq == 0) { cseq = 1; @@ -601,7 +566,7 @@ static boolean sipSPISendPublish (ccsip_publish_cb_t *pcb_p, boolean authen) } return (TRUE); - + } /** @@ -678,7 +643,7 @@ int publish_handle_retry_timer_expire (uint32_t handle) } /** - * This function will check if wee need to send refresh PUBLISH. + * This function will check if wee need to send refresh PUBLISH. * If so, it will send refresh PUBLISH * * @param[in] none @@ -706,7 +671,7 @@ void publish_handle_periodic_timer_expire (void) /* refresh is triggered by NULL event data and non-zero expires value */ msg.pub_handle = pcb_p->pub_handle; msg.expires = pcb_p->hb.orig_expiration; - (void)publish_handle_ev_app_publish(&msg); + (void)publish_handle_ev_app_publish(&msg); } } pcb_p = (ccsip_publish_cb_t *)sll_next(s_PCB_list, pcb_p); @@ -755,7 +720,7 @@ int publish_handle_ev_sip_response (sipMessage_t *pSipMessage) */ sip_platform_msg_timer_subnot_stop(&(pcb_p->retry_timer)); pcb_p->hb.retx_flag = FALSE; - + // Parse the return code (void) sipGetResponseCode(pSipMessage, &response_code); @@ -814,7 +779,7 @@ int publish_handle_ev_sip_response (sipMessage_t *pSipMessage) CCSIP_DEBUG_ERROR(SIP_F_PREFIX"failed to respond to 423\n", fname); return SIP_ERROR; } - + /* * if the response_code is > 299, free up the PCB and let the app know. */ @@ -833,7 +798,7 @@ int publish_handle_ev_sip_response (sipMessage_t *pSipMessage) CCSIP_DEBUG_TASK(DEB_F_PREFIX"received %d response\n", DEB_F_PREFIX_ARGS(SIP_PUB, fname), response_code); return SIP_OK; } - + /* * If it is PUBLISH remove operation, free up PCB */ @@ -866,7 +831,7 @@ int publish_handle_ev_sip_response (sipMessage_t *pSipMessage) pcb_p->callback_task, pcb_p->resp_msg_id); CCSIP_DEBUG_ERROR(SIP_F_PREFIX"memory allocation failed\n", fname); return SIP_ERROR; - + } } @@ -887,9 +852,9 @@ int publish_handle_ev_sip_response (sipMessage_t *pSipMessage) } /** - * This function will inform the application that phone is either + * This function will inform the application that phone is either * 1. restarting or - * 2. failing over/ falling back + * 2. failing over/ falling back * * @note detection of CCM reboot will be handled by PUBLISH ETag mechanism. * diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_register.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_register.c index 96012f24cf0a..8f79d62e6099 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_register.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_register.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include @@ -337,7 +302,7 @@ sip_start_ack_timer (ccsipCCB_t *ccb) ack_timer_index = ccb->dn_line - 1; } - CCSIP_DEBUG_REG_STATE( DEB_L_C_F_PREFIX " ccb->index=%d ack_timer_index=%d ", + CCSIP_DEBUG_REG_STATE( DEB_L_C_F_PREFIX " ccb->index=%d ack_timer_index=%d ", DEB_L_C_F_PREFIX_ARGS(SIP_STATE, ccb->dn_line, 0, "sip_start_ack_timer"), ccb->index, ack_timer_index); @@ -364,7 +329,7 @@ sip_stop_ack_timer (ccsipCCB_t *ccb) ack_timer_index = ccb->dn_line - 1; } - CCSIP_DEBUG_REG_STATE( DEB_L_C_F_PREFIX " ccb->index=%d ack_timer_index=%d ", + CCSIP_DEBUG_REG_STATE( DEB_L_C_F_PREFIX " ccb->index=%d ack_timer_index=%d ", DEB_L_C_F_PREFIX_ARGS(SIP_STATE, ccb->dn_line, 0, "sip_stop_ack_timer"), ccb->index, ack_timer_index); @@ -664,7 +629,7 @@ ccsip_get_exp_time_2xx (ccsipCCB_t *ccb, sipContact_t *contact_info, * registration expiration is 60 seconds to prevent the phone from being * flooded with msgs. */ - if ((exp_time - register_delta) < MIN_REGISTRATION_PERIOD) { + if ((exp_time - register_delta) < MIN_REGISTRATION_PERIOD) { CCSIP_DEBUG_REG_STATE(DEB_L_C_F_PREFIX "Warning - Registration period received (%d) " "minus configured timer_register_delta (%d) is less than " @@ -727,7 +692,7 @@ ccsip_check_ccm_restarted (sipContact_t *contact_info) * Function: update_sis_protocol_version * * Parameters: - * response - 200 OK message pointer + * response - 200 OK message pointer * * Description: * The function parses theupported header in response and updates @@ -735,7 +700,7 @@ ccsip_check_ccm_restarted (sipContact_t *contact_info) * SEADRAGON version gets updated * * Returns: - * void + * void */ void @@ -748,11 +713,11 @@ update_sis_protocol_version (sipMessage_t *response) sipver = strcasestr(supported, REQ_SUPP_PARAM_CISCO_SISTAG); if (sipver) { cc_uint32_t major = SIS_PROTOCOL_MAJOR_VERSION_SEADRAGON, minor = 0, addtnl = 0; - if ( sscanf ( &sipver[strlen(REQ_SUPP_PARAM_CISCO_SISTAG)], "%d.%d.%d", + if ( sscanf ( &sipver[strlen(REQ_SUPP_PARAM_CISCO_SISTAG)], "%d.%d.%d", &major, &minor, &addtnl) == 3) { - platSetSISProtocolVer ( major, minor, addtnl,REQ_SUPP_PARAM_CISCO_SISTAG); + platSetSISProtocolVer ( major, minor, addtnl,REQ_SUPP_PARAM_CISCO_SISTAG); return; - } + } } } /* All other cases we set the version to 1.0.0 */ @@ -797,7 +762,7 @@ ccsip_handle_ev_2xx (ccsipCCB_t *ccb, sipSMEvent_t *event) sipContact_t *contact_info = NULL; //line_t line_index = 0; //ccsipCCB_t *line_ccb = NULL; - + // Extract Date header and store datehdr = sippmh_get_header_val(response, SIP_HEADER_DATE, NULL); @@ -880,9 +845,9 @@ ccsip_handle_ev_2xx (ccsipCCB_t *ccb, sipSMEvent_t *event) ccb->reg.registered = 1; sip_reg_sm_change_state(ccb, SIP_REG_STATE_REGISTERED); regall_fail_attempt = FALSE; - - if (ccb->index != REG_BACKUP_CCB) { - registration_reject = FALSE; + + if (ccb->index != REG_BACKUP_CCB) { + registration_reject = FALSE; ui_set_sip_registration_state(ccb->dn_line, TRUE); CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"Setting Reg state to TRUE for line=%d\n", DEB_F_PREFIX_ARGS(SIP_REG_STATE, fname), ccb->dn_line); @@ -898,7 +863,7 @@ ccsip_handle_ev_2xx (ccsipCCB_t *ccb, sipSMEvent_t *event) } ccb->reg.tmr_expire = exp_time; - + ccb->reg.act_time = (int) time(NULL); CCSIP_DEBUG_REG_STATE(DEB_L_C_F_PREFIX"Starting expires timer (%d " "sec)\n", DEB_L_C_F_PREFIX_ARGS(SIP_TIMER, ccb->index, ccb->dn_line, fname), @@ -1003,7 +968,7 @@ ccsip_handle_ev_2xx (ccsipCCB_t *ccb, sipSMEvent_t *event) } } - free_sip_message(response); + free_sip_message(response); } void @@ -1129,9 +1094,9 @@ ccsip_handle_ev_4xx (ccsipCCB_t *ccb, sipSMEvent_t *event) char uri[MAX_IPADDR_STR_LEN + 10]; /* Proxy IP address string */ char tmp_str[STATUS_LINE_MAX_LEN]; ti_config_table_t *ccm_table_ptr = NULL; - + ccm_table_ptr = (ti_config_table_t *) ccb->cc_cfg_table_entry; - + response = event->u.pSipMessage; clean_method_request_trx(ccb, sipMethodRegister, TRUE); @@ -1142,17 +1107,17 @@ ccsip_handle_ev_4xx (ccsipCCB_t *ccb, sipSMEvent_t *event) free_sip_message(response); return; } - + /* * Set reject flag if we get 4xx from publisher cucm. * Note: if non-prime dn is congfigured with #, such as 1234##, * then phone will get 404 for that DN, even though the prime DN is * registered. - */ + */ if (ccm_table_ptr && ccb->index != REG_BACKUP_CCB) { - DEF_DEBUG(DEB_F_PREFIX"Receive 4xx in ccm mode. set registration_reject to TRUE.\n", - DEB_F_PREFIX_ARGS(SIP_REG, fname)); + DEF_DEBUG(DEB_F_PREFIX"Receive 4xx in ccm mode. set registration_reject to TRUE.\n", + DEB_F_PREFIX_ARGS(SIP_REG, fname)); registration_reject = TRUE; } @@ -1212,11 +1177,11 @@ ccsip_handle_ev_4xx (ccsipCCB_t *ccb, sipSMEvent_t *event) cpr_free(ccb->authen.authorization); ccb->authen.authorization = NULL; } - + ccb->authen.authorization = (char *) cpr_malloc(strlen(author_str) * sizeof(char) + 1); - + if (ccb->authen.authorization != NULL) { sstrncpy(ccb->authen.authorization, author_str, strlen(author_str) * sizeof(char) + 1); @@ -1388,7 +1353,7 @@ ccsip_handle_ev_4xx (ccsipCCB_t *ccb, sipSMEvent_t *event) if (ccb->reg.rereg_pending != 0) { ccb->reg.rereg_pending = 0; - if (ccsip_register_send_msg(SIP_REG_REQ, ccb->index) != SIP_REG_OK) { + if (ccsip_register_send_msg(SIP_REG_REQ, ccb->index) != SIP_REG_OK) { ccsip_register_cleanup(ccb, TRUE); } } @@ -1407,13 +1372,13 @@ ccsip_handle_ev_failure_response (ccsipCCB_t *ccb, sipSMEvent_t *event) /* * Set reject flag if we get 5xx/6xx from publisher cucm. - */ + */ ccm_table_ptr = (ti_config_table_t *) ccb->cc_cfg_table_entry; - if (ccm_table_ptr && + if (ccm_table_ptr && ccb->index != REG_BACKUP_CCB) { registration_reject = TRUE; - DEF_DEBUG(DEB_F_PREFIX"registration has been rejected. Set registration_reject to TRUE.\n", - DEB_F_PREFIX_ARGS(SIP_REG, fname)); + DEF_DEBUG(DEB_F_PREFIX"registration has been rejected. Set registration_reject to TRUE.\n", + DEB_F_PREFIX_ARGS(SIP_REG, fname)); } response = event->u.pSipMessage; @@ -1462,7 +1427,7 @@ ccsip_handle_ev_failure_response (ccsipCCB_t *ccb, sipSMEvent_t *event) if (ccb->state == (int) SIP_REG_STATE_TOKEN_WAIT) { /* Handle only 503 error condition for other errors - * use default state + * use default state */ if (status_code == SIP_SERV_ERR_UNAVAIL) { clean_method_request_trx(ccb, sipMethodRefer, TRUE); @@ -1478,7 +1443,7 @@ ccsip_handle_ev_failure_response (ccsipCCB_t *ccb, sipSMEvent_t *event) * if response code is 503 with Retry-After */ if ((status_code == SIP_SERV_ERR_UNAVAIL) && - (process_retry_after(ccb, response) == TRUE)) { + (process_retry_after(ccb, response) == TRUE)) { free_sip_message(response); return; } @@ -1560,7 +1525,7 @@ ccsip_handle_ev_tmr_retry (ccsipCCB_t *ccb, sipSMEvent_t *event) /* * regmgr - Send event to the regmgr */ - CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"Reached here for ccb->index=%d \n", + CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"Reached here for ccb->index=%d \n", DEB_F_PREFIX_ARGS(SIP_MSG_SEND, fname), ccb->index); sip_regmgr_ev_tmr_ack_retry(ccb, event); return; @@ -1577,7 +1542,7 @@ ccsip_handle_ev_tmr_retry (ccsipCCB_t *ccb, sipSMEvent_t *event) */ util_ntohl(&ip_addr, &(event->u.UsrInfo)); if (util_compare_ip(&ip_addr, &(ccb->outBoundProxyAddr)) || - ((event->u.UsrInfo.type == CPR_IP_ADDR_INVALID) && + ((event->u.UsrInfo.type == CPR_IP_ADDR_INVALID) && util_check_if_ip_valid(&(ccb->outBoundProxyAddr)))) { /* * If there are more records, reset address to force code @@ -1649,7 +1614,7 @@ ccsip_handle_ev_tmr_retry (ccsipCCB_t *ccb, sipSMEvent_t *event) * the event has come due to race condition */ ccb->retx_counter++; - CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"Resending message: #%d\n", + CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"Resending message: #%d\n", DEB_F_PREFIX_ARGS(SIP_MSG_SEND, fname), ccb->retx_counter); if (sipSPISendLastMessage(ccb) != TRUE) { @@ -2043,11 +2008,11 @@ ccsip_register_send_msg (uint32_t cmd, line_t ndx) } } - CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"cmd=%d=%s ccb->index=%d ccm_id=%s\n", + CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"cmd=%d=%s ccb->index=%d ccm_id=%s\n", DEB_F_PREFIX_ARGS(SIP_MSG_SEND, fname), cmd, REG_CMD_PRINT(cmd), ndx, CCM_ID_PRINT(ccm_id)); - register_msg = (ccsip_registration_msg_t *) + register_msg = (ccsip_registration_msg_t *) SIPTaskGetBuffer(sizeof(ccsip_registration_msg_t)); if (!register_msg) { @@ -2152,7 +2117,7 @@ ccsip_register_cleanup (ccsipCCB_t *ccb, boolean start) cc_int32_t ccsip_register_cmd (cc_int32_t argc, const char *argv[]) -{ +{ /* * On 7970 phones the command is reg line [option] [line] * On 7940/60 the command is reg [option] [line] @@ -2213,11 +2178,11 @@ ccsip_register_cmd (cc_int32_t argc, const char *argv[]) return (0); } } - + ndx = SIP_REG_REGLINE2LINE(temp_line - 1); ccb = sip_sm_get_ccb_by_index(ndx); - + if (ccb == NULL) { debugif_printf("Unable to retrieve registration information for this line.\n"); debugif_printf("Command aborted.\n"); @@ -2372,14 +2337,14 @@ show_register_data (void) /* * Ensure that the timer_count_down value is valid. There * are cases where the phone completes registration before an - * SNTP/NTP response is received which makes the act_time and + * SNTP/NTP response is received which makes the act_time and * time(NULL) values inconsistent. */ if ((timer_count_down < 0) || (timer_count_down > ccb->reg.tmr_expire)) { - + timer_count_down = 0; - } + } } // build the flag string @@ -2494,7 +2459,7 @@ ccsip_register_init (void) int i; ccsip_register_set_register_state(SIP_REG_IDLE); - + /* * Create acknowledgement timers */ @@ -2580,7 +2545,7 @@ ccsip_register_cancel (boolean cancel_reg, boolean backup_proxy) } if (ccb->index == REG_CCB_START) { ccb->send_reason_header = TRUE; - } + } if (ccsip_register_send_msg(SIP_REG_CANCEL, ndx) != SIP_REG_OK) { @@ -2664,7 +2629,7 @@ ccsip_register_all_lines (void) ccsip_register_reset_proxy(); ccsip_register_set_register_state(SIP_REG_REGISTERING); - CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"registering %d line%c\n", + CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"registering %d line%c\n", DEB_F_PREFIX_ARGS(SIP_REG, fname), line_end, line_end > 1 ? 's' : ' '); /* register line 1 to the backup proxy. @@ -2696,7 +2661,7 @@ ccsip_register_all_lines (void) * Assume CSPS since only those two for now. */ if (util_check_if_ip_valid(&(ccb->dest_sip_addr))) { - CCSIP_DEBUG_REG_STATE(DEB_L_C_F_PREFIX"%d, 0x%x\n", + CCSIP_DEBUG_REG_STATE(DEB_L_C_F_PREFIX"%d, 0x%x\n", DEB_L_C_F_PREFIX_ARGS(SIP_REG, ccb->index, ccb->dn_line, fname), ndx, ccb); @@ -2734,7 +2699,7 @@ ccsip_register_all_lines (void) continue; } - CCSIP_DEBUG_REG_STATE(DEB_L_C_F_PREFIX"%d, 0x%x\n", + CCSIP_DEBUG_REG_STATE(DEB_L_C_F_PREFIX"%d, 0x%x\n", DEB_L_C_F_PREFIX_ARGS(SIP_REG, ccb->index, ccb->dn_line, fname), ndx, ccb); @@ -2772,13 +2737,13 @@ ccsip_register_all_lines (void) ui_set_sip_registration_state(ccb->dn_line, FALSE); if (ccsip_register_send_msg(SIP_REG_REQ, ndx) != SIP_REG_OK) { ccsip_register_cleanup(ccb, TRUE); - } + } } } g_disable_mass_reg_debug_print = FALSE; - - sip_platform_cc_mode_notify(); + + sip_platform_cc_mode_notify(); } @@ -2912,8 +2877,8 @@ ccsip_backup_register_commit (void) sip_sm_call_cleanup(ccb); if (util_check_if_ip_valid(&(ccb->dest_sip_addr))) { - CCSIP_DEBUG_REG_STATE(DEB_L_C_F_PREFIX"%d, 0x%x\n", - DEB_L_C_F_PREFIX_ARGS(SIP_REG, ccb->index, ccb->dn_line, fname), + CCSIP_DEBUG_REG_STATE(DEB_L_C_F_PREFIX"%d, 0x%x\n", + DEB_L_C_F_PREFIX_ARGS(SIP_REG, ccb->index, ccb->dn_line, fname), ndx, ccb); ccb->reg.addr = ccb->dest_sip_addr; ccb->reg.port = (uint16_t) ccb->dest_sip_port; diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_reldev.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_reldev.c index 410bbd406b52..24d19abfb142 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_reldev.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_reldev.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_string.h" @@ -185,7 +150,7 @@ sipRelDevCoupledMessageStore (sipMessage_t *pCoupledMessage, /* Return the stored idx to the caller */ return (i); } - } + } } return (RELDEV_NO_STORED_MSG); } diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_sdp.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_sdp.c index 81160a5b64a2..a44fa7339a30 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_sdp.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_sdp.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * Implements functions to parse and create SDP(Session Description Protocol) @@ -404,69 +369,31 @@ sipsdp_create_from_buf (char *buf, uint32_t nbytes, cc_sdp_t *sdp) char * sipsdp_write_to_buf (cc_sdp_t *sdp_info, uint32_t *retbytes) { - const char *fname = "sipsdp_write_to_buf"; - char *buf, *new_buf; - char *sdp_buf; + flex_string fs; uint32_t sdp_len; sdp_result_e rc; + flex_string_init(&fs); + if (!sdp_info || !sdp_info->src_sdp) { - CCSIP_DEBUG_ERROR(SIP_F_PREFIX"NULL sdp_info or src_sdp\n", fname); + CCSIP_DEBUG_ERROR(SIP_F_PREFIX"NULL sdp_info or src_sdp\n", __FUNCTION__); return (NULL); } - /* - * Allocate storage for the SDP text - */ - buf = (char *) cpr_malloc(CCSIP_SDP_BUF_SIZE); - if (!buf) { - CCSIP_DEBUG_ERROR(SIP_F_PREFIX"malloc failure\n", fname); - return (NULL); - } - - sdp_buf = buf; - - if ((rc = sdp_build(sdp_info->src_sdp, &sdp_buf, CCSIP_SDP_BUF_SIZE)) + if ((rc = sdp_build(sdp_info->src_sdp, &fs)) != SDP_SUCCESS) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"sdp_build rc=%s\n", DEB_F_PREFIX_ARGS(SIP_SDP, fname), + CCSIP_DEBUG_TASK(DEB_F_PREFIX"sdp_build rc=%s\n", DEB_F_PREFIX_ARGS(SIP_SDP, __FUNCTION__), sdp_get_result_name(rc)); - if (rc == SDP_POTENTIAL_SDP_OVERFLOW) { - /* SDP may have been truncated. Issue an extra warning and abort */ - CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Build SDP buffer overflow\n", fname); - } - - cpr_free(buf); + flex_string_free(&fs); *retbytes = 0; return (NULL); } - /* - * Compute length of SDP - */ - sdp_len = sdp_buf - buf; - /* - * Minimize the memory impact on the SDP buffer by reallocating buffer - * with a smaller size that fits the actual SDP body for the size. - */ - if ((CCSIP_SDP_BUF_SIZE - sdp_len) > 64) { - /* - * Allocate space with NULL string character, the - * output buffer content contains the NULL char but the - * the length represents an actual length of SDP - * without NULL char. The NULL char is added just in case, - * there is code that uses strlen() on the SDP then - * it will terminate properly. - */ - new_buf = (char *) cpr_malloc(sdp_len + 1); - if (new_buf != NULL) { - memcpy(new_buf, buf, sdp_len); - new_buf[sdp_len] = '\0'; - cpr_free(buf); - buf = new_buf; - } - } - *retbytes = sdp_len; + *retbytes = fs.string_length; - return (buf); + /* We are not calling flex_string_free on this, instead returning the buffer + * caller's responsibility to free + */ + return fs.buffer; } diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_spi_utils.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_spi_utils.c index e6824d1d47aa..97ce502d31c9 100755 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_spi_utils.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_spi_utils.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * This file implements a bunch of stuff used only by ccsip_spi.c, @@ -96,7 +61,7 @@ sipSPI_validate_hostname (char *str) char *tok; char ip_addr_out[MAX_IPADDR_STR_LEN]; char *strtok_state; - + if (str == NULL) { return FALSE; } diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_subsmanager.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_subsmanager.c index 5ecc3881ad84..5189eb24c7dd 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_subsmanager.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_subsmanager.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_in.h" @@ -111,10 +76,10 @@ int maxScbsAllocated = 0; * sub_id is a 32 bit quantity. The bit 32-16 holds a unique ID and * the bits 15-0 holds a SCB index. The following definitions help * support this formation. - * - * Assumption: The above format assumes that SCB index never be + * + * Assumption: The above format assumes that SCB index never be * larger than 16 bit unsigned value. - */ + */ #define SUB_ID_UNIQUE_ID_POSITION 16 /* shift position of unique id part*/ #define SUB_IDSCB_INDEX_MASK 0xffff /* mask for obtaining scb index */ #define GET_SCB_INDEX_FROM_SUB_ID(sub_id) \ @@ -192,7 +157,7 @@ find_matching_trxn (void *key, void *data) * Returns: TRUE if the via header is successfully stored, * FALSE otherwise. */ -static boolean +static boolean store_incoming_trxn (const char *via, unsigned long cseq, sipSCB_t *scbp) { static const char *fname = "store_incoming_trxn"; @@ -769,7 +734,7 @@ sip_subsManager_reg_failure_common (ccsip_reason_code_e reason) error_data.msg_id = scbp->subsTermCallbackMsgID; CCSIP_DEBUG_TASK(DEB_F_PREFIX"Sending reg failure notification for " - "scb=%d sub_id=%x reason=%d\n", DEB_F_PREFIX_ARGS(SIP_SUB, fname), i, + "scb=%d sub_id=%x reason=%d\n", DEB_F_PREFIX_ARGS(SIP_SUB, fname), i, scbp->sub_id, reason); sip_send_error_message(&error_data, scbp->subsNotCallbackTask, @@ -783,7 +748,7 @@ sip_subsManager_reg_failure_common (ccsip_reason_code_e reason) } free_scb(i, fname); } - + sipRelDevAllMessagesClear(); return (0); } @@ -1084,27 +1049,27 @@ find_req_scb (const char *callID, sipMethod_t method, * Returns: * 1) pointer to sipSCB_t or NULL if finding fails. * 2) the index into the SCB array is also returned if the - * scb_index parameter is provided. + * scb_index parameter is provided. */ static sipSCB_t * find_scb_by_sub_id (sub_id_t sub_id, int *scb_index) { int idx, ret_idx = MAX_SCBS; - sipSCB_t *scbp = NULL; + sipSCB_t *scbp = NULL; - /* - * Use index part of the sub_id to find the SCB + /* + * Use index part of the sub_id to find the SCB */ idx = GET_SCB_INDEX_FROM_SUB_ID(sub_id); if (idx < MAX_SCBS) { - /* + /* * SCB index is within a valid range, get the SCB by index. * Match the SCB's sub_id and the one provided. */ if (subsManagerSCBS[idx].sub_id == sub_id) { /* The correct SCB is found */ scbp = &(subsManagerSCBS[idx]); - ret_idx = idx; + ret_idx = idx; } } @@ -1154,7 +1119,7 @@ find_scb_by_subscription (cc_subscriptions_t event, int *scb_index, * Description: * The function allocates a new unique sub_id and return * it to the caller. - * + * * NOTE: the scb_index can not exceed 16 bit unsigned value. * * Returns: @@ -1171,12 +1136,12 @@ new_sub_id (int scb_index) * bit 31 - bit 16 contains unique ID * bit 15 - bit 0 contains scb index. */ - sub_id = (unique_id << SUB_ID_UNIQUE_ID_POSITION) | + sub_id = (unique_id << SUB_ID_UNIQUE_ID_POSITION) | (sub_id_t)(scb_index & SUB_IDSCB_INDEX_MASK); unique_id++; /* next unique sub id */ if (sub_id == CCSIP_SUBS_INVALID_SUB_ID) { /* sub_id becomes the invalid value marker, re-calcualte new id */ - sub_id = (unique_id << SUB_ID_UNIQUE_ID_POSITION) | + sub_id = (unique_id << SUB_ID_UNIQUE_ID_POSITION) | (sub_id_t)(scb_index & SUB_IDSCB_INDEX_MASK); unique_id++; } @@ -1202,7 +1167,7 @@ allocate_scb (int *scb_index) CCSIP_DEBUG_TASK("allocate_scb scb_index: %d, currentScbsAllocated: %d, " "maxScbsAllocated: %d, sub_id: %x\n", scb_index, currentScbsAllocated, maxScbsAllocated, subsManagerSCBS[i].sub_id); - + /* * local port may have changed because of failover/fallback. * So update it with current info so that the Via & Contact headers @@ -1307,7 +1272,7 @@ store_scb_history (sipSCB_t *scbp) * frees the SCB. It will cleanup the scb (ie, free the memory allocated for any sub fields). * It will also mark the SCB as free (smState = SUBS_STATE_IDLE). * Please note this function may be invoked can be invoked even when smState == SUBS_STATE_IDLE. - * An example case is when parse_body() fails. + * An example case is when parse_body() fails. * * @param[in] scb_index - indext of the SCB into SCB array. * @param[in] fname - name of the function calling this function. @@ -1503,11 +1468,16 @@ parse_body (cc_subscriptions_t event_type, char *msgBody, int msgLength, boolean add_content (ccsip_event_data_t *eventData, sipMessage_t *request, const char *fname) { + return FALSE; + +/* This function requires XML handling */ +#if 0 const char *fname1 = "add_content"; uint32_t len; char *eventBody = NULL; while (eventData) { + /* Encode eventData into eventBody here */ len = strlen(eventBody); switch (eventData->type) { @@ -1536,6 +1506,7 @@ add_content (ccsip_event_data_t *eventData, sipMessage_t *request, const char *f eventData = eventData->next; } return (TRUE); +#endif } // Functions to handle requests from internal applications @@ -1579,7 +1550,7 @@ subsmanager_handle_ev_app_subscribe_register (cprBuffer_t buf) return SIP_ERROR; } CCSIP_DEBUG_TASK(DEB_F_PREFIX"Allocated SCB for App Registration," - " event=%d, scb=%d, sub_id=%x\n", DEB_F_PREFIX_ARGS(SIP_SUB, fname), + " event=%d, scb=%d, sub_id=%x\n", DEB_F_PREFIX_ARGS(SIP_SUB, fname), reg_datap->eventPackage, GET_SCB_INDEX_FROM_SUB_ID(scbp->sub_id), scbp->sub_id); @@ -1672,7 +1643,7 @@ subsmanager_handle_ev_app_subscribe (cprBuffer_t buf) } else { /* Find SCB from sub_id */ scbp = find_scb_by_sub_id(sub_datap->sub_id, &scb_index); - } + } if (scbp == NULL) { // Process new subscription if ((sub_datap->eventPackage != CC_SUBSCRIPTIONS_DIALOG) && @@ -1854,7 +1825,7 @@ subsmanager_handle_ev_app_subscribe_response (cprBuffer_t buf) */ scbp = find_scb_by_sub_id(subres_datap->sub_id, NULL); if (scbp == NULL) { - CCSIP_DEBUG_ERROR(SIP_F_PREFIX"no SCB for sub_id=%x found\n", + CCSIP_DEBUG_ERROR(SIP_F_PREFIX"no SCB for sub_id=%x found\n", fname, subres_datap->sub_id); return SIP_ERROR; } @@ -1896,18 +1867,18 @@ subsmanager_handle_ev_app_notify (cprBuffer_t buf) notify_result_data.msg_id = not_datap->subsNotResCallbackMsgID; notify_result_data.sub_id = not_datap->sub_id; - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Processing an app notify request for" - " sub_id=%x\n", DEB_F_PREFIX_ARGS(SIP_SUB, fname), - not_datap->sub_id); + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Processing an app notify request for" + " sub_id=%x\n", DEB_F_PREFIX_ARGS(SIP_SUB, fname), + not_datap->sub_id); /* * Find SCB from the sub_id. */ scbp = find_scb_by_sub_id(not_datap->sub_id, NULL); if (scbp == NULL) { - CCSIP_DEBUG_ERROR(SIP_F_PREFIX"no SCB for sub_id=%x found\n", fname, + CCSIP_DEBUG_ERROR(SIP_F_PREFIX"no SCB for sub_id=%x found\n", fname, not_datap->sub_id); free_event_data(not_datap->eventData); - sip_send_error_message(¬ify_result_data, + sip_send_error_message(¬ify_result_data, not_datap->subsNotCallbackTask, not_datap->subsNotResCallbackMsgID, not_datap->notifyResultCallback, @@ -1928,15 +1899,15 @@ subsmanager_handle_ev_app_notify (cprBuffer_t buf) (*temp_SIPSPIMsg) = (*pSIPSPIMsg); /* Append the request */ - if (append_pending_requests(scbp, temp_SIPSPIMsg, + if (append_pending_requests(scbp, temp_SIPSPIMsg, SIPSPI_EV_CC_NOTIFY)) { return SIP_DEFER; } cpr_free(temp_SIPSPIMsg); } - /* We either do not have buffer or failed to append msg. */ + /* We either do not have buffer or failed to append msg. */ free_event_data(not_datap->eventData); - sip_send_error_message(¬ify_result_data, + sip_send_error_message(¬ify_result_data, not_datap->subsNotCallbackTask, not_datap->subsNotResCallbackMsgID, not_datap->notifyResultCallback, @@ -2009,7 +1980,7 @@ subsmanager_handle_ev_app_notify (cprBuffer_t buf) * This function will handle Application Generated unsolicited NOTIFY * * @param[in] buf - pointer to sipspi_msg_t - * @param[in] line - line id. + * @param[in] line - line id. * * @return none */ @@ -2023,7 +1994,7 @@ void subsmanager_handle_ev_app_unsolicited_notify (cprBuffer_t buf, line_t line) static uint32_t trxn_id = 1; CCSIP_DEBUG_TASK(DEB_F_PREFIX"Processing an outgoing unsolicited notify request\n", - DEB_F_PREFIX_ARGS(SIP_SUB, fname)); + DEB_F_PREFIX_ARGS(SIP_SUB, fname)); pSIPSPIMsg = (sipspi_msg_t *) buf; not_datap = &(pSIPSPIMsg->msg.notify); @@ -2047,7 +2018,7 @@ void subsmanager_handle_ev_app_unsolicited_notify (cprBuffer_t buf, line_t line) if (tcbp == NULL) { CCSIP_DEBUG_ERROR(SIP_F_PREFIX"malloc of TCB failed\n", fname); free_event_data(not_datap->eventData); - return; + return; } memset(tcbp, 0, sizeof(sipTCB_t)); tcbp->trxn_id = trxn_id; @@ -2074,7 +2045,7 @@ void subsmanager_handle_ev_app_unsolicited_notify (cprBuffer_t buf, line_t line) } tcbp->hb.dn_line = line; tcbp->hb.local_port = sipTransportGetListenPort(tcbp->hb.dn_line, NULL); - + tcbp->hb.event_type = not_datap->eventPackage; // Copy any body received - it will be framed later @@ -2151,7 +2122,7 @@ void subsmanager_unsolicited_notify_timeout (void *data) const char *fname = "subsmanager_unsolicited_notify_timeout"; uint32_t trxn_id = (long)data; sipTCB_t *temp_tcbp = NULL; - + /* * make sure that the TCB still exists. */ @@ -2273,9 +2244,9 @@ subsmanager_handle_ev_app_subscription_terminated (cprBuffer_t buf) /* Find SCB by sub_id */ scbp = find_scb_by_sub_id(subs_term->sub_id, &scb_index); } - if (scbp == NULL) { + if (scbp == NULL) { CCSIP_DEBUG_ERROR(SIP_F_PREFIX"no SCB for sub_id=%x or request id %d" - " and eventPackage %d found\n", fname, + " and eventPackage %d found\n", fname, subs_term->sub_id, subs_term->request_id, subs_term->eventPackage); return SIP_ERROR; @@ -2665,7 +2636,7 @@ subsmanager_handle_ev_sip_subscribe (sipMessage_t *pSipMessage, } else if (sipMethod == sipMethodBye) { - return SIP_ERROR; + return SIP_ERROR; } else { // Reached here in error @@ -2943,7 +2914,7 @@ subsmanager_handle_ev_sip_subscribe (sipMessage_t *pSipMessage, return SIP_ERROR; } CCSIP_DEBUG_TASK(DEB_F_PREFIX"Allocated SCB for Received Subscribe, event=%d," - " scb=%d sub_id=%x\n", DEB_F_PREFIX_ARGS(SIP_SUB, fname), scbpReg->hb.event_type, + " scb=%d sub_id=%x\n", DEB_F_PREFIX_ARGS(SIP_SUB, fname), scbpReg->hb.event_type, scb_index, scbp->sub_id); scbp->hb.event_type = scbpReg->hb.event_type; scbp->subsIndCallback = scbpReg->subsIndCallback; @@ -3059,7 +3030,7 @@ subsmanager_handle_ev_sip_subscribe (sipMessage_t *pSipMessage, CCSIP_DEBUG_ERROR(get_debug_string(DEBUG_SIP_SPI_SEND_ERROR), fname, SIP_CLI_ERR_BAD_REQ); } - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Freeing SCB: scb=%d sub_id=%x\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Freeing SCB: scb=%d sub_id=%x\n", DEB_F_PREFIX_ARGS(SIP_SUB, fname), scb_index, scbp->sub_id); free_scb(scb_index, fname); sippmh_free_location(to_loc); @@ -3261,7 +3232,7 @@ subsmanager_handle_ev_sip_subscribe (sipMessage_t *pSipMessage, 0, NULL, NULL); - return SIP_ERROR; + return SIP_ERROR; } } @@ -3339,13 +3310,13 @@ subsmanager_handle_ev_sip_subscribe (sipMessage_t *pSipMessage, if (scp != NULL) { // Hand over the event to platform sip_platform_handle_service_control_notify(scp); - + sippmh_free_service_control_info(scp); - + } /* If this is the only body then have to send the response out as - * no other application will be requesting to send response + * no other application will be requesting to send response */ if (i== 0 && pSipMessage->mesg_body[i+1].msgBody == NULL) { @@ -3437,7 +3408,7 @@ subsmanager_handle_ev_sip_subscribe (sipMessage_t *pSipMessage, * * @pre (pSipMessage != NULL) && (dataPP != NULL) */ -static boolean +static boolean decode_message_body (cc_subscriptions_t event_type, sipMessage_t *pSipMessage, ccsip_event_data_t **dataPP) { const char *fname = "decode_message_body"; @@ -3726,7 +3697,7 @@ subsmanager_handle_ev_sip_subscribe_notify (sipMessage_t *pSipMessage) CCSIP_DEBUG_ERROR(get_debug_string(DEBUG_SIP_SPI_SEND_ERROR), fname, SIP_CLI_ERR_BAD_REQ); } - // Send message to the app and let it decide what it wants + // Send message to the app and let it decide what it wants // to do with a bad NOTIFY sip_subsManager_send_protocol_error(scbp, scb_index, FALSE); return SIP_ERROR; @@ -4245,7 +4216,7 @@ sipSPISendSubscribe (sipSCB_t *scbp, boolean renew, boolean authen) CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Error in adding Event header\n", fname); free_sip_message(request); return (FALSE); - } + } } if (scbp->hb.accept_type == CC_SUBSCRIPTIONS_DIALOG) { @@ -4442,7 +4413,7 @@ sipSPISendSubscribeNotifyResponse (sipSCB_t *scbp, free_sip_message(response); return FALSE; } - + /* * find the transaction and fetch the via header */ @@ -5046,7 +5017,7 @@ subsmanager_handle_retry_timer_expire (int scb_index) uint32_t timeout = 0; CCSIP_DEBUG_TASK("Entering %s. scb_index: %d\n", fname, scb_index); - + if (scb_index < 0 || scb_index >= MAX_SCBS) { return (-1); } @@ -5101,7 +5072,7 @@ subsmanager_handle_retry_timer_expire (int scb_index) } else { sub_not_result_data.u.notify_result_data.status_code = REQUEST_TIMEOUT; // Set the state to ACTIVE, so we can go on appropriately. Note that - // this assignment below should be placed before sip_send_error_message() so + // this assignment below should be placed before sip_send_error_message() so // that in case of callback running on same thread freed the scb, we will not // set it back to active and try to use it later. scbp->smState = SUBS_STATE_ACTIVE; diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_task.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_task.c index f18fb0cf585d..318f2af83a8c 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_task.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_task.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdio.h" @@ -97,7 +62,7 @@ void sip_platform_handle_service_control_notify(sipServiceControl_t *scp); short SIPTaskProcessTimerExpiration(void *msg, uint32_t *cmd); extern cprMsgQueue_t sip_msgq; extern cprMsgQueue_t gsm_msgq; -extern void ccsip_dump_recv_msg_info(sipMessage_t *pSIPMessage, +extern void ccsip_dump_recv_msg_info(sipMessage_t *pSIPMessage, cpr_ip_addr_t *cc_remote_ipaddr, uint16_t cc_remote_port); void destroy_sip_thread(void); @@ -124,7 +89,7 @@ void destroy_sip_thread(void); * for RT, the threshold of 60 is not based on testing. * As discussed in CSCsz33584 Code Review, it is better to drop the heavy load as it enters the system than let it go deep into the system. * So we add the same logic into RT, but RT still cannot pass the test in CSCsz33584. - * Bottleneck of RT might be ccapp_msgq instead of gsm_msgq. + * Bottleneck of RT might be ccapp_msgq instead of gsm_msgq. * A more complex solution should be studied to prevent RT phone from overload. */ #define MAX_DEPTH_OF_GSM_MSGQ_TO_ALLOW_NEW_INCOMING_CALL 60 @@ -429,9 +394,9 @@ SIPTaskProcessListEvent (uint32_t cmd, void *msg, void *pUsr, uint16_t len) * (note this can happen any time the network stack is re-spun) */ if ((sip.taskInited == FALSE) && - ((cmd != TCP_PHN_CFG_TCP_DONE) && + ((cmd != TCP_PHN_CFG_TCP_DONE) && (cmd != SIP_RESTART) && - (cmd != SIP_TMR_SHUTDOWN_PHASE2) && + (cmd != SIP_TMR_SHUTDOWN_PHASE2) && (cmd != SIP_SHUTDOWN) && (cmd != TIMER_EXPIRATION) && (cmd != THREAD_UNLOAD)) ) { @@ -440,7 +405,7 @@ SIPTaskProcessListEvent (uint32_t cmd, void *msg, void *pUsr, uint16_t len) DEB_F_PREFIX_ARGS(SIP_EVT, fname), cmd); return; } - + memset(&sip_sm_event, 0, sizeof(sipSMEvent_t)); /* @@ -485,7 +450,7 @@ SIPTaskProcessListEvent (uint32_t cmd, void *msg, void *pUsr, uint16_t len) if (p2psip == TRUE) CC_Config_setIntValue(CFGID_TRANSPORT_LAYER_PROT, 2); - + if (sip_sm_init() < 0) { CCSIP_DEBUG_ERROR(SIP_F_PREFIX"sip_sm_init() failed ", fname); return; @@ -562,7 +527,7 @@ SIPTaskProcessListEvent (uint32_t cmd, void *msg, void *pUsr, uint16_t len) cpr_free(msg); if (!sip_sm_event.ccb) { CCSIP_DEBUG_TASK(DEB_F_PREFIX"usrData does not point to a valid ccb " - "discarding SIP_TMR_SUPERVISION_DISCONNECT event.\n", + "discarding SIP_TMR_SUPERVISION_DISCONNECT event.\n", DEB_F_PREFIX_ARGS(SIP_EVT, fname)); break; } @@ -868,7 +833,7 @@ SIPTaskProcessListEvent (uint32_t cmd, void *msg, void *pUsr, uint16_t len) // Handle restart event from platform cpr_free(msg); - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received SIP_RESTART event restartCmd = (%d)\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received SIP_RESTART event restartCmd = (%d)\n", DEB_F_PREFIX_ARGS(SIP_EVT, fname), restartCmd); SIPTaskProcessRestart(restartCmd); break; @@ -904,7 +869,7 @@ SIPTaskProcessListEvent (uint32_t cmd, void *msg, void *pUsr, uint16_t len) action = req->action; reason = req->reason; cpr_free(msg); - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received SIP_SHUTDOWN message\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received SIP_SHUTDOWN message\n", DEB_F_PREFIX_ARGS(SIP_EVT, fname)); SIPTaskProcessShutdown(action, reason); } @@ -959,7 +924,7 @@ SIPTaskCheckSource (cpr_sockaddr_storage from) // If not registered, return ok config_get_value(CFGID_PROXY_REGISTER, ®ConfigValue, sizeof(regConfigValue)); if (regConfigValue == 0) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"CFGID_PROXY_REGISTER is false\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"CFGID_PROXY_REGISTER is false\n", DEB_F_PREFIX_ARGS(SIP_IP_MATCH, fname)); return SIP_OK; } @@ -973,7 +938,7 @@ SIPTaskCheckSource (cpr_sockaddr_storage from) fromIPAddrStr[0] = '\0'; ipaddr2dotted(fromIPAddrStr, &fromIPAddr); - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Attempting to recognize \"%s\"\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Attempting to recognize \"%s\"\n", DEB_F_PREFIX_ARGS(SIP_IP_MATCH, fname), fromIPAddrStr); // Get the proxy configured for all lines and check against those for (line_index = REG_CCB_START; line_index <= line_end; line_index++) { @@ -981,7 +946,7 @@ SIPTaskCheckSource (cpr_sockaddr_storage from) if (sip_config_check_line((line_t)(line_index - TEL_CCB_END))) { ccb = sip_sm_get_ccb_by_index(line_index); if (ccb && util_compare_ip(&(ccb->reg.addr), &fromIPAddr)) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Found server IP match\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Found server IP match\n", DEB_F_PREFIX_ARGS(SIP_IP_MATCH, fname)); retval = SIP_OK; break; @@ -994,7 +959,7 @@ SIPTaskCheckSource (cpr_sockaddr_storage from) // Not found - continue to check backup CCBs ccb = sip_sm_get_ccb_by_index(REG_BACKUP_CCB); if (ccb && util_compare_ip(&(ccb->reg.addr), &fromIPAddr)) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Found backup server IP match\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Found backup server IP match\n", DEB_F_PREFIX_ARGS(SIP_IP_MATCH, fname)); retval = SIP_OK; } @@ -1007,7 +972,7 @@ SIPTaskCheckSource (cpr_sockaddr_storage from) ccb = sip_regmgr_get_fallback_ccb_list(data_p); while ((ccb != NULL) && (retval != SIP_OK)) { if (util_compare_ip(&(ccb->reg.addr), &fromIPAddr)) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Found fallback server IP match\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Found fallback server IP match\n", DEB_F_PREFIX_ARGS(SIP_IP_MATCH, fname)); retval = SIP_OK; } @@ -1047,7 +1012,7 @@ SIPTaskProcessUDPMessage (cprBuffer_t msg, * Convert IP address to string, for debugs */ util_extract_ip(&ip_addr, &from); - + util_ntohl(&ip_addr, &ip_addr); if (SipDebugMessage) { @@ -1086,7 +1051,7 @@ SIPTaskProcessUDPMessage (cprBuffer_t msg, */ - + config_get_value(CFGID_P2PSIP, &p2psip, sizeof(p2psip)); if (p2psip == 0) { @@ -1279,8 +1244,8 @@ SIPTaskProcessTimerExpiration (void *msg, uint32_t *cmd) TMR_DEBUG(DEB_F_PREFIX"Timer %s expired. Id is %d\n", DEB_F_PREFIX_ARGS(SIP_TIMER, fname), timerMsg->expiredTimerName, timerMsg->expiredTimerId); - /* The REGALLFAIL Timer message could come in before the task has - * been initialized. Need to handle this timer, in order to restart + /* The REGALLFAIL Timer message could come in before the task has + * been initialized. Need to handle this timer, in order to restart * the system. */ if ((sip.taskInited == FALSE) && (timerMsg->expiredTimerId != SIP_REGALLFAIL_TIMER)) { return returnCode; @@ -1359,7 +1324,7 @@ SIPTaskProcessTimerExpiration (void *msg, uint32_t *cmd) "returned error.\n", fname); } break; - + case SIP_UNSOLICITED_TRANSACTION_TIMER: subsmanager_unsolicited_notify_timeout(timerMsg->usrData); break; @@ -1371,7 +1336,7 @@ SIPTaskProcessTimerExpiration (void *msg, uint32_t *cmd) case SIP_PASSTHROUGH_TIMER: CCSIP_DEBUG_ERROR("%s: Pass Through Timer fired ! \n", fname); break; - + case SIP_REGALLFAIL_TIMER: sip_regmgr_regallfail_timer_callback(timerMsg->usrData); break; @@ -1631,18 +1596,18 @@ SIPTaskProcessSIPMessage (sipMessage_t *pSipMessage) } if (is_request == FALSE) { switch (method) { - case sipMethodSubscribe: - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv Subs Response.\n", + case sipMethodSubscribe: + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv Subs Response.\n", DEB_F_PREFIX_ARGS(SIP_MSG_RECV, fname)); (void) subsmanager_handle_ev_sip_response(pSipMessage); cpr_free(sipCseq); free_sip_message(pSipMessage); return; - - case sipMethodNotify: + + case sipMethodNotify: scbp = find_scb_by_callid(pCallID, &scb_index); if (scbp != NULL) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv Notify response\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv Notify response\n", DEB_F_PREFIX_ARGS(SIP_MSG_RECV, fname)); (void) subsmanager_handle_ev_sip_response(pSipMessage); cpr_free(sipCseq); @@ -1651,7 +1616,7 @@ SIPTaskProcessSIPMessage (sipMessage_t *pSipMessage) } else { tcbp = find_tcb_by_sip_callid(pCallID); if (tcbp != NULL) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv Unsolicited Notify response\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv Unsolicited Notify response\n", DEB_F_PREFIX_ARGS(SIP_MSG_RECV, fname)); (void) subsmanager_handle_ev_sip_unsolicited_notify_response(pSipMessage, tcbp); cpr_free(sipCseq); @@ -1662,16 +1627,16 @@ SIPTaskProcessSIPMessage (sipMessage_t *pSipMessage) break; case sipMethodPublish: - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv PUBLISH Response.\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv PUBLISH Response.\n", DEB_F_PREFIX_ARGS(SIP_MSG_RECV, fname)); - (void) publish_handle_ev_sip_response(pSipMessage); + (void) publish_handle_ev_sip_response(pSipMessage); cpr_free(sipCseq); free_sip_message(pSipMessage); return; case sipMethodInfo: // XXX FIXME see the comments in sipSPISendInfo() - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv INFO Response (silently dropped).\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv INFO Response (silently dropped).\n", DEB_F_PREFIX_ARGS(SIP_MSG_RECV, fname)); cpr_free(sipCseq); free_sip_message(pSipMessage); @@ -1679,7 +1644,7 @@ SIPTaskProcessSIPMessage (sipMessage_t *pSipMessage) default: break; - + } } @@ -1714,7 +1679,7 @@ SIPTaskProcessSIPMessage (sipMessage_t *pSipMessage) // This may be a response for a request generated via sub/not i/f scbp = find_scb_by_callid(pCallID, &scb_index); if (scbp != NULL) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv Refer Response.\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv Refer Response.\n", DEB_F_PREFIX_ARGS(SIP_MSG_RECV, fname)); (void) subsmanager_handle_ev_sip_response(pSipMessage); } else { @@ -1741,7 +1706,7 @@ SIPTaskProcessSIPMessage (sipMessage_t *pSipMessage) * Unsolicited options processing */ if ((is_request) && (method == sipMethodOptions)) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"recv SIP OPTIONS (outside of dialog) message.\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"recv SIP OPTIONS (outside of dialog) message.\n", DEB_F_PREFIX_ARGS(SIP_MSG_RECV, fname)); // /* * Send an options request to the gsm for this out of call @@ -1792,17 +1757,17 @@ SIPTaskProcessSIPMessage (sipMessage_t *pSipMessage) return; } else if (cprGetDepth(gsm_msgq) > MAX_DEPTH_OF_GSM_MSGQ_TO_ALLOW_NEW_INCOMING_CALL) { - /* - * CSCsz33584 - * if gsm_msgq depth is larger than MAX_DEPTH_OF_GSM_MSGQ_TO_ALLOW_NEW_INCOMING_CALL, + /* + * CSCsz33584 + * if gsm_msgq depth is larger than MAX_DEPTH_OF_GSM_MSGQ_TO_ALLOW_NEW_INCOMING_CALL, * it's risky to accept new incoming call. - * just ignore the INVITE message to save CPU time so that the messages in gsm_msgq can be processed faster. + * just ignore the INVITE message to save CPU time so that the messages in gsm_msgq can be processed faster. */ CCSIP_DEBUG_ERROR(DEB_F_PREFIX"gsm msgq depth too large, drop incoming INVITEs!!!\n", - DEB_F_PREFIX_ARGS(SIP_MSG_RECV, fname)); + DEB_F_PREFIX_ARGS(SIP_MSG_RECV, fname)); cpr_free(sipCseq); free_sip_message(pSipMessage); - return; + return; } ccb = sip_sm_get_ccb_next_available(&line_index); @@ -1837,7 +1802,7 @@ SIPTaskProcessSIPMessage (sipMessage_t *pSipMessage) * Detect whether the message is a non-ACK request addressing the * previous call. If so, reTx the stored response. */ - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Line filter: Previous Call ID.\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Line filter: Previous Call ID.\n", DEB_F_PREFIX_ARGS(SIP_ID, fname)); if (SipRelDevEnabled) { if (SIPTaskRetransmitPreviousResponse(pSipMessage, fname, @@ -1876,7 +1841,7 @@ SIPTaskProcessSIPMessage (sipMessage_t *pSipMessage) sip_sm_check_retx_timers(sip_sm_get_ccb_by_index(previous_call_index), pSipMessage); } - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Not forwarding response to SIP SM.\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Not forwarding response to SIP SM.\n", DEB_F_PREFIX_ARGS(SIP_FWD, fname)); cpr_free(sipCseq); free_sip_message(pSipMessage); @@ -1902,7 +1867,7 @@ SIPTaskProcessSIPMessage (sipMessage_t *pSipMessage) return; } } - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Not forwarding response to SIP SM.\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Not forwarding response to SIP SM.\n", DEB_F_PREFIX_ARGS(SIP_FWD, fname)); if (method == sipMethodBye) { @@ -1922,14 +1887,14 @@ SIPTaskProcessSIPMessage (sipMessage_t *pSipMessage) } else { if (method == sipMethodRefer) { if (is_request) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received OOD Refer.\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received OOD Refer.\n", DEB_F_PREFIX_ARGS(SIP_MSG_RECV, fname)); if (subsmanager_handle_ev_sip_subscribe(pSipMessage, sipMethodRefer, FALSE) != SIP_ERROR) { // Successfully handled - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Successfully handled OOD Refer.\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Successfully handled OOD Refer.\n", DEB_F_PREFIX_ARGS(SIP_MSG_RECV, fname)); } else { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Not able to handle OOD Refer.\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Not able to handle OOD Refer.\n", DEB_F_PREFIX_ARGS(SIP_MSG_RECV, fname)); } } else { @@ -1937,7 +1902,7 @@ SIPTaskProcessSIPMessage (sipMessage_t *pSipMessage) // interface scbp = find_scb_by_callid(pCallID, &scb_index); if (scbp != NULL) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv Refer Response\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv Refer Response\n", DEB_F_PREFIX_ARGS(SIP_MSG_RECV, fname)); (void) subsmanager_handle_ev_sip_response(pSipMessage); } @@ -2160,7 +2125,7 @@ SIPTaskProcessSIPMessage (sipMessage_t *pSipMessage) /* * Process response */ - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received SIP response.\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Received SIP response.\n", DEB_F_PREFIX_ARGS(SIP_MSG_RECV, fname)); responseStatus = sipSPICheckResponse(ccb, pSipMessage); if (responseStatus != SIP_MESSAGING_OK) { @@ -2174,7 +2139,7 @@ SIPTaskProcessSIPMessage (sipMessage_t *pSipMessage) // This may be a response for a request generated via sub/not i/f scbp = find_scb_by_callid(pCallID, &scb_index); if (scbp != NULL) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv Refer Response.\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv Refer Response.\n", DEB_F_PREFIX_ARGS(SIP_MSG_RECV, fname)); (void) subsmanager_handle_ev_sip_response(pSipMessage); } @@ -2206,19 +2171,19 @@ SIPTaskProcessSIPMessage (sipMessage_t *pSipMessage) switch (code_class) { case codeClass1xx: - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv 1xx message.\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv 1xx message.\n", DEB_F_PREFIX_ARGS(SIP_MSG_RECV, fname)); sip_sm_event.type = E_SIP_1xx; break; case codeClass2xx: - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv 2xx message.\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv 2xx message.\n", DEB_F_PREFIX_ARGS(SIP_MSG_RECV, fname)); sip_sm_event.type = E_SIP_2xx; break; case codeClass3xx: - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv 3xx message.\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv 3xx message.\n", DEB_F_PREFIX_ARGS(SIP_MSG_RECV, fname)); sip_sm_event.type = E_SIP_3xx; break; @@ -2226,7 +2191,7 @@ SIPTaskProcessSIPMessage (sipMessage_t *pSipMessage) case codeClass4xx: case codeClass5xx: case codeClass6xx: - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv 4xx/5xx/6xx message.\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Recv 4xx/5xx/6xx message.\n", DEB_F_PREFIX_ARGS(SIP_MSG_RECV, fname)); sip_sm_event.type = E_SIP_FAILURE_RESPONSE; switch (response_code) { @@ -2340,7 +2305,7 @@ SIPTaskProcessConfigChangeNotify (int32_t notify_type) static const char *fname = "SIPTaskProcessConfigChangeNotify"; int retval = 0; - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Notify received type=%d\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Notify received type=%d\n", DEB_F_PREFIX_ARGS(SIP_NOTIFY, fname), notify_type); if (notify_type & AA_RELOAD) { @@ -2354,7 +2319,7 @@ SIPTaskProcessConfigChangeNotify (int32_t notify_type) * the other case, booting, is handled by the boot code */ (void) sipTransportInit(); - + /* need to unregister the phone */ ccsip_register_cancel(FALSE, TRUE); ccsip_register_reset_proxy(); @@ -2385,7 +2350,7 @@ SIPTaskProcessConfigChangeNotify (int32_t notify_type) * * Return Value: SIP_OK, SIP_ERROR, SIP_DEFER. * - * Note: The parameter pSipMessage is expected by the caller to be + * Note: The parameter pSipMessage is expected by the caller to be * preserved i.e. it can not be freed by this * function or the functions called by this function. */ @@ -2594,21 +2559,21 @@ SIPTaskProcessSIPNotifyMWI (sipMessage_t* pSipMessage, line_t dn_line) (pSipMessage->mesg_body[0].msgContentTypeValue != SIP_CONTENT_TYPE_MWI_VALUE && pSipMessage->mesg_body[0].msgContentTypeValue != SIP_CONTENT_TYPE_TEXT_PLAIN_VALUE)) { return SIP_ERROR; - } + } memset(&mesgSummary, 0, sizeof(sipMessageSummary_t)); if (sippmh_parse_message_summary(pSipMessage, &mesgSummary) < 0) { - return SIP_ERROR; - } - + return SIP_ERROR; + } + sip_cc_mwi(CC_NO_CALL_ID, dn_line, mesgSummary.mesg_waiting_on, mesgSummary.type, mesgSummary.newCount, mesgSummary.oldCount, mesgSummary.hpNewCount, mesgSummary.hpOldCount); - + /* * Send 200 OK back */ - (void) sipSPISendErrorResponse(pSipMessage, 200, SIP_SUCCESS_SETUP_PHRASE, + (void) sipSPISendErrorResponse(pSipMessage, 200, SIP_SUCCESS_SETUP_PHRASE, 0, NULL, NULL); return SIP_OK; @@ -2672,7 +2637,7 @@ SIPTaskProcessSIPNotifyRefer (sipMessage_t *pSipMessage) if (pSipMessage->mesg_body[0].msgBody == NULL) { data.notify.cause = CC_CAUSE_OK; - if (fsmxfr_get_xcb_by_call_id(ccb->gsm_id) && + if (fsmxfr_get_xcb_by_call_id(ccb->gsm_id) && (fsmxfr_get_xfr_type(ccb->gsm_id) == FSMXFR_TYPE_BLND_XFR)) { data.notify.cause = CC_CAUSE_ERROR; data.notify.method = CC_XFER_METHOD_REFER; @@ -2974,13 +2939,13 @@ SIPTaskProcessRestart (ccsip_restart_cmd cmd) static const char fname[] = "SIPTaskProcessRestart"; if (cmd == SIP_RESTART_REQ_RESTART) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Starting Restart Process\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Starting Restart Process\n", DEB_F_PREFIX_ARGS(SIP_TASK, fname)); /* Restart SIP task */ sip_restart(); } else if (cmd == SIP_RESTART_REQ_REINIT) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Starting Re-init Process\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Starting Re-init Process\n", DEB_F_PREFIX_ARGS(SIP_TASK, fname)); // Re-initialize the various components @@ -3004,12 +2969,12 @@ SIPTaskReinitialize (boolean checkConfig) // If the config has changed, or if the check is being bypassed, re-init reg-mgr if ( !checkConfig || sip_regmgr_check_config_change() ) { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"Config change detected: Restarting\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"Config change detected: Restarting\n", DEB_F_PREFIX_ARGS(SIP_TASK, fname)); sip_regmgr_process_config_change(); return; } else { - CCSIP_DEBUG_TASK(DEB_F_PREFIX"No config change detected\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"No config change detected\n", DEB_F_PREFIX_ARGS(SIP_TASK, fname)); } } @@ -3030,7 +2995,7 @@ SIPTaskPostShutdown (int action, int reason, const char *reasonInfo) msg->reason = reason; if (reasonInfo) { sstrncpy(sipUnregisterReason, reasonInfo, MAX_SIP_REASON_LENGTH); - } + } /* send a restart message to the SIP Task */ if (SIPTaskSendMsg(SIP_SHUTDOWN, (cprBuffer_t)msg, @@ -3050,7 +3015,7 @@ SIPTaskProcessShutdown (int action, int reason) /* Shutdown SIP components */ sip_shutdown_phase1(action, reason); } -/* +/* * Function: destroy_sip_thread * Description: kill sip msgQ and sip thread * Parameters: none @@ -3059,7 +3024,7 @@ SIPTaskProcessShutdown (int action, int reason) void destroy_sip_thread() { static const char fname[] = "destroy_sip_thread"; - DEF_DEBUG(DEB_F_PREFIX"Unloading SIP and destroying sip thread\n", + DEF_DEBUG(DEB_F_PREFIX"Unloading SIP and destroying sip thread\n", DEB_F_PREFIX_ARGS(SIP_CC_INIT, fname)); /* kill msgQ thread first, then itself */ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_callinfo.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_callinfo.h index 8de7df0d71e3..3619a8988351 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_callinfo.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_callinfo.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSIP_CALLINFO_H_ #define _CCSIP_CALLINFO_H_ @@ -78,8 +43,8 @@ #define SIP_CI_ORIENTATION "orientation=" #define SIP_CI_ORIENTATION_TO "to" #define SIP_CI_ORIENTATION_FROM "from" -#define SIP_CI_POLICY "policy=" -#define SIP_CI_POLICY_UNKNOWN "unknown" +#define SIP_CI_POLICY "policy=" +#define SIP_CI_POLICY_UNKNOWN "unknown" #define SIP_CI_POLICY_CHAPERONE "chaperone" #define SIP_CI_CALL_INSTANCE "call-instance=" #define SIP_CI_CTI_CALLID "cti-callid=" @@ -113,7 +78,7 @@ char* ccsip_encode_call_info_hdr(cc_call_info_t *call_info_p, const char *misc_parms_p); -void ccsip_free_call_info_header(cc_call_info_t *call_info_p); +void ccsip_free_call_info_header(cc_call_info_t *call_info_p); void ccsip_store_call_info(cc_call_info_t *call_info_p, ccsipCCB_t* ccb); void ccsip_process_call_info_header(sipMessage_t *request_p, ccsipCCB_t* ccb); diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_cc.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_cc.h index 590336c2cfd3..be7ea6860b5d 100755 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_cc.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_cc.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSIP_CC_H_ #define _CCSIP_CC_H_ @@ -64,7 +29,7 @@ void sip_cc_release_complete(int gsm_call_id, int line, cc_causes_t cause); void sip_cc_feature(int call_id, int line, int feature, void *data); void sip_cc_feature_ack(int call_id, int line, int feature, void *data, cc_causes_t cause); -void sip_cc_mwi(int call_id, int line, boolean on, int type, +void sip_cc_mwi(int call_id, int line, boolean on, int type, int newCount, int oldCount, int hpNewCount, int hpOldCount); void sip_cc_mv_msg_body_to_cc_msg(cc_msgbody_info_t *cc_msg, sipMessage_t *sip_msg); diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_common_cb.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_common_cb.h index 26caa17d4196..3547596800e2 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_common_cb.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_common_cb.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSIP_COMMON_CB_H_ #define _CCSIP_COMMON_CB_H_ @@ -56,7 +21,7 @@ typedef enum { SUBNOT_CB, PUBLISH_CB, - UNSOLICIT_NOTIFY_CB + UNSOLICIT_NOTIFY_CB } ccsip_cb_type_e; diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_core.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_core.h index 47a0a8c13a62..39525b2bb1a9 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_core.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_core.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSIP_CORE_H_ #define _CCSIP_CORE_H_ @@ -620,7 +585,7 @@ typedef struct boolean send_reason_header; uint32_t callref; - + } ccsipCCB_t; diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_credentials.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_credentials.h index a082eeb1fbb0..e23a43372fa8 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_credentials.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_credentials.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSIP_CREDENTIALS_H_ #define _CCSIP_CREDENTIALS_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_macros.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_macros.h index c22866bc9394..40a560bb5410 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_macros.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_macros.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSIP_MACROS_H_ #define _CCSIP_MACROS_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_messaging.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_messaging.h index 3d68032bb51f..0ee3b4d83208 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_messaging.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_messaging.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSIP_MESSAGING_H_ #define _CCSIP_MESSAGING_H_ @@ -195,7 +160,7 @@ void sipSPIGenerateGenAuthorizationResponse(ccsipCCB_t *ccb, void sipSPIGenerateTargetUrl(genUrl_t *genUrl, char *sipurlstr); void sipSPIGenerateSipUrl(sipUrl_t *sipUrl, char *sipurlstr); -boolean sipSPISendRefer(ccsipCCB_t *ccb, char *referto, +boolean sipSPISendRefer(ccsipCCB_t *ccb, char *referto, sipRefEnum_e referto_type); boolean sipSPISendReferResponse202(ccsipCCB_t *ccb); boolean sipSPISendNotify(ccsipCCB_t *ccb, int referto); @@ -210,7 +175,7 @@ boolean sipSPISendNotifyResponse(ccsipCCB_t *ccb, cc_causes_t cause); boolean sipSPIAddStdHeaders(sipMessage_t *msg, ccsipCCB_t *ccb, boolean isResponse); -sipMessage_t *sipSPIBuildRegisterHeaders(ccsipCCB_t *ccb, +sipMessage_t *sipSPIBuildRegisterHeaders(ccsipCCB_t *ccb, const char *user, int expires_int); boolean sipSPIAddLocalVia(sipMessage_t *msg, diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_platform.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_platform.h index d4b805d7cac3..36b8c9256844 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_platform.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_platform.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSIP_PLATFORM_H_ #define _CCSIP_PLATFORM_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_platform_tcp.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_platform_tcp.h index e5fb8ee14fec..21c0b0342d78 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_platform_tcp.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_platform_tcp.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef __CCSIP_PLATFORM_TCP__H__ #define __CCSIP_PLATFORM_TCP__H__ @@ -51,7 +16,7 @@ #define SIP_TCP_NOT_CONNECTED 0 #define SIP_TCP_CONNECTED 1 - + typedef struct _sendData { struct _sendData *next; diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_platform_timers.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_platform_timers.h index 4786d66c9794..06a6f54a26a3 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_platform_timers.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_platform_timers.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSIP_PLATFORM_TIMERS_H_ #define _CCSIP_PLATFORM_TIMERS_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_platform_tls.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_platform_tls.h index 706361c6ccd3..6d6fba937802 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_platform_tls.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_platform_tls.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef __CCSIP_PLATFORM_TLS__H__ #define __CCSIP_PLATFORM_TLS__H__ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_platform_udp.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_platform_udp.h index a745d9beedd2..9eddc2094b9b 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_platform_udp.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_platform_udp.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSIP_PLATFORM_UDP_H_ #define _CCSIP_PLATFORM_UDP_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_pmh.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_pmh.h index 454cfd66305d..303eddde7462 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_pmh.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_pmh.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSIP_PMH_H_ #define _CCSIP_PMH_H_ @@ -660,7 +625,7 @@ PMH_EXTERN uint16_t sippmh_parse_allow_header(const char *header); PMH_EXTERN uint16_t sippmh_parse_accept_header(const char *header); -PMH_EXTERN sipServiceControl_t +PMH_EXTERN sipServiceControl_t *sippmh_parse_service_control_body(char *msgBody, int msgLength); PMH_EXTERN void sippmh_free_service_control_info(sipServiceControl_t *scp); @@ -677,7 +642,7 @@ PMH_EXTERN int32_t sippmh_parse_max_forwards(const char *max_fwd_hdr); PMH_EXTERN string_t sippmh_get_url_from_hdr(char *string); PMH_EXTERN int32_t sippmh_parse_message_summary(sipMessage_t *pSipMessage, sipMessageSummary_t *mesgSummary); - + /* * The following SIP parser functions are the same as corresponding * HTTP/1.1 message parser functions. diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_protocol.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_protocol.h index 327ecd2dc259..ca6033553b73 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_protocol.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_protocol.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSIP_PROTOCOL_H_ #define _CCSIP_PROTOCOL_H_ @@ -437,7 +402,7 @@ typedef struct sip_header_ #define REQ_SUPP_PARAM_CISCO_CONFIG "X-cisco-config" #define REQ_SUPP_PARAM_SDP_ANAT "sdp-anat" /* Add defines for the SIP Interfcae Specification (SIS) protocol version tags*/ -#define REQ_SUPP_PARAM_CISCO_SISTAG "X-cisco-sis-" +#define REQ_SUPP_PARAM_CISCO_SISTAG "X-cisco-sis-" #define SIS_CURRENT_PROTOCOL_VERSION "5.2.0" #define SIS_PROTOCOL_MAJOR_VERSION_SEADRAGON 1 #define SIS_PROTOCOL_MAJOR_VERSION_MUSTER 2 @@ -447,7 +412,7 @@ typedef struct sip_header_ #define SIS_PROTOCOL_MINOR_VERSION_ANGELFIRE 1 #define SIS_PROTOCOL_MINOR_VERSION_MONTBLANC 1 #define REQ_SUPP_PARAM_CISCO_SIPVER REQ_SUPP_PARAM_CISCO_SISTAG SIS_CURRENT_PROTOCOL_VERSION -#define REQ_SUPP_PARAM_CISCO_MONREC "X-cisco-monrec" +#define REQ_SUPP_PARAM_CISCO_MONREC "X-cisco-monrec" /* Add define for CME version negotiation */ #define REQ_SUPP_PARAM_CISCO_CME_SISTAG "X-cisco-cme-sis-" @@ -676,5 +641,5 @@ typedef struct sip_header_ #define SIP_CLI_ERR_BAD_REQ_NO_BODY "Bad Request - 'Body Expected'" #define SIP_CLI_ERR_BAD_REQ_NO_SUBSCRIPTION_HEADER "Bad Request - 'Malformed/Missing Subscription-State Header'" #define SIP_CLI_ERR_BAD_REQ_CONTENT_ID_ERROR "Bad Request - 'Invalid Content-Id field'" -#define SIP_CLI_ERR_BAD_REQ_REQUIRE_HDR "Bad Request - 'Malformed/Missing Require header'" +#define SIP_CLI_ERR_BAD_REQ_REQUIRE_HDR "Bad Request - 'Malformed/Missing Require header'" #endif /*_CCSIP_PROTOCOL_H_*/ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_publish.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_publish.h index e138fd332890..3e823e1e8cb4 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_publish.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_publish.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSIP_PUBLISH_H_ #define _CCSIP_PUBLISH_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_register.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_register.h index d117ed6df7f3..4148bdb314ee 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_register.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_register.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSIP_REGISTER_H_ #define _CCSIP_REGISTER_H_ @@ -77,8 +42,8 @@ /* These numbers need to match up with whats defined on the J-Side - The Master copy should be here because - the reason needs to be sent out in the register + The Master copy should be here because + the reason needs to be sent out in the register message */ #define UNREG_REASON_UNSPECIFIED 0 diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_reldev.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_reldev.h index c2ffb4f27416..cf6a76431e85 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_reldev.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_reldev.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSIP_RELDEV_H_ #define _CCSIP_RELDEV_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_sdp.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_sdp.h index 78a40dbd2104..c2fd46fe64df 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_sdp.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_sdp.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSIP_SDP_H_ #define _CCSIP_SDP_H_ @@ -46,8 +11,6 @@ #include "sdp.h" #include "ccapi.h" -// RAMC-start -#define CCSIP_SDP_BUF_SIZE SDP_MAX_LEN /* SDP bitmask values */ #define CCSIP_SRC_SDP_BIT 0x1 @@ -92,7 +55,7 @@ PMH_EXTERN cc_sdp_t *sipsdp_create_from_buf(char *buf, uint32_t nbytes, */ #define SIPSDP_VERSION 0 // RAMC_DEBUG #define SIPSDP_ORIGIN_USERNAME "CiscoSystemsSIP-GW-UserAgent" -#define SIPSDP_ORIGIN_USERNAME "Cisco-SIPUA" +#define SIPSDP_ORIGIN_USERNAME "Mozilla-SIPUA" #define SIPSDP_SESSION_NAME "SIP Call" /* Possible encoding names fo static payload types*/ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_sim.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_sim.h index f484f1f90a17..89cff0a3d906 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_sim.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_sim.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSIP_SIM_H_ #define _CCSIP_SIM_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_spi_utils.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_spi_utils.h index f96a5e3272af..95aeb512162e 100755 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_spi_utils.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_spi_utils.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSIP_UTILS_H_ #define _CCSIP_UTILS_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_subsmanager.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_subsmanager.h index 21ea797b87af..fe66ac9e554f 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_subsmanager.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_subsmanager.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSIP_SUBSMANAGER_H_ #define _CCSIP_SUBSMANAGER_H_ @@ -83,7 +48,7 @@ typedef enum { /* * Subscription ID data type - */ + */ typedef uint32_t sub_id_t; #define MAX_EVENT_NAME_LEN 32 @@ -328,7 +293,7 @@ typedef struct { line_t line; // Subscription ID - sub_id_t sub_id; + sub_id_t sub_id; // SCB State boolean pendingClean; diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_task.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_task.h index 3098b8210610..801168e1684c 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_task.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_task.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCSIP_TASK_H_ #define _CCSIP_TASK_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/httpish.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/httpish.h index e4cf6f48c353..23c8e875a21f 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/httpish.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/httpish.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _HTTPISH_H_ #define _HTTPISH_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/httpish_protocol.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/httpish_protocol.h index 291f50b23710..3a1751d0e59a 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/httpish_protocol.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/httpish_protocol.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _HTTPISH_PROTOCOL_H_ #define _HTTPISH_PROTOCOL_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/pmhdefs.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/pmhdefs.h index 85895a1a8601..5e1338be967f 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/pmhdefs.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/pmhdefs.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _PMH_DEFS_H_ #define _PMH_DEFS_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/pmhutils.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/pmhutils.h index dc8386031f0a..0ffe1487c6c8 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/pmhutils.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/pmhutils.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _PMH_UTILS_H_ #define _PMH_UTILS_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/regmgrapi.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/regmgrapi.h index c0ba718c1f85..b4a7e51f5552 100755 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/regmgrapi.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/regmgrapi.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _REGMGRAPI_H_ #define _REGMGRAPI_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_ccm_transport.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_ccm_transport.h index 8bf6d45b819c..e200cdcd8be7 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_ccm_transport.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_ccm_transport.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef __SIP_CCM_TRANSPORT_H__ #define __SIP_CCM_TRANSPORT_H__ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_common_regmgr.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_common_regmgr.h index cca316139d0c..cb88fe7bfd83 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_common_regmgr.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_common_regmgr.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef __SIP_COMMON_REGMGR_H__ #define __SIP_COMMON_REGMGR_H__ @@ -123,7 +88,7 @@ typedef struct ccm_fallback_table_t_ { } ccm_fallback_table_t; typedef struct { - uint32_t ccb_index; /* ccb index for which this msg is intended for */ + uint32_t ccb_index; /* ccb index for which this msg is intended for */ CCM_ID ccm_id; /* cucm id */ } ccsip_registration_msg_t; @@ -188,5 +153,5 @@ extern boolean g_disable_mass_reg_debug_print; void regmgr_handle_register_update(line_t last_available_line); - + #endif /* __SIP_COMMON_REGMGR_H__ */ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_common_transport.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_common_transport.h index 0cb6e055d38f..e6b4bf0d7095 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_common_transport.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_common_transport.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef __SIP_COMMON_TRANSPORT_H__ #define __SIP_COMMON_TRANSPORT_H__ @@ -228,7 +193,7 @@ int sipTransportGetBkupServerPort(line_t line); int sipTransportGetEmerServerPort(line_t line); int sipTransportGetOutbProxyPort(line_t line); cpr_ip_type sipTransportGetPrimServerAddress(line_t line, char *buffer); -uint16_t sipTransportGetBkupServerAddress(cpr_ip_addr_t *pip_addr, +uint16_t sipTransportGetBkupServerAddress(cpr_ip_addr_t *pip_addr, line_t line, char *buffer); void sipTransportGetEmerServerAddress(line_t line, char *buffer); void sipTransportGetOutbProxyAddress(line_t line, char *buffer); @@ -245,7 +210,7 @@ const char *sipTransportGetTransportType(line_t line, boolean upper_case, ccsipCCB_t *ccb); void sipTransportShutdown(void); -extern void ccsip_dump_send_msg_info(char *msg, sipMessage_t *pSIPMessage, +extern void ccsip_dump_send_msg_info(char *msg, sipMessage_t *pSIPMessage, cpr_ip_addr_t *cc_remote_ipaddr, uint16_t cc_remote_port); void SIPTaskProcessTCPMessage(sipMessage_t *pSipMessage, diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_csps_transport.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_csps_transport.h index aa163219ace4..0797985e9b1a 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_csps_transport.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_csps_transport.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef __SIP_CSPS_TRANSPORT_H__ #define __SIP_CSPS_TRANSPORT_H__ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_interface_regmgr.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_interface_regmgr.h index c1d163eb9653..a12d17901c49 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_interface_regmgr.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_interface_regmgr.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _SIP_INTERFACE_REGMGR_H_ #define _SIP_INTERFACE_REGMGR_H_ @@ -95,5 +60,5 @@ extern void platform_reg_fallback_cfm(void); extern void platform_regallfail_ind(void *); extern void sip_platform_logout_reset_req(void); extern void platform_logout_reset_req (void); - + #endif /* _SIP_INTERFACE_REGMGR_H_ */ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_platform_task.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_platform_task.h index fab36ef37221..252190687396 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_platform_task.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/sip_platform_task.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _SIP_PLATFORM_TASK_H_ #define _SIP_PLATFORM_TASK_H_ diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/httpish.c b/media/webrtc/signaling/src/sipcc/core/sipstack/httpish.c index d4b607e57e2d..f909a7baf274 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/httpish.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/httpish.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * Functions that parse and create HTTP/1.1-like messages(RFC 2068). Basically @@ -108,7 +73,7 @@ httpish_msg_create (void) int httpish_strncasecmp(const char *s1, const char* s2, size_t len) { - /*This routine is an enhanced version of strncasecmp(). + /*This routine is an enhanced version of strncasecmp(). *It ensures that the two strings being compared for size "len" *don't have trailing characters beyond "len" chars. *The trailing whitespaces beyond "len" chars is ignored. @@ -131,7 +96,7 @@ httpish_strncasecmp(const char *s1, const char* s2, size_t len) } if (len == 0 && toupper(*us1) == toupper(*us2)) { - //all "len" chars are compared, need to look for trailing + //all "len" chars are compared, need to look for trailing //chars beyond "len" string size. Ignore white spaces. while (*(++us1) != '\0') { if (*us1 != ' ' && *us1 != '\t') { @@ -144,7 +109,7 @@ httpish_strncasecmp(const char *s1, const char* s2, size_t len) break; } } - } + } return (toupper(*us1) - toupper(*us2)); @@ -535,52 +500,52 @@ compact_hdr_cmp (char *this_line, return -1; } -int -httpish_header_name_val (char *sipHeaderName, char *this_line) +int +httpish_header_name_val (char *sipHeaderName, char *this_line) { unsigned int x = 0; boolean nameFound = FALSE; - + if (!sipHeaderName || !this_line) { - return (SIP_ERROR); + return (SIP_ERROR); } sipHeaderName[0] = '\0'; - + /* Remove the leading white spaces eg: ......From: or .....From....: */ while ((*this_line==' ' || *this_line=='\t') ) { this_line++; } - - /* Copy the allowed characters for header field name */ + + /* Copy the allowed characters for header field name */ while ((*this_line > 32) && (*this_line < 127) && (x < HTTPISH_HEADER_NAME_SIZE)) { if (*this_line == ':') { nameFound = TRUE; sipHeaderName[x] = '\0'; - break; + break; } sipHeaderName[x] = *this_line; this_line++; x++; } - - /* Remove trailing white spaces */ + + /* Remove trailing white spaces */ if (nameFound == FALSE && x < HTTPISH_HEADER_NAME_SIZE) { while ((*this_line == ' ' || *this_line=='\t') ){ this_line++; if (*this_line == ':') { nameFound = TRUE; sipHeaderName[x] = '\0'; - break; + break; } } } sipHeaderName[HTTPISH_HEADER_NAME_SIZE-1] = '\0'; - + if (nameFound) { - return (SIP_OK); + return (SIP_OK); } else { - return (SIP_ERROR); + return (SIP_ERROR); } } @@ -950,9 +915,9 @@ httpish_cache_header_val (httpishMsg_t *hmsg, if (httpish_header_name_val(headerName, this_line)) { CCSIP_DEBUG_MESSAGE(DEB_F_PREFIX"Invalid Header %s\n", DEB_F_PREFIX_ARGS(HTTPISH, fname), this_line); - return (SIP_ERROR); - } - + return (SIP_ERROR); + } + for (i = 0; i < HTTPISH_HEADER_CACHE_SIZE; ++i) { sip_header_t *tmp = sip_cached_headers + i; @@ -988,7 +953,7 @@ httpish_cache_header_val (httpishMsg_t *hmsg, hdr_cache[i].hdr_start = newbuf; hdr_cache[i].val_start = hdr_cache[i].hdr_start + offset; hdr_cache[i].hdr_start[org_len] = ','; - sstrncpy(hdr_cache[i].hdr_start + org_len + 1, this_line, + sstrncpy(hdr_cache[i].hdr_start + org_len + 1, this_line, size - org_len - 1); cpr_free(hdr_start); } else { @@ -1166,12 +1131,12 @@ msg_process_one_body (httpishMsg_t *hmsg, content_id++; } nbytes = strlen(content_id) + 1; - hmsg->mesg_body[current_body_part].msgContentId = - (char *) cpr_malloc((nbytes)*sizeof(char)); + hmsg->mesg_body[current_body_part].msgContentId = + (char *) cpr_malloc((nbytes)*sizeof(char)); if (hmsg->mesg_body[current_body_part].msgContentId == NULL) { CCSIP_DEBUG_ERROR(SIP_F_PREFIX"malloc failed\n", fname); } - memcpy(hmsg->mesg_body[current_body_part].msgContentId, + memcpy(hmsg->mesg_body[current_body_part].msgContentId, content_id, nbytes); } else if (!cpr_strncasecmp(line, SIP_HEADER_CONTENT_DISP, sizeof(SIP_HEADER_CONTENT_DISP) - 1)) { @@ -1502,10 +1467,10 @@ httpish_msg_process_network_msg (httpishMsg_t *hmsg, cpr_free(raw_body); return HSTATUS_FAILURE; } - memcpy(hmsg->mesg_body[0].msgContentId, + memcpy(hmsg->mesg_body[0].msgContentId, content_id, contentid_len); } - + hmsg->mesg_body[0].msgContentTypeValue = get_content_type_value(content_type); contenttype_len = strlen(content_type) + 1; hmsg->mesg_body[0].msgContentType = (char *) diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/pmhutils.c b/media/webrtc/signaling/src/sipcc/core/sipstack/pmhutils.c index 2afd11df5ca1..57c83d784c49 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/pmhutils.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/pmhutils.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdlib.h" @@ -265,8 +230,8 @@ pmhutils_wstream_write_line (pmhWstream_t *pmhWstream, char *this_line) if (!pmhutils_wstream_write_byte(pmhWstream, '\r')) { return FALSE; } - - if (!pmhutils_wstream_write_byte(pmhWstream, '\n')) { + + if (!pmhutils_wstream_write_byte(pmhWstream, '\n')) { return FALSE; } diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/sip_common_regmgr.c b/media/webrtc/signaling/src/sipcc/core/sipstack/sip_common_regmgr.c index 08b458d0602d..72c14fb1b28f 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/sip_common_regmgr.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/sip_common_regmgr.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "phntask.h" @@ -277,8 +242,8 @@ sip_regmgr_find_fallback_ccb_by_addr_port (cpr_ip_addr_t *ipaddr, uint16_t port, /** ** sip_regmgr_find_fallback_ccb_by_ccmid - * finds the fallback ccb that matched a ccm id - * + * finds the fallback ccb that matched a ccm id + * * @param ccm_id ccm id to match and ccb_ret - ccb if found * * @return TRUE if found; else FALSE @@ -302,7 +267,7 @@ sip_regmgr_find_fallback_ccb_by_ccmid (CCM_ID ccm_id, ccsipCCB_t **ccb_ret) (cfg_table_entry->ti_specific.ti_ccm.ccm_id == ccm_id)) { if(ccb_ret != NULL){ *ccb_ret = list_ccb; - } + } found_ccb = TRUE; break; } @@ -361,7 +326,7 @@ sip_regmgr_return_fallback_line_num (line_t num) { const char fname[] = "sip_regmgr_return_fallback_line_num"; - if (((num - MAX_CCBS) > -1) && + if (((num - MAX_CCBS) > -1) && ((num - MAX_CCBS) < (MAX_CCM - 1))) { fallback_lines_available[(int)(num - MAX_CCBS)].available = TRUE; CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"Returned fallback line %d at index %d\n", @@ -518,7 +483,7 @@ sip_regmgr_create_fallback_ccb (CCM_ID ccm_id, line_t dn_line) CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"couldn't get fallback line for ccmid %d\n", DEB_F_PREFIX_ARGS(SIP_FALLBACK, fname), ccm_id); return(FALSE); - } + } fallback_ccb = (fallback_ccb_t *) cpr_calloc(1, sizeof(fallback_ccb_t)); if (fallback_ccb) { fallback_ccb->WaitTimer.timer = cprCreateTimer(sipWaitTimerName, @@ -622,7 +587,7 @@ sip_regmgr_trigger_fallback_monitor (void) ccb = fallback_ccb->ccb; if (ccb->state == (int) SIP_REG_PRE_FALLBACK) { char user[MAX_LINE_NAME_SIZE]; - + /* * If state is TokenWait, * Then transition back into InFallback state. @@ -639,13 +604,13 @@ sip_regmgr_trigger_fallback_monitor (void) if (ccm_table_entry->ti_common.handle != INVALID_SOCKET) { (void) sipSPISendRegister(ccb, 0, user, 0); } - + /* * Start the ack, retry timer */ sip_regmgr_retry_timer_start(fallback_ccb); CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"Started monitoring %s:%d\n", - DEB_F_PREFIX_ARGS(SIP_FALLBACK, fname), + DEB_F_PREFIX_ARGS(SIP_FALLBACK, fname), ccb->reg.proxy, ccb->reg.port); } else { CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"fallback is in progress ccb idx=%d", @@ -722,7 +687,7 @@ sip_regmgr_setup_new_active_ccb (ti_config_table_t *cfg_table_entry) &(line_ccb->reg.addr), line_ccb->reg.port); CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"Updated active to %s:%d\n", - DEB_F_PREFIX_ARGS(SIP_FALLBACK, fname), + DEB_F_PREFIX_ARGS(SIP_FALLBACK, fname), line_ccb->reg.proxy, line_ccb->reg.port); } } @@ -779,7 +744,7 @@ sip_regmgr_setup_new_standby_ccb (CCM_ID ccm_index) ccb->dest_sip_port = cfg_table_entry->ti_common.port; ccb->local_port = cfg_table_entry->ti_common.listen_port; CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"For ccb_index=REG_BACKUP_CCB=%d, updated standby to %s:%d\n", - DEB_F_PREFIX_ARGS(SIP_FALLBACK, fname), + DEB_F_PREFIX_ARGS(SIP_FALLBACK, fname), REG_BACKUP_CCB, ccb->reg.proxy, ccb->reg.port); CCM_Active_Standby_Table.standby_ccm_entry = cfg_table_entry; } @@ -834,13 +799,13 @@ sip_regmgr_ccm_get_next (ccsipCCB_t *ccb, CC_POSITION from_cc) connid = sip_tcp_fd_to_connid(ccm_table_ptr->ti_common.handle); CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"clear the socket and port for " - "current active cucm_id=%d connid=%d\n", + "current active cucm_id=%d connid=%d\n", DEB_F_PREFIX_ARGS(SIP_FAILOVER, fname),ccm_id, connid ); sip_tcp_purge_entry(connid); sipTransportSetServerHandleAndPort(INVALID_SOCKET, 0, ccm_table_ptr); } - + // Update CCM status ui_set_ccm_conn_status(ccm_table_ptr->ti_common.addr_str, CCM_STATUS_NONE); @@ -851,7 +816,7 @@ sip_regmgr_ccm_get_next (ccsipCCB_t *ccb, CC_POSITION from_cc) if (from_cc == ACTIVE_CC) { CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"Came here from cucm\n", DEB_F_PREFIX_ARGS(SIP_FAILOVER, fname)); if (CCM_Active_Standby_Table.standby_ccm_entry) { - CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"old ccm_id=%d new_ccm_id=%d Standby=NULL\n", + CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"old ccm_id=%d new_ccm_id=%d Standby=NULL\n", DEB_F_PREFIX_ARGS(SIP_FAILOVER, fname), ccm_id, CCM_Active_Standby_Table.standby_ccm_entry->ti_specific.ti_ccm.ccm_id); ccm_table_ptr = CCM_Active_Standby_Table.standby_ccm_entry; @@ -904,7 +869,7 @@ sip_regmgr_ccm_get_next (ccsipCCB_t *ccb, CC_POSITION from_cc) CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"Could not set transport" "connection to this standby. Ignore this. Continue search \n", DEB_F_PREFIX_ARGS(SIP_FAILOVER, fname) ); - + (void) sip_regmgr_create_fallback_ccb(ccm_index, ccb->dn_line); } else { /* @@ -1024,11 +989,11 @@ sip_regmgr_retry_timer_start (fallback_ccb_t *fallback_ccb) if (!fallback_ccb) { return; } - + ccb = fallback_ccb->ccb; timeout = sip_config_get_keepalive_expires(); - + if (timeout > MAX_FALLBACK_MONITOR_PERIOD) { timeout = MAX_FALLBACK_MONITOR_PERIOD; } @@ -1113,7 +1078,7 @@ sip_regmgr_set_stability_total_msgs (fallback_ccb_t *fallback_ccb) /* Stability count is used to wait to make sure that wan is not flapping */ fallback_ccb->StabilityMsgCount = connection_mode_duration / timer_keepalive_expires; CCSIP_DEBUG_REG_STATE(DEB_L_C_F_PREFIX"Starting stability msg count as %d\n", - DEB_L_C_F_PREFIX_ARGS(SIP_FALLBACK, ccb->index, ccb->dn_line, fname), + DEB_L_C_F_PREFIX_ARGS(SIP_FALLBACK, ccb->index, ccb->dn_line, fname), fallback_ccb->StabilityMsgCount); } @@ -1196,7 +1161,7 @@ sip_regmgr_fallback_generic_timer_stop (cprTimer_t timer) return; } - + /* ** sip_regmgr_ev_fallback_retry * @@ -1235,7 +1200,7 @@ sip_regmgr_ev_default (ccsipCCB_t *ccb, sipSMEvent_t *event) CCSIP_DEBUG_REG_STATE(DEB_L_C_F_PREFIX"Received a default event in state %d\n", DEB_L_C_F_PREFIX_ARGS(SIP_EVT, ccb->index, ccb->dn_line, fname), ccb->state); - + sip_reg_sm_change_state(ccb, SIP_REG_STATE_IN_FALLBACK); sip_regmgr_ev_tmr_ack_retry(ccb, event); /* only free SIP messages, timeouts are internal */ @@ -1299,7 +1264,7 @@ sip_regmgr_ev_tmr_ack_retry (ccsipCCB_t *ccb, sipSMEvent_t *event) ccm_table_ptr = NULL; ccm_table_ptr = sip_regmgr_ccm_get_next(ccb, ACTIVE_CC); - + if (ccm_table_ptr == NULL) { /* * Send indication of REG_ALLFAIL so platform can @@ -1312,10 +1277,10 @@ sip_regmgr_ev_tmr_ack_retry (ccsipCCB_t *ccb, sipSMEvent_t *event) sip_regmgr_handle_reg_all_fail(); break; } - - CCSIP_DEBUG_REG_STATE("%s: ccb information: ccb->dn_line=%d, ccb->index=%d, retry_times=%d\n", - fname, ccb->dn_line, ccb->index, retry_times); - + + CCSIP_DEBUG_REG_STATE("%s: ccb information: ccb->dn_line=%d, ccb->index=%d, retry_times=%d\n", + fname, ccb->dn_line, ccb->index, retry_times); + CCM_Failover_Table.failover_ccm_entry = ccm_table_ptr; CCM_Failover_Table.failover_started = TRUE; CCM_Failover_Table.prime_registered = FALSE; @@ -1331,12 +1296,12 @@ sip_regmgr_ev_tmr_ack_retry (ccsipCCB_t *ccb, sipSMEvent_t *event) * Active CCB failover * previous standby CCM is set as CCM_Active_Standby_Table.active_ccm_entry (#1 IPAddr A) * Third CCM would be set as CCM_Active_Standby_Table.standby_ccm_entry (#2 IPAddr B) - * - * if (#2) failover before Jphone callback, + * + * if (#2) failover before Jphone callback, * The REG_BACKUP_CCB would still store the #1's info * So the call flows would prompt the wrong info(#1 IPAddr A) to Jphone, in this case, (#2 IPAddr B) * should be prompted - * + * * We need to update the REG_BACKUP_CCB's info here */ if (CCM_Active_Standby_Table.standby_ccm_entry) @@ -1449,7 +1414,7 @@ sip_regmgr_ev_tmr_ack_retry (ccsipCCB_t *ccb, sipSMEvent_t *event) * Clean the current fallback ccb and free it */ DEF_DEBUG(DEB_F_PREFIX"Freeing the fallback ccb for %d ccm as current standby" - " is %d ccm!\n", + " is %d ccm!\n", DEB_F_PREFIX_ARGS(SIP_REG_FREE_FALLBACK, fname), fallback_ccm_id, current_standby_ccm_id); sip_regmgr_free_fallback_ccb(ccb); @@ -1487,7 +1452,7 @@ sip_regmgr_ev_tmr_ack_retry (ccsipCCB_t *ccb, sipSMEvent_t *event) sip_msg.context = NULL; if (fallback_ccb2 && (fallback_ccb2->tls_socket_waiting)) { /* socket invalid after TLS_CONN_TIME - * Restart timer for the remaining time + * Restart timer for the remaining time */ sip_regmgr_tls_retry_timer_start(fallback_ccb2); break; @@ -1499,7 +1464,7 @@ sip_regmgr_ev_tmr_ack_retry (ccsipCCB_t *ccb, sipSMEvent_t *event) } else { server_conn_handle = sip_tcp_create_connection(&sip_msg); } - phone_local_tcp_port[ccm_table_entry->ti_specific.ti_ccm.ccm_id] = + phone_local_tcp_port[ccm_table_entry->ti_specific.ti_ccm.ccm_id] = sip_msg.createConnMsg.local_listener_port; if (server_conn_handle != INVALID_SOCKET) { listener_port = sip_msg.createConnMsg.local_listener_port; @@ -1759,7 +1724,7 @@ sip_regmgr_ev_cleanup (ccsipCCB_t *ccb, sipSMEvent_t *event) CCSIP_DEBUG_REG_STATE("%s: invalid ccb or line_ccb\n", fname); return; } - + cfg_table_entry = (ti_config_table_t *) line_ccb->cc_cfg_table_entry; /* * Setup the new active cc @@ -1800,7 +1765,7 @@ sip_regmgr_ev_cleanup (ccsipCCB_t *ccb, sipSMEvent_t *event) if (ti_common->conn_type != CONN_UDP) { if (ti_common->handle != INVALID_SOCKET) { int connid; - + CCSIP_DEBUG_REG_STATE("%s: Close the TCP connection\n", fname); connid = sip_tcp_fd_to_connid(ti_common->handle); sip_tcp_purge_entry(connid); @@ -2171,7 +2136,7 @@ sip_regmgr_ev_failure_response (ccsipCCB_t *ccb, sipSMEvent_t *event) const char *fname = "sip_regmgr_ev_failure_response"; int timeout; - CCSIP_DEBUG_REG_STATE(DEB_L_C_F_PREFIX"Received event\n", + CCSIP_DEBUG_REG_STATE(DEB_L_C_F_PREFIX"Received event\n", DEB_L_C_F_PREFIX_ARGS(SIP_EVT, ccb->index, ccb->dn_line, fname)); if (ccb->index == REG_BACKUP_CCB) { /* @@ -2191,7 +2156,7 @@ sip_regmgr_ev_failure_response (ccsipCCB_t *ccb, sipSMEvent_t *event) if (sip_regmgr_get_cc_mode(1) == REG_MODE_CCM) { config_update_required = TRUE; } - + /* * Send indication of REG_ALLFAIL so platform can * initiate a reboot. @@ -2201,7 +2166,7 @@ sip_regmgr_ev_failure_response (ccsipCCB_t *ccb, sipSMEvent_t *event) sip_regmgr_free_fallback_ccb_list(); sip_reg_all_failed = TRUE; sip_regmgr_handle_reg_all_fail(); - + } } @@ -2315,7 +2280,7 @@ sip_regmgr_setup_cc_conns () */ for (cc_index = PRIMARY_CCM; cc_index < MAX_CCM; cc_index++) { line = 1; - + /* * Note: The opening of sockets will fail only in the * case of tcp/tls connections. In the case of udp, @@ -2459,7 +2424,7 @@ sip_regmgr_destroy_cc_conns (void) } for (dn = 1; dn <= max_iteration; dn++) { - /* + /* * Not checking if it is the active ccm connection that is getting torn down. * Here we are killing everything so does'nt matter. * Something else has triggered the closing of the tcp conns. @@ -2801,7 +2766,7 @@ sip_regmgr_rsp (int rsp_id, int rsp_type, boolean waited) CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"rsp id=%s rsp type=%s waited=%d\n", DEB_F_PREFIX_ARGS(SIP_RESP, "sip_regmgr_rsp"), - rsp_id == FAILOVER_RSP ? "FAILOVER_RSP" : "FALLBACK_RSP", + rsp_id == FAILOVER_RSP ? "FAILOVER_RSP" : "FALLBACK_RSP", rsp_type == RSP_START ? "RSP_START" : "RSP_COMPLETE", waited); if (rsp_type == RSP_START) { @@ -2818,7 +2783,7 @@ sip_regmgr_rsp (int rsp_id, int rsp_type, boolean waited) * primary CCM. */ (void) sip_subsManager_rollover(); - publish_reset(); + publish_reset(); } } else if (rsp_type == RSP_COMPLETE) { @@ -2840,7 +2805,7 @@ sip_regmgr_rsp (int rsp_id, int rsp_type, boolean waited) * the address in string format. * * @return none - * + * * @pre (addr_str != NULL) (1< ccm_id < 4) * */ @@ -2852,7 +2817,7 @@ void sip_regmgr_get_config_addr (int ccm_id, char *addr_str) { - config_get_value(CFGID_IP_ADDR_MODE, + config_get_value(CFGID_IP_ADDR_MODE, &ip_mode, sizeof(ip_mode)); if (ip_mode == CPR_IP_MODE_IPV4) { #endif @@ -2899,7 +2864,7 @@ sip_regmgr_check_config_change (void) #ifdef IPV6_STACK_ENABLED int ip_mode = CPR_IP_MODE_IPV4; - config_get_value(CFGID_IP_ADDR_MODE, + config_get_value(CFGID_IP_ADDR_MODE, &ip_mode, sizeof(ip_mode)); #endif @@ -2949,7 +2914,7 @@ void sip_regmgr_process_config_change (void) { - CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"!!!Process_config_change\n", + CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"!!!Process_config_change\n", DEB_F_PREFIX_ARGS(SIP_CONFIG, "sip_regmgr_process_config_change")); /* Register manager configuration changes need to restart sip task */ @@ -3118,7 +3083,7 @@ sip_regmgr_ccm_restarted (ccsipCCB_t *new_reg_ccb) ccb->reg.registered = 0; /* Restart the register timer */ - (void) sip_platform_register_expires_timer_start(ccb->reg.tmr_expire * + (void) sip_platform_register_expires_timer_start(ccb->reg.tmr_expire * 1000, ccb->index); /* Update UI to indicates that this line is not register */ @@ -3178,7 +3143,7 @@ sip_regmgr_notify_timer_callback (void *data) sstrncpy(scp->dialplanVersionStamp, versionStamp, versionStampLen + 1); sstrncpy(scp->softkeyVersionStamp, versionStamp, versionStampLen + 1); sip_platform_handle_service_control_notify(scp); - CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"Fake NOTIFY TO Platform\n", + CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"Fake NOTIFY TO Platform\n", DEB_F_PREFIX_ARGS(SIP_FALLBACK, fname)); } sippmh_free_service_control_info(scp); @@ -3261,7 +3226,7 @@ void sip_regmgr_regallfail_timer_callback (void *data) { const char *fname = "sip_regmgr_regallfail_timer_callback"; - CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"Registration Failed. Restarting the System now!\n", + CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"Registration Failed. Restarting the System now!\n", DEB_F_PREFIX_ARGS(SIP_REG, fname)); sip_regmgr_send_status(REG_SRC_SIP, REG_ALL_FAIL); } @@ -3334,7 +3299,7 @@ sip_regmgr_handle_reg_all_fail (void) } else { /* Send the Indication to the platform immediately */ sip_regmgr_send_status(REG_SRC_SIP, REG_ALL_FAIL); - } + } } /* @@ -3356,7 +3321,7 @@ void notify_register_update(int last_line_available) if (ccsip_register_send_msg(SIP_REG_UPDATE, (line_t)last_line_available) != SIP_REG_OK) { CCSIP_DEBUG_ERROR("%s : Unable to send register update message\n", fname); } else { - CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"last_available_line: %d\n", + CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"last_available_line: %d\n", DEB_F_PREFIX_ARGS(SIP_REG, fname), last_line_available); } } @@ -3397,7 +3362,7 @@ void update_ui_line_reg_state(int start_line, int end_line, boolean registered) * * PARAMETERS: last_available_line - last available line button on the phone * - * DESCRIPTION: This function is used to handle any registration updates needed + * DESCRIPTION: This function is used to handle any registration updates needed * when a sidecar is plugged in or unplugged * * RETURNS: None @@ -3412,7 +3377,7 @@ void regmgr_handle_register_update(line_t last_available_line) int last_line_button_present; //boolean reg_update_needed = TRUE; - CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"last_available_line: %d\n", + CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"last_available_line: %d\n", DEB_F_PREFIX_ARGS(SIP_REG, fname), last_available_line); if (last_available_line == 1) { @@ -3431,7 +3396,7 @@ void regmgr_handle_register_update(line_t last_available_line) if (line_ccb) { if (sip_config_check_line(line_ccb->dn_line)) { CCSIP_DEBUG_REG_STATE(DEB_L_C_F_PREFIX"%d: 0x%x\n", - DEB_L_C_F_PREFIX_ARGS(SIP_CONFIG, line_ccb->index, line_ccb->dn_line, fname), + DEB_L_C_F_PREFIX_ARGS(SIP_CONFIG, line_ccb->index, line_ccb->dn_line, fname), line_index, line_ccb); } } @@ -3449,7 +3414,7 @@ void regmgr_handle_register_update(line_t last_available_line) if (line_ccb) { if (sip_config_check_line(line_ccb->dn_line)) { CCSIP_DEBUG_REG_STATE(DEB_L_C_F_PREFIX"%d: 0x%x\n", - DEB_L_C_F_PREFIX_ARGS(SIP_CONFIG, line_ccb->index, line_ccb->dn_line, fname), + DEB_L_C_F_PREFIX_ARGS(SIP_CONFIG, line_ccb->index, line_ccb->dn_line, fname), line_index, line_ccb); ui_set_sip_registration_state(line_ccb->dn_line, FALSE); @@ -3493,7 +3458,7 @@ void regmgr_handle_register_update(line_t last_available_line) } } - + } diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/sip_common_transport.c b/media/webrtc/signaling/src/sipcc/core/sipstack/sip_common_transport.c index 6f1737aac65f..86b5e690da24 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/sip_common_transport.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/sip_common_transport.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_in.h" #include "cpr_stdlib.h" @@ -134,7 +99,7 @@ extern void platform_get_ipv4_address(cpr_ip_addr_t *ip_addr); #define SIP_IPPROTO_UDP 17 #define SIP_IPPROTO_TCP 6 - + /* * Function: ccsip_add_wlan_classifiers() * @@ -152,12 +117,12 @@ void ccsip_add_wlan_classifiers () uint32_t transport_prot = 0; platform_get_ipv4_address (&my_addr); - + config_get_value(CFGID_VOIP_CONTROL_PORT, &local_port, sizeof(local_port)); config_get_value(CFGID_TRANSPORT_LAYER_PROT, &transport_prot, sizeof(transport_prot)); - + platAddCallControlClassifiers(my_addr.u.ip4, local_port , ntohl(CCM_Device_Specific_Config_Table[PRIMARY_CCM].ti_common.addr.u.ip4), CCM_Device_Specific_Config_Table[PRIMARY_CCM].ti_common.port, @@ -446,7 +411,7 @@ sip_transport_setup_cc_conn (line_t dn, CCM_ID ccm_id) #ifdef IPV6_STACK_ENABLED - config_get_value(CFGID_IP_ADDR_MODE, + config_get_value(CFGID_IP_ADDR_MODE, &ip_mode, sizeof(ip_mode)); #endif @@ -472,14 +437,14 @@ sip_transport_setup_cc_conn (line_t dn, CCM_ID ccm_id) if (dnsErrorCode != DNS_OK) { CCSIP_DEBUG_ERROR(get_debug_string(DEBUG_GENERAL_FUNCTIONCALL_FAILED), "sip_transport_setup_cc_conn", - "dnsGetHostByName() returned error:%s", + "dnsGetHostByName() returned error:%s", CCM_Config_Table[dn - 1][ccm_id]->ti_common.addr_str); return status; } util_ntohl(&server_ipaddr, &server_ipaddr); - + config_get_value(CFGID_VOIP_CONTROL_PORT, &s_port, sizeof(s_port)); server_port = (uint16_t) s_port; @@ -570,7 +535,7 @@ sip_transport_setup_cc_conn (line_t dn, CCM_ID ccm_id) server_port, listener_port, server_conn_handle); status = CONN_SUCCESS; - phone_local_tcp_port[CCM_Config_Table[dn-1][ccm_id]->ti_specific.ti_ccm.ccm_id] = + phone_local_tcp_port[CCM_Config_Table[dn-1][ccm_id]->ti_specific.ti_ccm.ccm_id] = sip_msg.createConnMsg.local_listener_port; } else { CCSIP_DEBUG_ERROR(SIP_F_PREFIX"DN <%d>:" @@ -795,7 +760,7 @@ sipTransportCreateSendMessage (ccsipCCB_t *ccb, if (ccb) { CCSIP_DEBUG_ERROR("SIPCC-ENTRY: LINE %d/%d: %-35s: message not " "sent of type %s=%d. sipTransportSendMessage() failed.\n", - ccb->index, ccb->dn_line, fname, + ccb->index, ccb->dn_line, fname, message_type == sipMethodRegister ? "sipMethodRegister" : "", sipMethodRegister); } else { CCSIP_DEBUG_ERROR(get_debug_string(DEBUG_GENERAL_FUNCTIONCALL_FAILED), @@ -857,7 +822,7 @@ sipTransportSendMessage (ccsipCCB_t *ccb, } #ifdef IPV6_STACK_ENABLED - config_get_value(CFGID_IP_ADDR_MODE, + config_get_value(CFGID_IP_ADDR_MODE, &ip_mode, sizeof(ip_mode)); #endif conn_type = sipTransportGetTransportType(1, TRUE, ccb); @@ -985,7 +950,7 @@ sipTransportSendMessage (ccsipCCB_t *ccb, * we are using the default proxy, we are not using the Emergency * route, and it is not the backup proxy registration. */ - if (util_check_if_ip_valid(&(ccb->outBoundProxyAddr)) && + if (util_check_if_ip_valid(&(ccb->outBoundProxyAddr)) && (ccb->proxySelection == SIP_PROXY_DEFAULT) && (ccb->routeMode != RouteEmergency) && (ccb->index != REG_BACKUP_CCB)) { send_to_proxy_handle = INVALID_SOCKET; @@ -1138,7 +1103,7 @@ sipTransportSendMessage (ccsipCCB_t *ccb, * for TCP. In that case, that message has to be retransmitted from the SIP * layer. So if the error_no == CPR_ENOTCONN, then send the SIP message * during next retry. - * + * */ if ((timeout > 0) && ((!cpr_strcasecmp(conn_type, "UDP") || ((tcp_error == CPR_ENOTCONN) && (!cpr_strcasecmp(conn_type, "TCP")))))) { @@ -1191,7 +1156,7 @@ sipTransportSendMessage (ccsipCCB_t *ccb, CCSIP_DEBUG_STATE(DEB_F_PREFIX"%s failed\n", DEB_F_PREFIX_ARGS(SIP_TRANS, fname), "cprStartTimer"); } } - + if (timeout > 0 && timer != NULL) { CCSIP_DEBUG_STATE(DEB_F_PREFIX"Starting reTx timer for %d secs", DEB_F_PREFIX_ARGS(SIP_TRANS, fname), timeout); @@ -2167,7 +2132,7 @@ sipTransportClearServerHandle (cpr_ip_addr_t *ipaddr, uint16_t port, int connid) ti_common_t *ti_common; CCM_ID cc_index; - CCSIP_DEBUG_TASK(DEB_F_PREFIX"addr 0x%x port %d connid %d\n", + CCSIP_DEBUG_TASK(DEB_F_PREFIX"addr 0x%x port %d connid %d\n", DEB_F_PREFIX_ARGS(SIP_TRANS, "sipTransportClearServerHandle"), ipaddr, port, connid); for (cc_index = PRIMARY_CCM; cc_index < MAX_CCM; cc_index++) { ti_common = &CCM_Device_Specific_Config_Table[cc_index].ti_common; diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/sip_csps_transport.c b/media/webrtc/signaling/src/sipcc/core/sipstack/sip_csps_transport.c index 77d68b580742..9982ab3cb819 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/sip_csps_transport.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/sip_csps_transport.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_in.h" #include "cpr_types.h" diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/sip_interface_regmgr.c b/media/webrtc/signaling/src/sipcc/core/sipstack/sip_interface_regmgr.c index 18806fc159a7..952cc806d667 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/sip_interface_regmgr.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/sip_interface_regmgr.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdio.h" @@ -163,7 +128,7 @@ sip_platform_failover_ind (CCM_ID ccm_id) static const char fname[] = "sip_platform_failover_ind"; int to_id = CC_TYPE_CCM; - CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"ccm-id=%s=%d", DEB_F_PREFIX_ARGS(SIP_FAILOVER, fname), + CCSIP_DEBUG_REG_STATE(DEB_F_PREFIX"ccm-id=%s=%d", DEB_F_PREFIX_ARGS(SIP_FAILOVER, fname), ccm_id == PRIMARY_CCM ? "PRIMARY_CCM" : ccm_id == SECONDARY_CCM ? "SECONDARY_CCM" : ccm_id == TERTIARY_CCM ? "TERTIARY_CCM" : "Unknown", @@ -198,7 +163,7 @@ sip_platform_logout_reset_req(void) { platform_logout_reset_req(); } - + /* ** sip_platform_set_ccm_status * diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/sip_platform_task.c b/media/webrtc/signaling/src/sipcc/core/sipstack/sip_platform_task.c index f85e14243880..853ae3de2b21 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/sip_platform_task.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/sip_platform_task.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_ipc.h" @@ -98,12 +63,12 @@ uint32_t nfds = 0; sip_connection_t sip_conn; /* - * Internal message structure between main thread and + * Internal message structure between main thread and * message queue waiting thread. */ typedef struct sip_int_msg_t_ { void *msg; - phn_syshdr_t *syshdr; + phn_syshdr_t *syshdr; } sip_int_msg_t; /* Internal message queue (array) */ @@ -112,7 +77,7 @@ static sip_int_msg_t sip_int_msgq_buf[MAX_SIP_MESSAGES] = {{0,0},{0,0}}; /* Main thread and message queue waiting thread IPC names */ static const char *sip_IPC_serv_name = SIP_MSG_IPC_PATH SIP_MSG_SERV_NAME; static const char *sip_IPC_clnt_name = SIP_MSG_IPC_PATH SIP_MSG_CLNT_NAME; -static cpr_sockaddr_un_t sip_serv_sock_addr; +static cpr_sockaddr_un_t sip_serv_sock_addr; static cpr_sockaddr_un_t sip_clnt_sock_addr; @@ -199,7 +164,7 @@ static cpr_socket_t sip_create_IPC_sock (const char *name) /* make sure file doesn't already exist */ unlink( (char *)addr.sun_path); - + /* do the bind */ if (cprBind(sock, (cpr_sockaddr_t *)&addr, cpr_sun_len(addr)) == CPR_FAILURE) { @@ -232,8 +197,8 @@ static cpr_socket_t sip_create_IPC_sock (const char *name) * @param[in] arg - pointer to SIP main thread's message queue. * * @return None. - * - * @pre (arg != NULL) + * + * @pre (arg != NULL) */ void sip_platform_task_msgqwait (void *arg) { @@ -281,10 +246,10 @@ void sip_platform_task_msgqwait (void *arg) /* Use default priority */ (void) cprAdjustRelativeThreadPriority(0); #endif - + /* * The main thread is ready. set global client socket address - * so that the server can send back response. + * so that the server can send back response. */ cpr_set_sockun_addr(&sip_clnt_sock_addr, sip_IPC_clnt_name, getpid()); @@ -340,7 +305,7 @@ void sip_platform_task_msgqwait (void *arg) */ if (cprSendTo(sip_ipc_clnt_socket, (void *)&num_messages, sizeof(num_messages), 0, - (cpr_sockaddr_t *)&sip_serv_sock_addr, + (cpr_sockaddr_t *)&sip_serv_sock_addr, cpr_sun_len(sip_serv_sock_addr)) < 0) { CCSIP_DEBUG_ERROR(SIP_F_PREFIX"send IPC failed errno=%d\n", fname, cpr_errno); } @@ -379,7 +344,7 @@ static void sip_process_int_msg (void) phn_syshdr_t *syshdr; /* read the msg count from the IPC socket */ - rcv_len = cprRecvFrom(sip_ipc_serv_socket, &num_messages, + rcv_len = cprRecvFrom(sip_ipc_serv_socket, &num_messages, sizeof(num_messages), 0, NULL, NULL); if (rcv_len < 0) { @@ -387,7 +352,7 @@ static void sip_process_int_msg (void) " errno=%d\n", fname, cpr_errno); return; } - + if (num_messages == 0) { CCSIP_DEBUG_ERROR(SIP_F_PREFIX"message queue is empty!\n", fname); return; @@ -479,7 +444,7 @@ sip_platform_task_loop (void *arg) /* * Setup IPC socket addresses for main thread (server) - */ + */ cpr_set_sockun_addr(&sip_serv_sock_addr, sip_IPC_serv_name, getpid()); /* @@ -508,7 +473,7 @@ sip_platform_task_loop (void *arg) sip_platform_task_set_read_socket(sip_ipc_serv_socket); /* - * Let the message queue waiting thread know that the main + * Let the message queue waiting thread know that the main * thread is ready. */ main_thread_ready = TRUE; @@ -531,7 +496,7 @@ sip_platform_task_loop (void *arg) FD_SET(entry->fd, &sip_write_fds); } } - + pending_operations = cprSelect((nfds + 1), &sip_read_fds, &sip_write_fds, @@ -540,23 +505,23 @@ sip_platform_task_loop (void *arg) CCSIP_DEBUG_ERROR(SIP_F_PREFIX"cprSelect() failed: errno=%d." " Recover by initiating sip restart\n", fname, cpr_errno); - /* - * If we have come here, then either read socket related to - * sip_ipc_serv_socket has got corrupted, or one of the write + /* + * If we have come here, then either read socket related to + * sip_ipc_serv_socket has got corrupted, or one of the write * socket related to cucm tcp/tls connection. * We will recover, by first clearing all fds, then re-establishing - * the connection with sip-msgq by listening on + * the connection with sip-msgq by listening on * sip_ipc_serv_socket. */ sip_platform_task_init(); /* this clear FDs */ - sip_platform_task_set_read_socket(sip_ipc_serv_socket); - - /* + sip_platform_task_set_read_socket(sip_ipc_serv_socket); + + /* * Since all sockets fds have been cleared above, we can not anyway * send or receive msg from cucm. So, there is no point * trying to send registration cancel msg to cucm. Also, a * call may be active, and in that case we do not want to - * un-register. So, by setting sip_reg_all_failed to true, we + * un-register. So, by setting sip_reg_all_failed to true, we * make sure that no registration cancelation attempt is made. */ sip_reg_all_failed = TRUE; diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/sip_platform_win32_task.c b/media/webrtc/signaling/src/sipcc/core/sipstack/sip_platform_win32_task.c index a74a5e5ea678..c9760b18935c 100755 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/sip_platform_win32_task.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/sip_platform_win32_task.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_ipc.h" @@ -288,7 +253,7 @@ sip_platform_task_loop (void *arg) * queue. Shorten the socket select time out to come back and * check the message queue for the message that might be left on * the queue. - */ + */ if (i >= MAX_SIP_MESSAGES) { timeout.tv_usec = SIP_SELECT_QUICK_TIMEOUT; } else { diff --git a/media/webrtc/signaling/src/sipcc/core/src-common/configapp.c b/media/webrtc/signaling/src/sipcc/core/src-common/configapp.c index 4f1b3e1583d8..849a55fe7224 100644 --- a/media/webrtc/signaling/src/sipcc/core/src-common/configapp.c +++ b/media/webrtc/signaling/src/sipcc/core/src-common/configapp.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdlib.h" @@ -65,7 +30,7 @@ configapp_init (void) { static const char fname[] = "configapp_init"; - CONFIGAPP_DEBUG(DEB_F_PREFIX"Subscribing to SUB/NOT manager.\n", + CONFIGAPP_DEBUG(DEB_F_PREFIX"Subscribing to SUB/NOT manager.\n", DEB_F_PREFIX_ARGS(CONFIG_APP, fname)); (void) sub_int_subnot_register(CC_SRC_MISC_APP, CC_SRC_SIP, @@ -101,7 +66,7 @@ configapp_shutdown (void) * * Returns: None */ -void +void configapp_free_event_data (ccsip_event_data_t *data) { ccsip_event_data_t *next_data; @@ -120,9 +85,9 @@ configapp_free_event_data (ccsip_event_data_t *data) * Parameters: ccsip_sub_not_data_t* * * Description: Processes the kpml config update request. Invokes the - * jni update_kpmlconfig() so the java side can + * jni update_kpmlconfig() so the java side can * trigger the config - * change and also to initialize the dialplan. + * change and also to initialize the dialplan. * * Returns: None */ @@ -136,11 +101,11 @@ configapp_process_request (ccsip_sub_not_data_t *msg) configdata = &(msg->u.subs_ind_data.eventData->u.configapp_data); update_kpmlconfig(configdata->sip_profile.kpml_val); - CONFIGAPP_DEBUG(DEB_F_PREFIX"Updated kpml config value to %d.\n", - DEB_F_PREFIX_ARGS(CONFIG_APP, fname), + CONFIGAPP_DEBUG(DEB_F_PREFIX"Updated kpml config value to %d.\n", + DEB_F_PREFIX_ARGS(CONFIG_APP, fname), configdata->sip_profile.kpml_val); - - (void)sub_int_subscribe_ack(CC_SRC_MISC_APP, CC_SRC_SIP, msg->sub_id, + + (void)sub_int_subscribe_ack(CC_SRC_MISC_APP, CC_SRC_SIP, msg->sub_id, (uint16_t)SIP_SUCCESS_SETUP, 0); (void)sub_int_subscribe_term(msg->sub_id, TRUE, 0, CC_SUBSCRIPTIONS_CONFIGAPP); diff --git a/media/webrtc/signaling/src/sipcc/core/src-common/dialplan.c b/media/webrtc/signaling/src/sipcc/core/src-common/dialplan.c index ce3e18931312..36b1cd366c5c 100755 --- a/media/webrtc/signaling/src/sipcc/core/src-common/dialplan.c +++ b/media/webrtc/signaling/src/sipcc/core/src-common/dialplan.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include @@ -936,7 +901,7 @@ ParseDialEntry (char **parseptr) case STATE_GOT_TONE: state = STATE_GOT_TONE_EQ; break; - + default: return 1; } @@ -1108,7 +1073,7 @@ ParseDialVersion (char **parseptr) } state = STATE_END_TAG_FOUND; break; - + default: break; } @@ -1123,9 +1088,9 @@ ParseDialVersion (char **parseptr) if (len <= 2) { CCAPP_ERROR("ParseDialVersion(): Version length [%d] is way too small", len); - return (1); + return (1); } - + memset(g_dp_version_stamp, 0, MAX_DP_VERSION_STAMP_LEN); if ((version_stamp[0] == '{') && (version_stamp[len - 1] == '}')) { diff --git a/media/webrtc/signaling/src/sipcc/core/src-common/dialplanint.c b/media/webrtc/signaling/src/sipcc/core/src-common/dialplanint.c index 0da353536873..720fab627b83 100755 --- a/media/webrtc/signaling/src/sipcc/core/src-common/dialplanint.c +++ b/media/webrtc/signaling/src/sipcc/core/src-common/dialplanint.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_memory.h" @@ -147,13 +112,13 @@ dp_int_store_digit_string (line_t line, callid_t call_id, char* digit_str) void dp_int_update_keypress (line_t line, callid_t call_id, unsigned char digit) { - dp_int_message(line, call_id, digit, NULL, FALSE, + dp_int_message(line, call_id, digit, NULL, FALSE, NULL, DP_MSG_DIGIT, NULL, CC_MONITOR_NONE); } void dp_int_dial_immediate (line_t line, callid_t call_id, boolean collect_more, - char *digit_str, char *g_call_id, + char *digit_str, char *g_call_id, monitor_mode_t monitor_mode) { dp_int_message(line, call_id, 0, digit_str, collect_more, NULL, @@ -163,21 +128,21 @@ dp_int_dial_immediate (line_t line, callid_t call_id, boolean collect_more, void dp_int_do_redial (line_t line, callid_t call_id) { - dp_int_message(line, call_id, 0, NULL, FALSE, + dp_int_message(line, call_id, 0, NULL, FALSE, NULL, DP_MSG_REDIAL, NULL, CC_MONITOR_NONE); } void dp_int_onhook (line_t line, callid_t call_id) { - dp_int_message(line, call_id, 0, NULL, FALSE, + dp_int_message(line, call_id, 0, NULL, FALSE, NULL, DP_MSG_ONHOOK, NULL, CC_MONITOR_NONE); } void dp_int_offhook (line_t line, callid_t call_id) { - dp_int_message(line, call_id, 0, NULL, FALSE, + dp_int_message(line, call_id, 0, NULL, FALSE, NULL, DP_MSG_OFFHOOK, NULL, CC_MONITOR_NONE); } @@ -191,7 +156,7 @@ dp_int_update (line_t line, callid_t call_id, string_t called_num) void dp_int_cancel_offhook_timer (line_t line, callid_t call_id) { - dp_int_message(line, call_id, 0, NULL, FALSE, + dp_int_message(line, call_id, 0, NULL, FALSE, NULL, DP_MSG_CANCEL_OFFHOOK_TIMER, NULL, CC_MONITOR_NONE); } @@ -232,7 +197,7 @@ dp_store_digits (line_t line, callid_t call_id, unsigned char digit) { // safety check to prevent going out of bounds CCAPP_ERROR(DEB_F_PREFIX"Unexpected dialstring [%s] (length [%d] > max [%d]) received", DEB_F_PREFIX_ARGS(DIALPLAN, fname), g_dp_int.gDialed, len, MAX_DIALSTRING); - return; + return; } g_dp_int.gDialed[len] = digit; @@ -713,7 +678,7 @@ dp_get_gdialed_digits (void) DPINT_DEBUG(DEB_F_PREFIX"Dialed digits:%s\n", DEB_F_PREFIX_ARGS(DIALPLAN, fname), g_dp_int.gDialed); - /* Digits are copied to Redial buffer after 180 is received + /* Digits are copied to Redial buffer after 180 is received * after dp_update (). Afterthat gDialed buffer is cleared. So the dialed * value is moved into gRedialed buffer */ @@ -776,11 +741,11 @@ dp_do_redial (line_t line, callid_t call_id) g_dp_int.call_id = call_id; g_dp_int.allow_proceed = TRUE; - + /* * If we are doing redial, then we won't be entering any more digits */ - g_dp_int.gDialplanDone = TRUE; + g_dp_int.gDialplanDone = TRUE; (void) cprCancelTimer(g_dp_int.dial_timer); @@ -986,9 +951,9 @@ boolean dp_offhook (line_t line, callid_t call_id) DPINT_DEBUG(DEB_F_PREFIX"line=%d call_id=%d\n", DEB_F_PREFIX_ARGS(DIALPLAN, fname), line, call_id); - /* + /* * If this line and call_id is same that means - * dialing has been initialized already. In addition, if + * dialing has been initialized already. In addition, if * gDialplanDone is true, there won't be any further digit entry * so don't start the dial timer. * Example case where remote-cc or speedial initates the call @@ -997,7 +962,7 @@ boolean dp_offhook (line_t line, callid_t call_id) * timer or process anything else in these cases. */ if ((g_dp_int.line == line) && (g_dp_int.call_id == call_id)) { - + if (g_dp_int.gDialplanDone == FALSE) { dp_restart_dial_timer(line, call_id, g_dp_int.offhook_timeout); g_dp_int.gTimerType = DP_OFFHOOK_TIMER; @@ -1039,7 +1004,7 @@ boolean dp_offhook (line_t line, callid_t call_id) */ static void dp_dial_immediate (line_t line, callid_t call_id, boolean collect_more, - char *digit_str, char *global_call_id, + char *digit_str, char *global_call_id, monitor_mode_t monitor_mode) { const char fname[] = "dp_dial_immediate"; @@ -1063,7 +1028,7 @@ dp_dial_immediate (line_t line, callid_t call_id, boolean collect_more, if (g_dp_int.gDialplanDone) { - // if used with CCM, we should allow user to continue to input more digits + // if used with CCM, we should allow user to continue to input more digits // after they've entered partial destination number onhook then press dial if (sip_regmgr_get_cc_mode(line) == REG_MODE_CCM) { return; @@ -1082,7 +1047,7 @@ dp_dial_immediate (line_t line, callid_t call_id, boolean collect_more, if (digit_str[0] == 0 && global_call_id[0] != 0) { - cc_offhook_ext(CC_SRC_GSM, call_id, line, + cc_offhook_ext(CC_SRC_GSM, call_id, line, global_call_id, monitor_mode); return; } @@ -1144,7 +1109,7 @@ dp_update (line_t line, callid_t call_id, string_t called_num) */ if (g_dp_int.gDialed[0] && - (strcmp(g_dp_int.gDialed, CISCO_PLAR_STRING) != 0) && + (strcmp(g_dp_int.gDialed, CISCO_PLAR_STRING) != 0) && (strncmp(g_dp_int.gDialed, CISCO_BLFPICKUP_STRING, (sizeof(CISCO_BLFPICKUP_STRING) - 1)) != 0)) { sstrncpy(g_dp_int.gReDialed, g_dp_int.gDialed, MAX_DIALSTRING); @@ -1156,7 +1121,7 @@ dp_update (line_t line, callid_t call_id, string_t called_num) dp_clear_dialing_data(line, call_id); /* Clear kpml data and collected digits */ kpml_flush_quarantine_buffer(line, call_id); - } + } } @@ -1213,7 +1178,7 @@ void dp_shutdown (void) { if (g_dp_int.dial_timer != NULL) { - (void)cprDestroyTimer(g_dp_int.dial_timer); + (void)cprDestroyTimer(g_dp_int.dial_timer); g_dp_int.dial_timer = NULL; } FreeDialTemplates(); @@ -1238,10 +1203,10 @@ int dp_init_template(const char * dial_plan_string, int length) { /* Clear existing dialplan templates before building a new one */ FreeDialTemplates(); memset(dpLoadArea, 0, sizeof(dpLoadArea)); - + //Copy over data memcpy (dpLoadArea, dial_plan_string, length); - + if (length == 0 || ParseDialTemplate(TemplateData) == FALSE) { if (kpml_get_state()) { @@ -1353,7 +1318,7 @@ dp_process_msg (uint32_t cmd, void *msg) case DP_MSG_DIAL_IMMEDIATE: dp_dial_immediate(dp_int_msg->line, dp_int_msg->call_id, dp_int_msg->collect_more, &(dp_int_msg->digit_str[0]), - &(dp_int_msg->global_call_id[0]), + &(dp_int_msg->global_call_id[0]), dp_int_msg->monitor_mode); break; diff --git a/media/webrtc/signaling/src/sipcc/core/src-common/digcalc.c b/media/webrtc/signaling/src/sipcc/core/src-common/digcalc.c index 778a5fb88c2e..3536e10b7a21 100644 --- a/media/webrtc/signaling/src/sipcc/core/src-common/digcalc.c +++ b/media/webrtc/signaling/src/sipcc/core/src-common/digcalc.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_string.h" #include "cpr_stdio.h" @@ -124,14 +89,14 @@ DigestCalcResponse (IN HASHHEX HA1, /* H(A1) */ MD5Update(&Md5Ctx, (unsigned char *) pszMethod, strlen(pszMethod)); MD5Update(&Md5Ctx, (unsigned char *) ":", 1); MD5Update(&Md5Ctx, (unsigned char *) pszDigestUri, strlen(pszDigestUri)); - + /* Commented as causes problems on Windows ToDo - * qop is not used but this should be fixed + * qop is not used but this should be fixed if (cpr_strcasecmp(pszQop, "auth-int") == 0) { MD5Update(&Md5Ctx, (unsigned char *) ":", 1); MD5Update(&Md5Ctx, (unsigned char *) HEntity, HASHHEXLEN); }; -*/ +*/ MD5Final((unsigned char *) HA2, &Md5Ctx); CvtHex(HA2, HA2Hex); diff --git a/media/webrtc/signaling/src/sipcc/core/src-common/kpml_common_util.c b/media/webrtc/signaling/src/sipcc/core/src-common/kpml_common_util.c index f63004f1680c..95ed58436672 100755 --- a/media/webrtc/signaling/src/sipcc/core/src-common/kpml_common_util.c +++ b/media/webrtc/signaling/src/sipcc/core/src-common/kpml_common_util.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include @@ -201,7 +166,7 @@ handle_range_selector (char *str, unsigned long *bitmask) /* make sure there is only 1 char after '-' */ char_ptr++; if (*char_ptr != ']') { - KPML_DEBUG(DEB_F_PREFIX"The Regex format %s is not supported.\n", + KPML_DEBUG(DEB_F_PREFIX"The Regex format %s is not supported.\n", DEB_F_PREFIX_ARGS(KPML_INFO, fname), str); rc = KPML_ERROR_INVALID_VALUE; @@ -212,7 +177,7 @@ handle_range_selector (char *str, unsigned long *bitmask) rc = KPML_ERROR_INVALID_VALUE; } } else { - KPML_DEBUG(DEB_F_PREFIX"The Regex format %s is not supported.\n", + KPML_DEBUG(DEB_F_PREFIX"The Regex format %s is not supported.\n", DEB_F_PREFIX_ARGS(KPML_INFO, fname), str); rc = KPML_ERROR_INVALID_VALUE; } @@ -238,7 +203,7 @@ handle_range_selector (char *str, unsigned long *bitmask) } KPML_DEBUG(DEB_F_PREFIX"1st/last digit=%d/%d, bitmask=%lu, " - "return status = %d\n", DEB_F_PREFIX_ARGS(KPML_INFO, fname), first_digit, + "return status = %d\n", DEB_F_PREFIX_ARGS(KPML_INFO, fname), first_digit, last_digit, *bitmask, rc); return (rc); @@ -302,7 +267,7 @@ handle_character_selector (char *str, unsigned long *bitmask) /* There should not be any characters after the ']' */ char_ptr++; if (*char_ptr) { - KPML_DEBUG(DEB_F_PREFIX"The Regex format %s is not supported.\n", + KPML_DEBUG(DEB_F_PREFIX"The Regex format %s is not supported.\n", DEB_F_PREFIX_ARGS(KPML_INFO, fname), str); rc = KPML_ERROR_INVALID_VALUE; } @@ -319,7 +284,7 @@ handle_character_selector (char *str, unsigned long *bitmask) } } - KPML_DEBUG(DEB_F_PREFIX"bitmask=%lu, return status = %d\n", + KPML_DEBUG(DEB_F_PREFIX"bitmask=%lu, return status = %d\n", DEB_F_PREFIX_ARGS(KPML_INFO, fname), *bitmask, rc); return (rc); diff --git a/media/webrtc/signaling/src/sipcc/core/src-common/kpmlmap.c b/media/webrtc/signaling/src/sipcc/core/src-common/kpmlmap.c index 0cf98eb99158..9a1e44de5f7c 100755 --- a/media/webrtc/signaling/src/sipcc/core/src-common/kpmlmap.c +++ b/media/webrtc/signaling/src/sipcc/core/src-common/kpmlmap.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_memory.h" @@ -172,7 +137,7 @@ kpml_create_sm_key (kpml_key_t *key_p, line_t line, callid_t call_id, { static const char fname[] = "kpml_create_sm_key"; - KPML_DEBUG(DEB_L_C_F_PREFIX" timer=0x%0x\n", + KPML_DEBUG(DEB_L_C_F_PREFIX" timer=0x%0x\n", DEB_L_C_F_PREFIX_ARGS(KPML_INFO, line, call_id, fname), tmr_ptr); key_p->line = line; @@ -210,14 +175,14 @@ kpml_match_line_call_id (kpml_data_t * kpml_data_p, kpml_key_t * key_p) /* * Function: kpml_data_present_for_subid() * - * Parameters: sub_id_t - sub id sent int he message + * Parameters: sub_id_t - sub id sent int he message * * Description: Callback function provided to link list - * to see if there kpml_data that matches a sub_id + * to see if there kpml_data that matches a sub_id * * Returns: kpml_data_t * - Return kpml_data if a match is found */ -static kpml_data_t * +static kpml_data_t * kpml_data_for_subid(sub_id_t sub_id) { kpml_data_t *kpml_data; @@ -283,18 +248,18 @@ kpml_stop_timer (void *timer_ptr) /* * Function: kpml_clear_timers() * - * Parameters: kpml_data - pointer to kpml data + * Parameters: kpml_data - pointer to kpml data * - * Description: stop and delete all kpml timers + * Description: stop and delete all kpml timers * - * Returns: None + * Returns: None */ static void kpml_clear_timers (kpml_data_t *kpml_data) { static const char fname[] = "kpml_clear_timers"; - KPML_DEBUG(DEB_L_C_F_PREFIX"Release kpml timers.\n", + KPML_DEBUG(DEB_L_C_F_PREFIX"Release kpml timers.\n", DEB_L_C_F_PREFIX_ARGS(KPML_INFO, kpml_data->line, kpml_data->call_id, fname)); kpml_stop_timer(kpml_data->inter_digit_timer); @@ -344,7 +309,7 @@ kpml_start_timers (kpml_data_t *kpml_data) kpml_data->extra_digit_timer == NULL) { /* generate error to indicate timer cannot be allocated */ - KPML_ERROR(KPML_F_PREFIX"No memory to allocate timer\n", + KPML_ERROR(KPML_F_PREFIX"No memory to allocate timer\n", fname); return; } @@ -381,7 +346,7 @@ kpml_restart_timers (kpml_data_t * kpml_data) { static const char fname[] = "kpml_restart_timers"; - KPML_DEBUG(DEB_L_C_F_PREFIX"Restart all timers\n", + KPML_DEBUG(DEB_L_C_F_PREFIX"Restart all timers\n", DEB_L_C_F_PREFIX_ARGS(KPML_INFO, kpml_data->line, kpml_data->call_id, fname)); kpml_stop_timer(kpml_data->critical_timer); @@ -633,11 +598,11 @@ kpml_inter_digit_timer_callback (void *kpml_key_p) kpml_data_t *kpml_get_kpml_data_from_kpml_id(uint32_t kpml_id) { kpml_data_t *kpml_data; - + kpml_data = (kpml_data_t *) sll_next(s_kpml_list, NULL); - + while (kpml_data != NULL && kpml_data->kpml_id != kpml_id) { - + kpml_data = (kpml_data_t *) sll_next(s_kpml_list, kpml_data); } return(kpml_data); @@ -695,7 +660,7 @@ kpml_start_subscription_timer (kpml_data_t * kpml_data, unsigned long duration) { static const char fname[] = "kpml_start_subscription_timer"; - KPML_DEBUG(DEB_L_C_F_PREFIX"duration=%u\n", + KPML_DEBUG(DEB_L_C_F_PREFIX"duration=%u\n", DEB_L_C_F_PREFIX_ARGS(KPML_INFO, kpml_data->line, kpml_data->call_id, fname), duration); kpml_data->sub_timer = cprCreateTimer("sub timer", @@ -903,7 +868,7 @@ boolean kpml_is_subscribed (callid_t call_id, line_t line) kpml_next_data = (kpml_data_t *) sll_next(s_kpml_list, kpml_data); if (kpml_data->pending_sub && kpml_data->line == line && - kpml_data->call_id == call_id) { + kpml_data->call_id == call_id) { return TRUE; } kpml_data = kpml_next_data; @@ -959,7 +924,7 @@ kpml_update_dialed_digits (line_t line, callid_t call_id, char digit) /* update the digit string */ dial_len = strlen(kpml_data->kpmlDialed); if (dial_len >= MAX_DIALSTRING-1) - { // not enough room + { // not enough room KPML_ERROR(DEB_L_C_F_PREFIX"dial_len = [%d] too large\n", DEB_L_C_F_PREFIX_ARGS(KPML_INFO, line, call_id, fname), dial_len); return (state); } @@ -975,7 +940,7 @@ kpml_update_dialed_digits (line_t line, callid_t call_id, char digit) kpml_data = kpml_next_data; continue; } - + if (digit == 0x0F) { kpml_data->kpmlDialed[dial_len] = '#'; @@ -1218,7 +1183,7 @@ check_kpml_config (line_t line, callid_t call_id) lsm_state = lsm_get_state(call_id); if (lsm_state == LSM_S_NONE) { - KPML_ERROR(KPML_L_C_F_PREFIX"NO call\n", + KPML_ERROR(KPML_L_C_F_PREFIX"NO call\n", line, call_id, fname); return (KPML_BAD_EVENT); } @@ -1310,8 +1275,8 @@ kpml_treat_regex (kpml_data_t *kpml_data) kpml_data->enable_backspace = FALSE; - KPML_DEBUG(DEB_L_C_F_PREFIX"regex=%u\n", - DEB_L_C_F_PREFIX_ARGS(KPML_INFO, kpml_data->line, kpml_data->call_id, fname), + KPML_DEBUG(DEB_L_C_F_PREFIX"regex=%u\n", + DEB_L_C_F_PREFIX_ARGS(KPML_INFO, kpml_data->line, kpml_data->call_id, fname), kpml_data->regex[indx].regexData); /* skip white space and check for backspace */ @@ -1412,7 +1377,7 @@ kpml_update_data (kpml_data_t *kpml_data, KPMLRequest *kpml_sub_data) KPML_DEBUG(DEB_L_C_F_PREFIX"regex=%u" "persistent=%d int-timer=%u critic-timer=%u, extra-timer=%u" "flush=%d longhold=%d longrepeat=%d nopartial=%d\n", - DEB_L_C_F_PREFIX_ARGS(KPML_INFO, kpml_data->line, kpml_data->call_id, fname), + DEB_L_C_F_PREFIX_ARGS(KPML_INFO, kpml_data->line, kpml_data->call_id, fname), kpml_data->regex, kpml_data->persistent, kpml_data->inttimeout, kpml_data->crittimeout, kpml_data->extratimeout, kpml_data->flush, kpml_data->longhold, @@ -1451,11 +1416,11 @@ kpml_terminate_subscription (ccsip_sub_not_data_t *msg) return; } - KPML_DEBUG(DEB_L_C_F_PREFIX"sub_id=%d, reason=%d\n", - DEB_L_C_F_PREFIX_ARGS(KPML_INFO, msg->line_id, msg->gsm_id, fname), + KPML_DEBUG(DEB_L_C_F_PREFIX"sub_id=%d, reason=%d\n", + DEB_L_C_F_PREFIX_ARGS(KPML_INFO, msg->line_id, msg->gsm_id, fname), msg->sub_id, msg->reason_code); /* - * If the terminate reason is caused by local action, + * If the terminate reason is caused by local action, * then there is no need to send any notify to the network. */ switch (msg->reason_code) { @@ -1465,8 +1430,8 @@ kpml_terminate_subscription (ccsip_sub_not_data_t *msg) /* * These errors are caused by failure or system being shutting down. * Subscription manager will automatically clean up the subscription - * The application just needs to clean up the associated data - * strutures. + * The application just needs to clean up the associated data + * strutures. */ normal_terminate = FALSE; break; @@ -1543,14 +1508,14 @@ kpml_receive_subscribe (ccsip_sub_not_data_t *msg) boolean is_empty_resubscribe = FALSE; if (kpml_get_config_value() == KPML_NONE) { - KPML_DEBUG(DEB_L_C_F_PREFIX"KPML disabled in config.\n", + KPML_DEBUG(DEB_L_C_F_PREFIX"KPML disabled in config.\n", DEB_L_C_F_PREFIX_ARGS(KPML_INFO, msg->line_id, msg->gsm_id, fname)); return; } if (msg->line_id == 0 || msg->gsm_id == 0) { - KPML_ERROR(KPML_L_C_F_PREFIX"Line or call_id not correct\n", + KPML_ERROR(KPML_L_C_F_PREFIX"Line or call_id not correct\n", msg->line_id, msg->gsm_id, fname); (void) sub_int_subscribe_ack(CC_SRC_GSM, CC_SRC_SIP, msg->sub_id, KPML_BAD_EVENT, msg->sub_duration); @@ -1586,8 +1551,8 @@ kpml_receive_subscribe (ccsip_sub_not_data_t *msg) if (kpml_data->sub_id != msg->sub_id) { KPML_DEBUG(DEB_L_C_F_PREFIX"Terminate previous subscription \ - sub_id = %x\n", - DEB_L_C_F_PREFIX_ARGS(KPML_INFO, kpml_data->line, kpml_data->call_id, fname), + sub_id = %x\n", + DEB_L_C_F_PREFIX_ARGS(KPML_INFO, kpml_data->line, kpml_data->call_id, fname), kpml_data->sub_id); kpml_generate_notify(kpml_data, FALSE, @@ -1598,11 +1563,11 @@ kpml_receive_subscribe (ccsip_sub_not_data_t *msg) msg->request_id, msg->event); } - KPML_DEBUG(DEB_L_C_F_PREFIX"Refresh Subscription\n", + KPML_DEBUG(DEB_L_C_F_PREFIX"Refresh Subscription\n", DEB_L_C_F_PREFIX_ARGS(KPML_INFO, kpml_data->line, kpml_data->call_id, fname)); /* Refresh subscription without kpml body. This is CCM current behavior * which seems not to follow rfc4730. We support this for compatibility - * purpose, and intepret the body to be exactly the same as previous + * purpose, and intepret the body to be exactly the same as previous * subscription. Only new subscription time changes. */ if (kpml_sub_data == NULL) { @@ -1619,7 +1584,7 @@ kpml_receive_subscribe (ccsip_sub_not_data_t *msg) kpml_data = kpml_update_data(kpml_data, kpml_sub_data); - KPML_DEBUG(DEB_L_C_F_PREFIX"Activate Subscription\n", + KPML_DEBUG(DEB_L_C_F_PREFIX"Activate Subscription\n", DEB_L_C_F_PREFIX_ARGS(KPML_INFO, kpml_data->line, kpml_data->call_id, fname)); } @@ -1750,12 +1715,12 @@ kpml_receive_subscribe (ccsip_sub_not_data_t *msg) lsm_state = lsm_get_state(kpml_data->call_id); - /* When GSM receives FEATURE event transitions its state. To avoid - * transition during DTMF phase do not send out the event if the + /* When GSM receives FEATURE event transitions its state. To avoid + * transition during DTMF phase do not send out the event if the * lsm state is > RINGOUT state. GSM has to know about the subscription - * only to extend the collect info (KPML_COLLECT_INFO) + * only to extend the collect info (KPML_COLLECT_INFO) */ - + if ((lsm_state != LSM_S_NONE) && (lsm_state < LSM_S_RINGOUT)) { cc_feature(CC_SRC_GSM, kpml_data->call_id, kpml_data->line, @@ -1792,7 +1757,7 @@ kpml_generate_subscribe_response (kpml_data_t * kpml_data, int resp_code) { static const char fname[] = "kpml_generate_subscribe_response"; - KPML_DEBUG(DEB_L_C_F_PREFIX"SUB response\n", + KPML_DEBUG(DEB_L_C_F_PREFIX"SUB response\n", DEB_L_C_F_PREFIX_ARGS(KPML_INFO, kpml_data->line, kpml_data->call_id, fname)); (void) sub_int_subscribe_ack(CC_SRC_GSM, CC_SRC_SIP, kpml_data->sub_id, @@ -1816,7 +1781,7 @@ kpml_receive_notify_response (ccsip_sub_not_data_t *msg) kpml_data_t *kpml_data; kpml_key_t kpml_key; - KPML_DEBUG(DEB_L_C_F_PREFIX"Notify response\n", + KPML_DEBUG(DEB_L_C_F_PREFIX"Notify response\n", DEB_L_C_F_PREFIX_ARGS(KPML_INFO, msg->line_id, msg->gsm_id, fname)); kpml_create_sm_key(&kpml_key, (line_t) msg->line_id, (callid_t) msg->gsm_id, @@ -1872,7 +1837,7 @@ kpml_generate_notify (kpml_data_t *kpml_data, boolean no_body, char resp_str[10]; ccsip_event_data_t *peventData = NULL; - DEF_DEBUG(DEB_L_C_F_PREFIX"RESP %u: \n", + DEF_DEBUG(DEB_L_C_F_PREFIX"RESP %u: \n", DEB_L_C_F_PREFIX_ARGS(KPML_INFO, kpml_data->line, kpml_data->call_id, fname), resp_code); if (no_body == FALSE) { @@ -1881,7 +1846,7 @@ kpml_generate_notify (kpml_data_t *kpml_data, boolean no_body, cpr_malloc(sizeof(ccsip_event_data_t)); if (peventData == NULL) { - KPML_ERROR(KPML_L_C_F_PREFIX"No memory for eventdata\n", + KPML_ERROR(KPML_L_C_F_PREFIX"No memory for eventdata\n", kpml_data->line, kpml_data->call_id, fname); return; } @@ -2143,13 +2108,13 @@ kpml_shutdown (void) while (kpml_data != NULL) { - /* + /* * Clean up, remove from the list and deallocate the kpml_data */ (void) kpml_clear_data(kpml_data, KPML_ONE_SHOT); - /* - * The kpml_data is already freed above, get the next one + /* + * The kpml_data is already freed above, get the next one * from the list's head */ kpml_data = (kpml_data_t *) sll_next(s_kpml_list, NULL); diff --git a/media/webrtc/signaling/src/sipcc/core/src-common/md5.c b/media/webrtc/signaling/src/sipcc/core/src-common/md5.c index fd24d3831254..71a3abf5b960 100644 --- a/media/webrtc/signaling/src/sipcc/core/src-common/md5.c +++ b/media/webrtc/signaling/src/sipcc/core/src-common/md5.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * the md5.c source code that appears in RFC 1321 is badly indented, diff --git a/media/webrtc/signaling/src/sipcc/core/src-common/misc_apps_task.c b/media/webrtc/signaling/src/sipcc/core/src-common/misc_apps_task.c index ccc2f8ec478a..9a69fb8f3154 100755 --- a/media/webrtc/signaling/src/sipcc/core/src-common/misc_apps_task.c +++ b/media/webrtc/signaling/src/sipcc/core/src-common/misc_apps_task.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_memory.h" @@ -56,7 +21,7 @@ #define MISC_ERROR err_msg cprMsgQueue_t s_misc_msg_queue; -void destroy_misc_app_thread(void); +void destroy_misc_app_thread(void); extern cprThread_t misc_app_thread; cpr_status_e @@ -82,7 +47,7 @@ MiscAppTaskSendMsg (uint32_t cmd, cprBuffer_t buf, uint16_t len) void MiscAppTask (void *arg) { - static const char fname[] = "MiscAppTask"; + static const char fname[] = "MiscAppTask"; void *msg_p; phn_syshdr_t *syshdr_p; @@ -94,7 +59,7 @@ void MiscAppTask (void *arg) MISC_ERROR(MISC_F_PREFIX"invalid input, exiting\n", fname); return; } - + if (platThreadInit("MiscAppTask") != 0) { MISC_ERROR(MISC_F_PREFIX"Failed to Initialize the thread, exiting\n", fname); @@ -135,7 +100,7 @@ void MiscAppTask (void *arg) break; case THREAD_UNLOAD: - destroy_misc_app_thread(); + destroy_misc_app_thread(); break; default: @@ -163,19 +128,19 @@ void MiscAppTask (void *arg) void MiscAppTaskShutdown (void) { /* Destroy retry after timers */ - pres_destroy_retry_after_timers(); + pres_destroy_retry_after_timers(); } -/* +/* * Function: destroy_misc_thread - * Description: shutdown and kill misc app thread + * Description: shutdown and kill misc app thread * Parameters: none * Returns: none */ void destroy_misc_app_thread() { static const char fname[] = "destroy_misc_app_thread"; - DEF_DEBUG(DEB_F_PREFIX"Unloading Misc app and destroying Misc app thread\n", + DEF_DEBUG(DEB_F_PREFIX"Unloading Misc app and destroying Misc app thread\n", DEB_F_PREFIX_ARGS(SIP_CC_INIT, fname)); configapp_shutdown(); MiscAppTaskShutdown(); diff --git a/media/webrtc/signaling/src/sipcc/core/src-common/pres_sub_not_handler.c b/media/webrtc/signaling/src/sipcc/core/src-common/pres_sub_not_handler.c index fe3248eeeaea..1c2db74eeb46 100755 --- a/media/webrtc/signaling/src/sipcc/core/src-common/pres_sub_not_handler.c +++ b/media/webrtc/signaling/src/sipcc/core/src-common/pres_sub_not_handler.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_strings.h" #include "pres_sub_not_handler.h" @@ -996,7 +961,7 @@ static void sub_handler_initialized (void) if (presentity_url == NULL) { BLF_ERROR("MSC: Error parsing presentity_url", fname); - return; + return; } presentity_url = presentity_url + 1; diff --git a/media/webrtc/signaling/src/sipcc/core/src-common/publish_int.c b/media/webrtc/signaling/src/sipcc/core/src-common/publish_int.c index e437ce2503e7..9982b89f1c4e 100644 --- a/media/webrtc/signaling/src/sipcc/core/src-common/publish_int.c +++ b/media/webrtc/signaling/src/sipcc/core/src-common/publish_int.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "publish_int.h" #include "subapi.h" @@ -89,7 +54,7 @@ void publish_init (pub_handle_t app_handle, cc_subscriptions_t event_type, ccsip_event_data_t *event_data_p, cc_srcs_t callback_task, - int message_id + int message_id ) { @@ -128,8 +93,8 @@ void publish_update (pub_handle_t pub_handle, cc_subscriptions_t event_type, ccsip_event_data_t *event_data_p, cc_srcs_t callback_task, - int message_id - ) + int message_id + ) { pub_req_t pub_req; @@ -161,7 +126,7 @@ void publish_update (pub_handle_t pub_handle, void publish_terminate (pub_handle_t pub_handle, cc_subscriptions_t event_type, cc_srcs_t callback_task, - int message_id + int message_id ) { pub_req_t pub_req; @@ -192,7 +157,7 @@ void publish_terminate (pub_handle_t pub_handle, */ cc_rcs_t publish_int_response (pub_rsp_t *pub_rsp_p, cc_srcs_t callback_task, - int message_id + int message_id ) { pub_rsp_t *pmsg; diff --git a/media/webrtc/signaling/src/sipcc/core/src-common/singly_link_list.c b/media/webrtc/signaling/src/sipcc/core/src-common/singly_link_list.c index 3a8a105cf4a2..417486f2b2b0 100644 --- a/media/webrtc/signaling/src/sipcc/core/src-common/singly_link_list.c +++ b/media/webrtc/signaling/src/sipcc/core/src-common/singly_link_list.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_stdio.h" #include "cpr_stdlib.h" diff --git a/media/webrtc/signaling/src/sipcc/core/src-common/sll_lite.c b/media/webrtc/signaling/src/sipcc/core/src-common/sll_lite.c index eafbfbd72a45..0780374bc2f4 100644 --- a/media/webrtc/signaling/src/sipcc/core/src-common/sll_lite.c +++ b/media/webrtc/signaling/src/sipcc/core/src-common/sll_lite.c @@ -1,51 +1,16 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * This module provides sigle linked list near functionality of the - * the singly_link_list.c module with limitations. The main + * the singly_link_list.c module with limitations. The main * intention is for low overhead. The followings are the main * differences. * * 1) It does not allocate storage containers for list node or * list control structures by the facility. The caller - * provides the storage from any source as needed. + * provides the storage from any source as needed. * * 2) No application call back for node search/find. * @@ -56,7 +21,7 @@ * * 4) Lite verion is higher risk because the caller also has * the defition of the list and node structures. Use it - * at your own risk. + * at your own risk. * * 5) There is no protection for mutual exclusive access by * multiple threads or from interrupt context. The caller @@ -77,24 +42,24 @@ */ /** - * sll_lite_init initializes list control structure given by the + * sll_lite_init initializes list control structure given by the * caller. * - * @param[in]list - pointer to the list control structure - * sll_lite_list_t + * @param[in]list - pointer to the list control structure + * sll_lite_list_t * * @return - SLL_LITE_RET_SUCCESS for success - * - SLL_LITE_RET_INVALID_ARGS when arguments are + * - SLL_LITE_RET_INVALID_ARGS when arguments are * invalid. */ sll_lite_return_e sll_lite_init (sll_lite_list_t *list) { - if (list == NULL) { + if (list == NULL) { return (SLL_LITE_RET_INVALID_ARGS); } list->count = 0; - list->head_p = NULL; + list->head_p = NULL; list->tail_p = NULL; return (SLL_LITE_RET_SUCCESS); } @@ -102,13 +67,13 @@ sll_lite_init (sll_lite_list_t *list) /** * sll_lite_link_head puts node to the head of the list. * - * @param[in]list - pointer to the list control structure + * @param[in]list - pointer to the list control structure * sll_lite_list_t. The list must be - * initialized prior. + * initialized prior. * @param[in]node - pointer to the list node structure. * * @return - SLL_LITE_RET_SUCCESS for success - * - SLL_LITE_RET_INVALID_ARGS when arguments are + * - SLL_LITE_RET_INVALID_ARGS when arguments are * invalid. */ sll_lite_return_e @@ -122,7 +87,7 @@ sll_lite_link_head (sll_lite_list_t *list, sll_lite_node_t *node) /* list is empty, this node becomes head */ list->head_p = node; list->tail_p = node; - node->next_p = NULL; + node->next_p = NULL; } else { /* list is not empty, link to the head */ node->next_p = list->head_p; @@ -239,7 +204,7 @@ sll_lite_unlink_tail (sll_lite_list_t *list) * removed. * * @return - SLL_LITE_RET_SUCCESS for success - * - SLL_LITE_RET_INVALID_ARGS when arguments are + * - SLL_LITE_RET_INVALID_ARGS when arguments are * invalid. * - SLL_LITE_RET_NODE_NOT_FOUND when the node * to remove is not found. diff --git a/media/webrtc/signaling/src/sipcc/core/src-common/string_lib.c b/media/webrtc/signaling/src/sipcc/core/src-common/string_lib.c index 80c12df4e5ed..c24dad282f60 100755 --- a/media/webrtc/signaling/src/sipcc/core/src-common/string_lib.c +++ b/media/webrtc/signaling/src/sipcc/core/src-common/string_lib.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #define __STRINGLIB_INTERNAL__ @@ -78,8 +43,8 @@ strlib_malloc (const char *str, int length, const char *fname, int line) // if specified length is unknown or invalid... then calculate it // Length < 0 is not expected, but since length is an int, it could - // theoritically be negative. [ This check accounts for that, and - // avoids a static analysis warning related to same ] + // theoritically be negative. [ This check accounts for that, and + // avoids a static analysis warning related to same ] if ((length == LEN_UNKNOWN) || (length < 0)) { length = strlen(str); } @@ -267,7 +232,7 @@ strlib_free (string_t str) temp->signature = 0; cpr_free(temp); } - + return; } @@ -312,7 +277,7 @@ strlib_open (string_t str, int length, const char *fname, int line) strlib_free(str); } } - + return (ret_str); } diff --git a/media/webrtc/signaling/src/sipcc/core/src-common/util_ios_queue.c b/media/webrtc/signaling/src/sipcc/core/src-common/util_ios_queue.c index f4ba846ee328..694efd4bafda 100644 --- a/media/webrtc/signaling/src/sipcc/core/src-common/util_ios_queue.c +++ b/media/webrtc/signaling/src/sipcc/core/src-common/util_ios_queue.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdlib.h" diff --git a/media/webrtc/signaling/src/sipcc/core/src-common/util_parse.c b/media/webrtc/signaling/src/sipcc/core/src-common/util_parse.c index dfbabc652b2d..59b532551244 100644 --- a/media/webrtc/signaling/src/sipcc/core/src-common/util_parse.c +++ b/media/webrtc/signaling/src/sipcc/core/src-common/util_parse.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_string.h" diff --git a/media/webrtc/signaling/src/sipcc/core/src-common/util_string.c b/media/webrtc/signaling/src/sipcc/core/src-common/util_string.c index 6632c032ddfc..5c4c9dc30acb 100644 --- a/media/webrtc/signaling/src/sipcc/core/src-common/util_string.c +++ b/media/webrtc/signaling/src/sipcc/core/src-common/util_string.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include @@ -53,7 +18,7 @@ * addr : pointer to the IP address * * @return none - * + * * @pre none * */ @@ -97,7 +62,7 @@ ipaddr2dotted (char *addr_str, cpr_ip_addr_t *addr) * @param addr_str ip address string * * @return address - * + * * @pre none * */ @@ -168,7 +133,7 @@ dotted2ipaddr (const char *addr_str) * @param ip_addr_in, ip_addr_out : IP addresses * * @return none - * + * * @pre none * */ @@ -205,12 +170,12 @@ void util_ntohl (cpr_ip_addr_t *ip_addr_out, cpr_ip_addr_t *ip_addr_in) * Check if the IP address passed is valid. For IPv4& IPv6 check if value 0 if so * return FALSE. If the type is CPR_IP_ADDR_INVALID or any other non defined type * return FALSE. - * + * * * @param ip_addr IP address * * @return boolean False if not a valid IP, or else true - * + * * @pre none * */ @@ -220,13 +185,13 @@ boolean util_check_if_ip_valid (cpr_ip_addr_t *ip_addr) if (ip_addr->type == CPR_IP_ADDR_INVALID) { return(FALSE); } - if (ip_addr->type == CPR_IP_ADDR_IPV4 && + if (ip_addr->type == CPR_IP_ADDR_IPV4 && ip_addr->u.ip4 == 0) { return(FALSE); } - if ((ip_addr->type == CPR_IP_ADDR_IPV6) && + if ((ip_addr->type == CPR_IP_ADDR_IPV6) && (ip_addr->u.ip6.addr.base16[7] == 0) && (ip_addr->u.ip6.addr.base16[6] == 0) && (ip_addr->u.ip6.addr.base16[5] == 0) && @@ -239,7 +204,7 @@ boolean util_check_if_ip_valid (cpr_ip_addr_t *ip_addr) return(FALSE); } - if ((ip_addr->type != CPR_IP_ADDR_INVALID) && + if ((ip_addr->type != CPR_IP_ADDR_INVALID) && (ip_addr->type != CPR_IP_ADDR_IPV4) && (ip_addr->type != CPR_IP_ADDR_IPV6)) { @@ -255,7 +220,7 @@ boolean util_check_if_ip_valid (cpr_ip_addr_t *ip_addr) * @param ip_addr1 & ip_addr2 2 ip addresses to compare * * @return true if that matches or else false - * + * * @pre (ip_addr1 != NULL) && (ip_addr2 != NULL) * */ @@ -275,7 +240,7 @@ boolean util_compare_ip (cpr_ip_addr_t *ip_addr1, cpr_ip_addr_t *ip_addr2) } else if (ip_addr1->type == CPR_IP_ADDR_IPV6 && ip_addr2->type == CPR_IP_ADDR_IPV6) { - return((boolean)memcmp((void *)&(ip_addr1->u.ip6.addr.base8), + return((boolean)memcmp((void *)&(ip_addr1->u.ip6.addr.base8), (void *)&(ip_addr2->u.ip6.addr.base8), 16)); } @@ -287,19 +252,19 @@ boolean util_compare_ip (cpr_ip_addr_t *ip_addr1, cpr_ip_addr_t *ip_addr2) * * @param ip_addr ip address to be filled. * cpr_sockaddr_storage storage structure pointer - * + * * @return none - * + * * @pre (ip_addr != NULL) * */ -void util_extract_ip (cpr_ip_addr_t *ip_addr, +void util_extract_ip (cpr_ip_addr_t *ip_addr, cpr_sockaddr_storage *from) { switch (from->ss_family) { case AF_INET6: ip_addr->type = CPR_IP_ADDR_IPV6; - ip_addr->u.ip6 = ((cpr_sockaddr_in6_t *)from)->sin6_addr; + ip_addr->u.ip6 = ((cpr_sockaddr_in6_t *)from)->sin6_addr; break; case AF_INET: ip_addr->type = CPR_IP_ADDR_IPV4; @@ -316,7 +281,7 @@ void util_extract_ip (cpr_ip_addr_t *ip_addr, * @param sock_storage * * @return port number - * + * * @pre (sock_storage != NULL) * */ @@ -382,7 +347,7 @@ diff_current_time (unsigned long t1, unsigned long *difference) return 0; } -boolean +boolean is_empty_str (char *str) { if (str == NULL) { @@ -394,7 +359,7 @@ is_empty_str (char *str) return FALSE; } -void +void init_empty_str (char *str) { strcpy(str,EMPTY_STR); diff --git a/media/webrtc/signaling/src/sipcc/cpr/common/cpr_string.c b/media/webrtc/signaling/src/sipcc/cpr/common/cpr_string.c index 335a20676e89..9309d5a59949 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/common/cpr_string.c +++ b/media/webrtc/signaling/src/sipcc/cpr/common/cpr_string.c @@ -1,43 +1,11 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include +#include +#include "mozilla/Assertions.h" #include "cpr_types.h" #include "cpr_stdlib.h" #include "cpr_string.h" @@ -129,3 +97,101 @@ sstrncat (char *s1, const char *s2, unsigned long max) return s1; } + +/* + * flex_string + */ + +/* + * flex_string_init + * + * Not thread-safe + */ +void flex_string_init(flex_string *fs) { + fs->buffer_length = FLEX_STRING_CHUNK_SIZE; + fs->string_length = 0; + fs->buffer = cpr_malloc(fs->buffer_length); + fs->buffer[0] = '\0'; +} + +/* + * flex_string_free + * + * Not thread-safe + */ +void flex_string_free(flex_string *fs) { + fs->buffer_length = 0; + fs->string_length = 0; + cpr_free(fs->buffer); + fs->buffer = NULL; +} + +/* For sanity check before alloc */ +#define FLEX_STRING_MAX_SIZE (10 * 1024 * 1024) /* 10MB */ + +/* + * flex_string_check_alloc + * + * Allocate enough chunks to hold the new minimum size. + * + * Not thread-safe + */ +void flex_string_check_alloc(flex_string *fs, size_t new_min_length) { + if (new_min_length > fs->buffer_length) { + /* Oversize, allocate more */ + + /* Sanity check on allocation size */ + if (new_min_length > FLEX_STRING_MAX_SIZE) { + MOZ_CRASH(); + } + + /* Alloc to nearest chunk */ + fs->buffer_length = (((new_min_length - 1) / FLEX_STRING_CHUNK_SIZE) + 1) * FLEX_STRING_CHUNK_SIZE; + + fs->buffer = cpr_realloc(fs->buffer, fs->buffer_length); + } +} + +/* + * flex_string_append + * + * Not thread-safe + */ +void flex_string_append(flex_string *fs, const char *more) { + fs->string_length += strlen(more); + + flex_string_check_alloc(fs, fs->string_length + 1); + + sstrncat(fs->buffer, more, fs->buffer_length - strlen(fs->buffer)); +} + +/* + * flex_string_sprintf + * + * Not thread-safe + */ +void flex_string_sprintf(flex_string *fs, const char *format, ...) { + va_list ap; + int vsnprintf_result; + + va_start(ap, format); + vsnprintf_result = vsnprintf(fs->buffer + fs->string_length, fs->buffer_length - fs->string_length, format, ap); + va_end(ap); + + if (fs->string_length + vsnprintf_result >= fs->buffer_length) { + /* Buffer overflow, resize */ + flex_string_check_alloc(fs, fs->string_length + vsnprintf_result + 1); + + /* Try again with new buffer */ + va_start(ap, format); + vsnprintf_result = vsnprintf(fs->buffer + fs->string_length, fs->buffer_length - fs->string_length, format, ap); + MOZ_ASSERT(vsnprintf_result > 0 && vsnprintf_result < (fs->buffer_length - fs->string_length)); + va_end(ap); + } + + if (vsnprintf_result > 0) { + fs->string_length += vsnprintf_result; + } +} + + diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_align.h b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_align.h index dfc0631b4994..7c91ff34d14f 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_align.h +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_align.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef __CPR_DARWIN_ALIGN_H__ #define __CPR_DARWIN_ALIGN_H__ @@ -54,12 +19,12 @@ #define ALIGN_MASK(alignment) (~((alignment) - 1)) /* - * Macro to set the minimum alignment + * Macro to set the minimum alignment */ #define ALIGN_MIN(align,align_min) (((align) > (align_min)) ? (align) : (align_min)) /* - * Macro to round up or down "val" to be a multiple of "align", assuming + * Macro to round up or down "val" to be a multiple of "align", assuming * "align" is a power of 2. if "align" is zero then no action will * be performed */ diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_assert.h b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_assert.h index cb751113ec8b..b18092585fff 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_assert.h +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_assert.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_DARWIN_ASSERT_H_ #define _CPR_DARWIN_ASSERT_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_errno.c b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_errno.c index 95addc79df2d..5241eae034ab 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_errno.c +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_errno.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_errno.h" #include @@ -157,8 +122,8 @@ int8_t errno_table[] = * * @brief Translates to "cpr_errno" Macro * - * pSIPCC uses the cpr_errno macro to print the errno - * for error conditions. This function is used to map the standard + * pSIPCC uses the cpr_errno macro to print the errno + * for error conditions. This function is used to map the standard * errno to standard CPR errors * * @return The CPR error number diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_errno.h b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_errno.h index c2555bc8981f..7e7dad634792 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_errno.h +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_errno.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_DARWIN_ERRNO_H_ #define _CPR_DARWIN_ERRNO_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_in.h b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_in.h index 143d0c3a39e5..f057e08ae76d 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_in.h +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_in.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_DARWIN_IN_H_ #define _CPR_DARWIN_IN_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_init.c b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_init.c index 94a3d3853e17..6985b0ee86bc 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_init.c +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_init.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * @@ -67,8 +32,8 @@ * @li Debug/Logging Abstraction * * @section file_list EXTERNAL APIS - * The External APIs that need to be exposed by CPR to the pSIPCC application are - * defined in the following header files. The documentation within + * The External APIs that need to be exposed by CPR to the pSIPCC application are + * defined in the following header files. The documentation within * each header file lists the functions/macros that @b NEED to be defined for * pSIPCC to work correctly. Example functions (and an implementation for * Linux) is available for most functions defined in these headers. Look under @@ -88,7 +53,7 @@ * @li cpr_stddef.h * @li cpr_time.h * @li cpr_types.h - * + * * The function prototypes in these header files are implemented in the * binaries related to memory and string functionality. The prototypes are * given so that vendors can use these functions for implementation of other @@ -125,7 +90,7 @@ * * @file cpr_darwin_init.c * @brief This file contains CPR initialization routines - * + * * DESCRIPTION * Initialization routine for the Cisco Portable Runtime layer * running in the Linux operating System. @@ -135,7 +100,7 @@ * @addtogroup Initialization The initialization module * @ingroup CPR * @brief The intialization module consists of APIs used to initialize or destroy the CPR layer by pSipCC - * + * * @{ */ #include "cpr.h" @@ -152,12 +117,12 @@ #include /** - * Mutex to manage message queue list. + * Mutex to manage message queue list. */ extern pthread_mutex_t msgQueueListMutex; /** - * Boolean to check that cprPreInit been called + * Boolean to check that cprPreInit been called */ static boolean pre_init_called = FALSE; @@ -174,11 +139,11 @@ int32_t cprInfo = TRUE; /** * cprPreInit * - * @brief The cprPreInit function IS called from pSIPCC @b before any components are initialized. + * @brief The cprPreInit function IS called from pSIPCC @b before any components are initialized. * * This function @b SHOULD initialize those portions of the CPR that * are needed before applications can start using it. The memory subsystem - * (sandbox) is initialized from this routine. + * (sandbox) is initialized from this routine. * * * @return CPR_SUCCESS or CPR_FAILURE @@ -212,7 +177,7 @@ cprPreInit (void) CPR_ERROR("%s: timer pre init failed %d\n", fname, returnCode); return CPR_FAILURE; } - + return CPR_SUCCESS; } @@ -221,7 +186,7 @@ cprPreInit (void) /** * cprPostInit * - * @brief The cprPostInit function IS called from pSIPCC @b after all the components are initialized. + * @brief The cprPostInit function IS called from pSIPCC @b after all the components are initialized. * * This function @b SHOULD complete any CPR activities before the phone is * operational. In other words a call to this function will be the last line of diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.c b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.c index 307fc8f4d222..a7c47e192a08 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.c +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr.h" #include "cpr_stdlib.h" @@ -166,7 +131,7 @@ static const char unnamed_string[] = "unnamed"; * will sleep the timeout interval to allow the msg queue to be * drained. * - * Note: 25 attempts for upto .5 seconds at the interval of + * Note: 25 attempts for upto .5 seconds at the interval of * CPR_SND_TIMEOUT_WAIT_INTERVAL worst case. */ #define CPR_ATTEMPTS_TO_SEND 25 @@ -226,7 +191,7 @@ cprCreateMessageQueue (const char *name, uint16_t depth) msgq->name = name ? name : unnamed_string; msgq->queueId = key_id++; - + pthread_cond_t _cond = PTHREAD_COND_INITIALIZER; msgq->cond = _cond; pthread_mutex_t _lock = PTHREAD_MUTEX_INITIALIZER; @@ -257,7 +222,7 @@ cprDestroyMessageQueue (cprMsgQueue_t msgQueue) static const char fname[] = "cprDestroyMessageQueue"; cpr_msg_queue_t *msgq; void *msg; - + msgq = (cpr_msg_queue_t *) msgQueue; if (msgq == NULL) { /* Bad application! */ @@ -351,7 +316,7 @@ void * cprGetMessage (cprMsgQueue_t msgQueue, boolean waitForever, void **ppUserData) { static const char fname[] = "cprGetMessage"; - + void *buffer = 0; cpr_msg_queue_t *msgq; cpr_msgq_node_t *node; @@ -362,12 +327,12 @@ cprGetMessage (cprMsgQueue_t msgQueue, boolean waitForever, void **ppUserData) int tz_minuteswest; /* of Greenwich */ int tz_dsttime; /* type of dst correction to apply */ } tz; - + /* Initialize ppUserData */ if (ppUserData) { *ppUserData = NULL; } - + msgq = (cpr_msg_queue_t *) msgQueue; if (msgq == NULL) { /* Bad application! */ @@ -375,14 +340,14 @@ cprGetMessage (cprMsgQueue_t msgQueue, boolean waitForever, void **ppUserData) errno = EINVAL; return NULL; } - + /* * If waitForever is set, block on the message queue * until a message is received, else return after * 25msec of waiting */ pthread_mutex_lock(&msgq->mutex); - + if (!waitForever) { // We'll wait till 25uSec from now @@ -391,7 +356,7 @@ cprGetMessage (cprMsgQueue_t msgQueue, boolean waitForever, void **ppUserData) timeout.tv_sec = tv.tv_sec; pthread_cond_timedwait(&msgq->cond, &msgq->mutex, &timeout); - + } else { @@ -400,7 +365,7 @@ cprGetMessage (cprMsgQueue_t msgQueue, boolean waitForever, void **ppUserData) pthread_cond_wait(&msgq->cond, &msgq->mutex); } } - + // If there is a message on the queue, de-queue it if (msgq->tail) { @@ -420,11 +385,11 @@ cprGetMessage (cprMsgQueue_t msgQueue, boolean waitForever, void **ppUserData) *ppUserData = node->pUserData; } buffer = node->msg; - + } - + pthread_mutex_unlock(&msgq->mutex); - + return buffer; } @@ -470,26 +435,26 @@ cprSendMessage (cprMsgQueue_t msgQueue, void *msg, void **ppUserData) cpr_msg_queue_t *msgq; int16_t attemptsToSend = CPR_ATTEMPTS_TO_SEND; uint16_t numAttempts = 0; - + /* Bad application? */ if (msgQueue == NULL) { CPR_ERROR(error_str, fname, "undefined", "invalid input"); errno = EINVAL; return CPR_FAILURE; } - + msgq = (cpr_msg_queue_t *) msgQueue; - - /* + + /* * Attempt to send message */ do { - - /* + + /* * Post the message to the Queue */ rc = cprPostMessage(msgq, msg, ppUserData); - + if (rc == CPR_MSGQ_POST_SUCCESS) { cprPegSendMessageStats(msgq, numAttempts); return CPR_SUCCESS; @@ -504,11 +469,11 @@ cprSendMessage (cprMsgQueue_t msgQueue, void *msg, void **ppUserData) if (pthread_self() == msgq->thread) { msgq->selfQErrors++; } - + return CPR_FAILURE; } - - + + /* * Did not succeed in sending the message, so continue * to attempt up to the CPR_ATTEMPTS_TO_SEND. @@ -528,7 +493,7 @@ cprSendMessage (cprMsgQueue_t msgQueue, void *msg, void **ppUserData) numAttempts++; } } while (attemptsToSend > 0); - + CPR_ERROR(error_str, fname, msgq->name, "FULL"); msgq->sendErrors++; return CPR_FAILURE; @@ -577,7 +542,7 @@ static cpr_msgq_post_result_e cprPostMessage (cpr_msg_queue_t *msgq, void *msg, void **ppUserData) { cpr_msgq_node_t *node; - + /* * Allocate new message queue node */ @@ -586,9 +551,9 @@ cprPostMessage (cpr_msg_queue_t *msgq, void *msg, void **ppUserData) errno = ENOMEM; return CPR_MSGQ_POST_FAILED; } - + pthread_mutex_lock(&msgq->mutex); - + /* * Fill in data */ @@ -598,26 +563,26 @@ cprPostMessage (cpr_msg_queue_t *msgq, void *msg, void **ppUserData) } else { node->pUserData = NULL; } - + /* * Push onto list */ node->prev = NULL; node->next = msgq->head; msgq->head = node; - + if (node->next) { node->next->prev = node; } - + if (msgq->tail == NULL) { msgq->tail = node; } msgq->currentCount++; - + pthread_cond_signal(&msgq->cond); pthread_mutex_unlock(&msgq->mutex); - + return CPR_MSGQ_POST_SUCCESS; } @@ -643,7 +608,7 @@ cprGetMessageQueueStats (cprMsgQueue_t msgQueue, cprMsgQueueStats_t *stats) sstrncpy(stats->name, msgq->name ? msgq->name : "undefined", sizeof(stats->name)); - + stats->extendedDepth = msgq->maxExtendedQDepth; stats->maxCount = msgq->maxCount; stats->currentCount = msgq->currentCount; diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.h b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.h index 9d1dac4ffe7f..b9cbf2be99e4 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.h +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_DARWIN_IPC_H_ #define _CPR_DARWIN_IPC_H_ @@ -91,7 +56,7 @@ cprShowMessageQueueStats(int32_t argc, const char *argv[]); /** * cprGetDepth - * + * * Get depth of a message queue */ uint16_t cprGetDepth(cprMsgQueue_t msgQueue); diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_locks.c b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_locks.c index 1dedb8c68d37..5ac0cb8e9ba5 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_locks.c +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_locks.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr.h" #include "cpr_stdlib.h" diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_locks.h b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_locks.h index 28b97d6b3dfb..440f09e7275e 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_locks.h +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_locks.h @@ -1,48 +1,12 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_DARWIN_LOCKS_H_ #define _CPR_DARWIN_LOCKS_H_ -/* - * System Mutexes. +/* + * System Mutexes. */ extern pthread_mutex_t linuxThreadMutex; #endif - diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_private.h b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_private.h index 91a688080fa6..887b58da4463 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_private.h +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_private.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_DARWIN_PRIVATE_H_ #define _CPR_DARWIN_PRIVATE_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_rand.h b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_rand.h index 0c209bd2e074..4a0c9cf6ff24 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_rand.h +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_rand.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_DARWIN_RAND_H_ #define _CPR_DARWIN_RAND_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_socket.c b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_socket.c index 52ee5f1107d4..1f47907ea0b5 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_socket.c +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_socket.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" @@ -55,8 +20,8 @@ const cpr_ip_addr_t ip_addr_invalid = {0}; -#define IN6ADDRSZ 16 -#define INT16SZ 2 +#define IN6ADDRSZ 16 +#define INT16SZ 2 #define INADDRSZ 4 #define MAX_RETRY_FOR_EAGAIN 10 @@ -81,7 +46,7 @@ static int cpr_inet_pton6(const char *src, uint8_t *dst); * @param[in] addr_len Points to a cpr_socklen_t structure which on specifies the length * of the supplied cpr_sockaddr_t structure. * - * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. + * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. * * @note The possible error values this function should return are * @li [CPR_EBADF] socket is not a valid socket descriptor. @@ -112,7 +77,7 @@ cprBind (cpr_socket_t soc, * * @param[in] soc - The socket that needs to be destroyed * - * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. + * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. * * @note The possible error values this function should return are * @li [CPR_EBADF] socket is not a valid socket descriptor. @@ -153,7 +118,7 @@ cprCloseSocket (cpr_socket_t soc) * @param[in] addr_len - Points to a cpr_socklen_t structure which specifies * the length of the supplied cpr_sockaddr_t structure. * - * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. + * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. * * @note The possible error values this function should return are * @li [CPR_EBADF] socket is not a valid socket descriptor. @@ -178,7 +143,7 @@ cprConnect (cpr_socket_t soc, cpr_status_e returnValue = CPR_FAILURE; if ( retval == 0 || (retval == -1 && errno == EISCONN)) { - returnValue = CPR_SUCCESS; + returnValue = CPR_SUCCESS; } return returnValue; @@ -202,7 +167,7 @@ cprConnect (cpr_socket_t soc, * @param[out] addr - A pointer to a cpr_sockaddr_t structure containing the peer address. * @param[out] addr_len - Points to a cpr_socklen_t structure which specifies * the length of the supplied cpr_sockaddr_t structure. - * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. + * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. * * @note If successful, the address argument shall point to the address of the socket * @note The possible error values this function should return are @@ -237,15 +202,15 @@ cprGetSockName (cpr_socket_t soc, * specified value. Implementations shall support values of backlog up to * SOMAXCONN. * If listen() is called with a backlog argument value that is less than zero - * (0), the function behaves as if it had been called with a backlog argument + * (0), the function behaves as if it had been called with a backlog argument * value of 0. A backlog argument of zero (0) may allow the socket to accept * connections, in which case the length of the listen queue may be set to an * implementation-defined minimum value. * - * @param[in] soc - Specifies the socket to get the peer address + * @param[in] soc - Specifies the socket to get the peer address * @param[in] backlog - The limit on the number of outstanding connections * - * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. + * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. * @note The possible error values this function should return are * @li [CPR_EBADF] The socket argument is not a valid file descriptor * @li [CPR_EINVAL] cprListen() has not been called on the socket descriptor. @@ -264,7 +229,7 @@ cprListen (cpr_socket_t soc, * * @brief The cprRecv() function shall receive a message from a socket. * - * This function is normally used with connected sockets because it does not permit + * This function is normally used with connected sockets because it does not permit * the application to retrieve the source address of received data. The cprRecv() * function shall return the length of the message written to the buffer pointed * to by the "buf" argument. @@ -425,26 +390,26 @@ cprRecvFrom (cpr_socket_t soc, * * @param[in] nfds Specifies the argument range of file descriptors to be tested. The * descriptors from zero through nfds-1 in the descriptor sets shall be examined. - * @param[in] read_fds If not a null pointer, this is a pointer to an fd_set object. + * @param[in] read_fds If not a null pointer, this is a pointer to an fd_set object. * @li On input this specifies the file descriptors to be checked for being ready to read. * @li On output this specifies the file descriptors that are ready to read. - * @param[in] write_fds If not a null pointer, this is a pointer to an fd_set object. - * @li On input this specifies the file descriptors to be checked for being ready to write. + * @param[in] write_fds If not a null pointer, this is a pointer to an fd_set object. + * @li On input this specifies the file descriptors to be checked for being ready to write. * @li On output this specifies the file descriptors that are ready to write. - * @param[in] except_fds If not a null pointer, this is a pointer to an fd_set object. - * @li On input this specifies the file descriptors to be checked for errors/exceptions pending. + * @param[in] except_fds If not a null pointer, this is a pointer to an fd_set object. + * @li On input this specifies the file descriptors to be checked for errors/exceptions pending. * @li On output this specifies the file descriptors that have errors/exceptions pending. - * @param[in] timeout If not a null pointer, this points to an object of type struct cpr_timeval - * that specifies the maximum time interval to wait for the selection to complete. - * If timeout expires, the function shall return. If the parameter is a null pointer, the function + * @param[in] timeout If not a null pointer, this points to an object of type struct cpr_timeval + * that specifies the maximum time interval to wait for the selection to complete. + * If timeout expires, the function shall return. If the parameter is a null pointer, the function * will block indefinitely until at least one file descriptor meets the criteria. * - * @note While this function supports multiple file descriptor types, only file descriptors referring to a + * @note While this function supports multiple file descriptor types, only file descriptors referring to a * socket are guaranteed to be supported. * @note Note that the "nfds" parameter is not used in Windows. * - * @return Upon successful completion, cprSelect() shall return the number of file descriptors ready. - * Otherwise, SOCKET_ERROR shall be returned and cpr_errno set to indicate the error where read_fds, + * @return Upon successful completion, cprSelect() shall return the number of file descriptors ready. + * Otherwise, SOCKET_ERROR shall be returned and cpr_errno set to indicate the error where read_fds, * write_fds and error_fds are not modified. * @note The possible error values this function should return are * @li [CPR_EBADF] The socket argument is not a valid file descriptor @@ -469,7 +434,7 @@ cprSelect (uint32_t nfds, t.tv_usec = timeout->tv_usec; t_p = &t; } else { - t_p = NULL; + t_p = NULL; } rc = (int16_t) select(nfds, read_fds, write_fds, except_fds, t_p); @@ -711,8 +676,8 @@ cprShutDown (cpr_socket_t soc, * * @brief The cprSocket() is the CPR wrapper for the "socket" API * - * The cprSocket() function shall create an unbound socket in a - * communications domain, and return a file descriptor that can be used + * The cprSocket() function shall create an unbound socket in a + * communications domain, and return a file descriptor that can be used * in later function calls that operate on sockets. * * @param[in] domain The communications domain, i.e. address family, in which a socket is to @@ -796,7 +761,7 @@ cpr_inet_pton (int af, const char *src, void *dst) /** - * Utility function that sets up the socket address + * Utility function that sets up the socket address * * @param[in] addr - socket fd to bind with the IPC address. * @param[in] name - pointer to the name of socket to bind to. diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_socket.h b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_socket.h index 68b95cc1ec3d..6a126d0fb952 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_socket.h +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_socket.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_DARWIN_SOCKET_H_ #define _CPR_DARWIN_SOCKET_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_stdio.c b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_stdio.c index a1d9cab86344..a708a611a84a 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_stdio.c +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_stdio.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_stdio.h" #include "cpr_string.h" @@ -118,12 +83,12 @@ buginf_msg (const char *str) printf("%s",buf); } while (len > LOG_MAX); - if (len) + if (len) { CSFLogDebug("cpr", "%s", (char *) p); } - } - else + } + else { CSFLogDebug("cpr", "%s", (char *) str); diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_stdio.h b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_stdio.h index 270b3e85c47d..d0a88e620016 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_stdio.h +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_stdio.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_DARWIN_STDIO_H_ #define _CPR_DARWIN_STDIO_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_string.c b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_string.c index 8cd3a6304563..8b9a7c21adbb 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_string.c +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_string.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" @@ -91,8 +56,8 @@ cpr_strdup (const char *str) * The cpr_strcasecmp performs case insensitive string comparison of the "s1" * and the "s2" strings. * - * @param[in] s1 - The first string - * @param[in] s2 - The second string + * @param[in] s1 - The first string + * @param[in] s2 - The second string * * @return integer <,=,> 0 depending on whether s1 is <,=,> s2 */ @@ -132,8 +97,8 @@ cpr_strcasecmp (const char *s1, const char *s2) * The cpr_strncasecmp performs case insensitive string comparison for specific * length "len". * - * @param[in] s1 - The first string - * @param[in] s2 - The second string + * @param[in] s1 - The first string + * @param[in] s2 - The second string * @param[in] len - The length to be compared * * @return integer <,=,> 0 depending on whether s1 is <,=,> s2 @@ -167,12 +132,12 @@ cpr_strncasecmp (const char *s1, const char *s2, size_t len) * * @brief The same as strstr, but ignores case * - * The strcasestr performs the strstr function, but ignores the case. - * This function shall locate the first occurrence in the string - * pointed to by s1 of the sequence of bytes (excluding the terminating + * The strcasestr performs the strstr function, but ignores the case. + * This function shall locate the first occurrence in the string + * pointed to by s1 of the sequence of bytes (excluding the terminating * null byte) in the string pointed to by s2. * - * @param[in] s1 - The input string + * @param[in] s1 - The input string * @param[in] s2 - The pattern to be matched * * @return A pointer to the first occurrence of string s2 found diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_string.h b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_string.h index 817268fe0869..6e545922878c 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_string.h +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_string.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_DARWIN_STRING_H_ #define _CPR_DARWIN_STRING_H_ @@ -57,7 +22,7 @@ * @return The duplicated string or NULL in case of no memory * */ -char * +char * cpr_strdup(const char *str); /** @@ -65,12 +30,12 @@ cpr_strdup(const char *str); * * @brief The same as strstr, but ignores case * - * The strcasestr performs the strstr function, but ignores the case. - * This function shall locate the first occurrence in the string - * pointed to by s1 of the sequence of bytes (excluding the terminating + * The strcasestr performs the strstr function, but ignores the case. + * This function shall locate the first occurrence in the string + * pointed to by s1 of the sequence of bytes (excluding the terminating * null byte) in the string pointed to by s2. * - * @param[in] s1 - The input string + * @param[in] s1 - The input string * @param[in] s2 - The pattern to be matched * * @return A pointer to the first occurrence of string s2 found diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_strings.h b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_strings.h index 9fb65dcc44ea..3dea7fdcc9f7 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_strings.h +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_strings.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_DARWIN_STRINGS_H_ #define _CPR_DARWIN_STRINGS_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_threads.c b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_threads.c index 9d6af89193ee..ac7ce8ac122a 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_threads.c +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_threads.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr.h" #include "cpr_stdlib.h" @@ -58,15 +23,15 @@ * current process. If the input parameter "name" is present, then this is used * for debugging purposes. The startRoutine is the address of the function where * the thread execution begins. The start routine prototype is defined as - * follows - * @code + * follows + * @code * int32_t (*cprThreadStartRoutine)(void* data) * @endcode * * @param[in] name - name of the thread created (optional) * @param[in] startRoutine - function where thread execution begins - * @param[in] stackSize - size of the thread's stack - * @param[in] priority - thread's execution priority + * @param[in] stackSize - size of the thread's stack + * @param[in] priority - thread's execution priority * @param[in] data - parameter to pass to startRoutine * * Return Value: Thread handle or NULL if creation failed. @@ -90,9 +55,9 @@ cprCreateThread (const char *name, threadPtr = (cpr_thread_t *)cpr_malloc(sizeof(cpr_thread_t)); if (threadPtr != NULL) { if (pthread_attr_init(&attr) != 0) { - + CPR_ERROR("%s - Failed to init attribute for thread %s\n", - fname, name); + fname, name); cpr_free(threadPtr); return (cprThread_t)NULL; } @@ -146,8 +111,8 @@ cprCreateThread (const char *name, * @param[in] thread - thread to destroy. * * @return CPR_SUCCESS or CPR_FAILURE. errno should be set for FAILURE case. - * - * @note In Linux there will never be a success indication as the + * + * @note In Linux there will never be a success indication as the * calling thread will have been terminated. */ cprRC_t @@ -184,9 +149,9 @@ cprDestroyThread (cprThread_t thread) * cprAdjustRelativeThreadPriority * * @brief The function sets the relative thread priority up or down by the given value. - * + * * This function is used pSIPCC to set up the thread priority. The values of the - * priority range from -20 (Maximum priority) to +19 (Minimum priority). + * priority range from -20 (Maximum priority) to +19 (Minimum priority). * * @param[in] relPri - nice value of the thread -20 is MAX and 19 is MIN * @@ -215,7 +180,7 @@ cprAdjustRelativeThreadPriority (int relPri) */ /** - * cprGetThreadId + * cprGetThreadId * * @brief Return the pthread ID for the given CPR thread. * diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_time.h b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_time.h index febf6f86ce3f..39318e8d65e6 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_time.h +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_time.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_DARWIN_TIME_H_ #define _CPR_DARWIN_TIME_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_timers.h b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_timers.h index 43bb485a7f07..0c8eefc1fbd3 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_timers.h +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_timers.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_DARWIN_TIMERS_H_ #define _CPR_DARWIN_TIMERS_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_timers_using_select.c b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_timers_using_select.c index 60c441f78c2a..4587307dd1c1 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_timers_using_select.c +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_timers_using_select.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * @@ -43,7 +8,7 @@ * @brief CPR layer for Timers. * * This file contains the Cisco Portable Runtime layer for non-blocking - * timers. This implementation is for the Linux operating system using + * timers. This implementation is for the Linux operating system using * select with a timeout. * * Timer Service runs in its own thread and blocks on select @@ -104,7 +69,7 @@ *-------------------------------------------------------------------------- */ -typedef struct timer_ipc_cmd_s +typedef struct timer_ipc_cmd_s { void * timer_ptr; void * user_data_ptr; @@ -115,7 +80,7 @@ typedef struct timer_ipc_cmd_s typedef struct timer_ipc_s { uint32_t msg_type; - union + union { timer_ipc_cmd_t cmd; cprRC_t result; @@ -211,7 +176,7 @@ static void send_api_result(cprRC_t result, struct sockaddr_un *addr, sockle */ /** - * cprSleep + * cprSleep * * @brief Suspend the calling thread * The cprSleep function blocks the calling thread for the indicated number of @@ -239,7 +204,7 @@ cprSleep (uint32_t duration) /** * @} */ - + /** * @defgroup TimerInternal The Timer internal functions * @ingroup Timers @@ -258,7 +223,7 @@ cprSleep (uint32_t duration) * @param[in] data - opaque data * @return - CPR_SUCCESS or CPR_FAILURE */ -static cprRC_t addTimerToList (cpr_timer_t *cprTimerPtr, uint32_t duration, void *data) +static cprRC_t addTimerToList (cpr_timer_t *cprTimerPtr, uint32_t duration, void *data) { // TODO(ekr@rtfm.com): Put this back in when you figure out why it causes crashes return CPR_SUCCESS; @@ -267,10 +232,10 @@ static cprRC_t addTimerToList (cpr_timer_t *cprTimerPtr, uint32_t duration, void static const char fname[] = "addTimerToList"; timer_ipc_t tmr_cmd = {0}; timer_ipc_t tmr_rsp={0}; - + API_ENTER(); - + CPR_INFO("%s: cprTimerptr=0x%x dur=%d user_data=%p\n", fname, cprTimerPtr, duration, data); tmr_cmd.msg_type = TMR_CMD_ADD; @@ -287,7 +252,7 @@ static cprRC_t addTimerToList (cpr_timer_t *cprTimerPtr, uint32_t duration, void strerror(errno), fname); API_RETURN(CPR_FAILURE); } - + } else { CPR_ERROR("can not make IPC connection, client_sock is invalid %s\n", fname); API_RETURN(CPR_FAILURE); @@ -338,7 +303,7 @@ static cprRC_t addTimer (cpr_timer_t *cprTimerPtr, uint32_t duration, void *data CPR_ERROR("%s - Timer %s has not been initialized.\n", fname, cprTimerPtr->name); errno = EINVAL; - + return(CPR_FAILURE); } @@ -347,7 +312,7 @@ static cprRC_t addTimer (cpr_timer_t *cprTimerPtr, uint32_t duration, void *data CPR_ERROR("%s - Timer %s is already active.\n", fname, cprTimerPtr->name); errno = EAGAIN; return(CPR_FAILURE); - + } /* Sanity tests passed, store the data the application passed in */ @@ -364,7 +329,7 @@ static cprRC_t addTimer (cpr_timer_t *cprTimerPtr, uint32_t duration, void *data * when the timer before them expires and when the newly * inserted timer expires. */ - + /* Check for insertion into an empty list */ if (timerListHead == NULL) { //CPR_INFO("no timer in the list case..\n"); @@ -374,7 +339,7 @@ static cprRC_t addTimer (cpr_timer_t *cprTimerPtr, uint32_t duration, void *data /* Insert timer into list */ timerList = timerListHead; while (timerList != NULL) { - + /* * If the duration on this new timer are less than the * timer in the list, insert this new timer before @@ -447,14 +412,14 @@ removeTimerFromList (cpr_timer_t *cprTimerPtr) static const char fname[] = "removeTimerFromList"; timer_ipc_t tmr_cmd = {0}; timer_ipc_t tmr_rsp = {0}; - + API_ENTER(); - - //CPR_INFO("%s:remove timer from list=0x%x\n",fname, cprTimerPtr); + + //CPR_INFO("%s:remove timer from list=0x%x\n",fname, cprTimerPtr); tmr_cmd.msg_type = TMR_CMD_REMOVE; tmr_cmd.u.cmd.timer_ptr = cprTimerPtr; - + //CPR_INFO("sending messge of type=%d\n", tmr_cmd.msg_type); /* simply post a request here to the timer service.. */ @@ -469,12 +434,12 @@ removeTimerFromList (cpr_timer_t *cprTimerPtr) CPR_ERROR("%s:client_sock invalid, no IPC connection \n", fname); API_RETURN(CPR_FAILURE); } - + /* * wait for the timer service to excute the request * so that we get result of operation */ - + if (recvfrom(client_sock, &tmr_rsp, sizeof(timer_ipc_t),0, NULL, NULL) < 0) { //CPR_INFO("error in recving the result error=%s\n", strerror(errno)); API_RETURN(CPR_FAILURE); @@ -505,7 +470,7 @@ removeTimer (cpr_timer_t *cprTimerPtr) timerBlk *timerPtr; //CPR_INFO("removing timer..0x%x\n", cprTimerPtr); - + /* * No need to sanitize the cprTimerPtr data as only * internal CPR functions call us and they have already @@ -515,7 +480,7 @@ removeTimer (cpr_timer_t *cprTimerPtr) */ timerPtr = (timerBlk *) cprTimerPtr->u.handlePtr; //CPR_INFO("%s: timer ptr=%x\n", fname, timerPtr); - + if (timerPtr != NULL) { /* Walk the list looking for this timer to cancel. */ timerList = timerListHead; @@ -558,9 +523,9 @@ removeTimer (cpr_timer_t *cprTimerPtr) timerList->duration = -1; timerList->timerActive = FALSE; cprTimerPtr->data = NULL; - + return(CPR_SUCCESS); - + } /* Walk the list */ @@ -582,16 +547,16 @@ removeTimer (cpr_timer_t *cprTimerPtr) timerPtr->duration = -1; timerPtr->cprTimerPtr->data = NULL; timerPtr->timerActive = FALSE; - + return(CPR_SUCCESS); - + } /* Bad application! */ CPR_ERROR("%s - Timer not initialized.\n", fname); errno = EINVAL; return(CPR_FAILURE); - + } /** @@ -605,12 +570,12 @@ removeTimer (cpr_timer_t *cprTimerPtr) * cprCreateTimer * * @brief Initialize a timer - * + * * The cprCreateTimer function is called to allow the OS to perform whatever * work is needed to create a timer. The input name parameter is optional. If present, CPR assigns * this name to the timer to assist in debugging. The callbackMsgQueue is the * address of a message queue created with cprCreateMsgQueue. This is the - * queue where the timer expire message will be sent. + * queue where the timer expire message will be sent. * So, when this timer expires a msg of type "applicationMsgId" will be sent to the msg queue * "callbackMsgQueue" indicating that timer applicationTimerId has expired. * @@ -683,7 +648,7 @@ cprCreateTimer (const char *name, timerPtr->cprTimerPtr = cprTimerPtr; cprTimerPtr->u.handlePtr = timerPtr; //CPR_INFO("cprTimerCreate: timer_t=%x blk=%x\n",cprTimerPtr, timerPtr); - + return cprTimerPtr; } @@ -762,7 +727,7 @@ cprIsTimerRunning (cprTimer_t timer) timerBlk *timerPtr; //CPR_INFO("istimerrunning(): timer=0x%x\n", timer); - + cprTimerPtr = (cpr_timer_t *) timer; if (cprTimerPtr != NULL) { timerPtr = (timerBlk *) cprTimerPtr->u.handlePtr; @@ -807,7 +772,7 @@ cprCancelTimer (cprTimer_t timer) cprRC_t rc = CPR_SUCCESS; //CPR_INFO("cprCancelTimer: timer ptr=%x\n", timer); - + cprTimerPtr = (cpr_timer_t *) timer; if (cprTimerPtr != NULL) { timerPtr = (timerBlk *) cprTimerPtr->u.handlePtr; @@ -885,9 +850,9 @@ cprUpdateTimer (cprTimer_t timer, uint32_t duration) /** * cprDestroyTimer * - * @brief Destroys a timer. + * @brief Destroys a timer. * - * This function will cancel the timer and then destroy it. It sets + * This function will cancel the timer and then destroy it. It sets * all links to NULL and then frees the timer block. * * @param[in] timer - which timer to destroy @@ -902,7 +867,7 @@ cprDestroyTimer (cprTimer_t timer) cprRC_t rc; //CPR_INFO("cprDestroyTimer:destroying timer=%x\n", timer); - + cprTimerPtr = (cpr_timer_t *) timer; if (cprTimerPtr != NULL) { rc = cprCancelTimer(timer); @@ -942,7 +907,7 @@ cprRC_t cpr_timer_pre_init (void) { static const char fname[] = "cpr_timer_pre_init"; int32_t returnCode; - + /* start the timer service first */ returnCode = (int32_t)pthread_create(&timerThreadId, NULL, timerThread, NULL); if (returnCode == -1) { @@ -955,7 +920,7 @@ cprRC_t cpr_timer_pre_init (void) * TBD:we should really implement wait on timerthread using condvar. */ cprSleep(1000); - + return CPR_SUCCESS; } @@ -972,8 +937,8 @@ cprRC_t cpr_timer_de_init(void) // close all sockets.. close(client_sock); close(serv_sock); - - + + // destroy api mutex pthread_mutex_destroy(&api_mutex); @@ -996,10 +961,10 @@ cprRC_t cpr_timer_de_init(void) * * @return This function eventually starts an infinite loop on a "select". */ -void *timerThread (void *data) +void *timerThread (void *data) { static const char fname[] = "timerThread"; - + //CPR_INFO("timerThread:started..\n"); #ifndef HOST #ifndef PTHREAD_SET_NAME @@ -1021,7 +986,7 @@ void *timerThread (void *data) if (start_timer_service_loop() == CPR_FAILURE) { CPR_ERROR("%s: timer service loop failed\n", fname); } - + return NULL; } @@ -1061,7 +1026,7 @@ static int select_sockets (void) FD_ZERO(&socks); FD_SET(serv_sock, &socks); - + return (serv_sock); } @@ -1079,29 +1044,29 @@ static cprRC_t read_timer_cmd () int rcvlen; timer_ipc_t tmr_cmd ={0}; cprRC_t ret = CPR_FAILURE; - - + + rcvlen =recvfrom(serv_sock, &tmr_cmd, sizeof(timer_ipc_t), 0, NULL, NULL); - + if (rcvlen > 0) { //CPR_INFO("got message type=%d\n", tmr_cmd.msg_type); switch(tmr_cmd.msg_type) { case TMR_CMD_ADD: - //CPR_INFO("request to add timer ptr=%x duration=%d datptr=%x\n", + //CPR_INFO("request to add timer ptr=%x duration=%d datptr=%x\n", // tmr_cmd.u.cmd.timer_ptr, tmr_cmd.u.cmd.duration, tmr_cmd.u.cmd.user_data_ptr); - + ret = addTimer((cpr_timer_t *)tmr_cmd.u.cmd.timer_ptr,tmr_cmd.u.cmd.duration, tmr_cmd.u.cmd.user_data_ptr); break; - + case TMR_CMD_REMOVE: //CPR_INFO("request to remove timer ptr=%x\n", tmr_cmd.u.cmd.timer_ptr); ret = removeTimer((cpr_timer_t *)tmr_cmd.u.cmd.timer_ptr); break; - + default: CPR_ERROR("%s:invalid ipc command = %d\n", tmr_cmd.msg_type); ret = CPR_FAILURE; @@ -1117,9 +1082,9 @@ static cprRC_t read_timer_cmd () /* send the result back */ send_api_result(ret, &tmr_client_addr, sizeof(tmr_client_addr)); - + return (ret); - + } /** @@ -1132,7 +1097,7 @@ void send_api_result(cprRC_t retVal, struct sockaddr_un *addr, socklen_t len) { static const char fname[] = "send_api_result"; timer_ipc_t tmr_rsp = {0}; - + tmr_rsp.msg_type = TMR_RESULT; tmr_rsp.u.result = retVal; if (sendto(serv_sock, &tmr_rsp, sizeof(timer_ipc_t),0, (struct sockaddr *)addr, len) < 0) { @@ -1161,11 +1126,11 @@ cprRC_t start_timer_service_loop (void) memset(&tmr_serv_addr, 0, sizeof(tmr_serv_addr)); tmr_serv_addr.sun_family = AF_UNIX; snprintf(tmr_serv_addr.sun_path, sizeof(tmr_serv_addr.sun_path), "%s_%d",SERVER_PATH, getpid()); - + memset(&tmr_client_addr, 0, sizeof(tmr_client_addr)); tmr_client_addr.sun_family = AF_UNIX; snprintf(tmr_client_addr.sun_path, sizeof(tmr_client_addr.sun_path), "%s_%d",CLIENT_PATH, getpid()); - + /* * init mutex and cond var. * these are used for making API synchronous etc.. @@ -1175,8 +1140,8 @@ cprRC_t start_timer_service_loop (void) strerror(errno)); return CPR_FAILURE; } - - + + /* open a unix datagram socket for client library */ client_sock = socket(AF_UNIX, SOCK_DGRAM, 0); if (client_sock == INVALID_SOCKET) { @@ -1220,7 +1185,7 @@ cprRC_t start_timer_service_loop (void) tv.tv_sec = (timerListHead->duration)/1000; tv.tv_usec = (timerListHead->duration%1000)*1000; //CPR_INFO("%s:time duration on head =%d sec:%d usec (or %d msec)\n", - // fname, tv.tv_sec, tv.tv_usec, + // fname, tv.tv_sec, tv.tv_usec, // timerListHead->duration); use_timeout = TRUE; } else { @@ -1230,7 +1195,7 @@ cprRC_t start_timer_service_loop (void) } ret = select(lsock + 1, &socks, NULL, NULL, (use_timeout == TRUE) ? &tv:NULL); - + if (ret == -1) { CPR_ERROR("%s:error in select err=%s\n", fname, strerror(errno)); @@ -1242,7 +1207,7 @@ cprRC_t start_timer_service_loop (void) timerListHead->duration = 0; process_expired_timers(); } else { - + if (FD_ISSET(serv_sock, &socks)) { //CPR_INFO("Got something on serv_sock..\n"); /* first reduce the duration of the head by current run time */ @@ -1252,7 +1217,7 @@ cprRC_t start_timer_service_loop (void) // timerListHead->duration); /* set the head with the remaining duration(tv) as indicated by select */ timerListHead->duration = tv.tv_sec * 1000 + (tv.tv_usec/1000); - } + } /* read the ipc message to remove or add a timer */ (void) read_timer_cmd(); } @@ -1264,7 +1229,7 @@ cprRC_t start_timer_service_loop (void) /** * * Process the timers expired. Generally this is called when head timer - * has expired. + * has expired. * @note we need to process the list as there could be * other timers too in the list which have expired. * @@ -1284,7 +1249,7 @@ void process_expired_timers() { if (timerListHead->duration > 0) { return; } - + /* There are one or more expired timers on the list */ processingTimers = TRUE; @@ -1301,7 +1266,7 @@ void process_expired_timers() { timerListHead->cprTimerPtr->name; //CPR_INFO("%s: timer %s expired..\n",fname, // timerMsg->expiredTimerName); - + timerMsg->expiredTimerId = timerListHead->cprTimerPtr->applicationTimerId; timerMsg->usrData = diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_tst.h b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_tst.h index 440e4ba75183..4f700b31819b 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_tst.h +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_tst.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_DARWIN_TST_H_ #define _CPR_DARWIN_TST_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_types.h b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_types.h index 718971b75758..1e72d9f3d5cb 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_types.h +++ b/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_types.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_DARWIN_TYPES_H_ #define _CPR_DARWIN_TYPES_H_ @@ -61,7 +26,7 @@ typedef uint8_t boolean; /* * Define min/max * defined in param.h - * + * * The GNU versions of the MAX and MIN macros do two things better than * the old versions: * 1. they are more optimal as they only evaluate a & b once by creating a diff --git a/media/webrtc/signaling/src/sipcc/cpr/include/cpr.h b/media/webrtc/signaling/src/sipcc/cpr/include/cpr.h index 748b80a2acb0..58951cccc048 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/include/cpr.h +++ b/media/webrtc/signaling/src/sipcc/cpr/include/cpr.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_H_ #define _CPR_H_ @@ -48,7 +13,7 @@ #include "cpr_debug.h" #include "cpr_memory.h" -__BEGIN_DECLS +__BEGIN_DECLS /* * Function prototypes for CPR init routines @@ -56,11 +21,11 @@ __BEGIN_DECLS /** * cprPreInit * - * @brief The cprPreInit function IS called from pSIPCC @b before any components are initialized. + * @brief The cprPreInit function IS called from pSIPCC @b before any components are initialized. * * This function @b SHOULD initialize those portions of the CPR that * are needed before applications can start using it. The memory subsystem - * (sandbox) is initialized from this routine. + * (sandbox) is initialized from this routine. * * * @return CPR_SUCCESS or CPR_FAILURE @@ -72,7 +37,7 @@ cprPreInit(void); /** * cprPostInit * - * @brief The cprPostInit function IS called from pSIPCC @b after all the components are initialized. + * @brief The cprPostInit function IS called from pSIPCC @b after all the components are initialized. * * This function @b SHOULD complete any CPR activities before the phone is * operational. In other words a call to this function will be the last line of @@ -87,7 +52,7 @@ cprPreInit(void); cprRC_t cprPostInit(void); -__END_DECLS +__END_DECLS #endif diff --git a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_assert.h b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_assert.h index cd869af4cd74..0f0f66014d62 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_assert.h +++ b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_assert.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_ASSERT_H_ #define _CPR_ASSERT_H_ @@ -67,7 +32,7 @@ __END_DECLS /* * This is outside the scope of the standard #ifdef <=> #endif header * file to allow a per-file definition. By default, cprAssert is not - * enabled. + * enabled. */ #undef cprAssert #define cprAssert(expr, rc) diff --git a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_debug.h b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_debug.h index 78b5f588f70b..87ef13c036e5 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_debug.h +++ b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_debug.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_DEBUG_H_ #define _CPR_DEBUG_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_errno.h b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_errno.h index 0099b408b2ac..a9f344362eb2 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_errno.h +++ b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_errno.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_ERRNO_H_ #define _CPR_ERRNO_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_in.h b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_in.h index 530ca6e2b47c..745c4f462d2e 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_in.h +++ b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_in.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_IN_H_ #define _CPR_IN_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_ipc.h b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_ipc.h index e930acb9c263..8bf62f4ae916 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_ipc.h +++ b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_ipc.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_IPC_H_ #define _CPR_IPC_H_ @@ -72,10 +37,10 @@ typedef void* cprMsgQueue_t; * perform whatever work is needed to create a message queue. * If the name is present, CPR should assign this name to the message queue to assist in - * debugging. The message queue depth is the second input parameter and is for - * setting the desired queue depth. This parameter may not be supported by all OS. + * debugging. The message queue depth is the second input parameter and is for + * setting the desired queue depth. This parameter may not be supported by all OS. * Its primary intention is to set queue depth beyond the default queue depth - * limitation. + * limitation. * On any OS where there is no limit on the message queue depth or * its queue depth is sufficiently large then this parameter is ignored on that * OS. @@ -102,8 +67,8 @@ cprCreateMessageQueue(const char *name, uint16_t depth); * The cprDestroyMessageQueue function is called to destroy a message queue. The * function drains any messages from the queue and the frees the * message queue. Any messages on the queue are to be deleted, and not sent to the intended - * recipient. It is the application's responsibility to ensure that no threads are - * blocked on a message queue when it is destroyed. + * recipient. It is the application's responsibility to ensure that no threads are + * blocked on a message queue when it is destroyed. * * @param[in] msgQueue - message queue to destroy * diff --git a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_locks.h b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_locks.h index d9a69a85bd1d..39de78b0d33a 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_locks.h +++ b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_locks.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_LOCKS_H_ #define _CPR_LOCKS_H_ @@ -54,7 +19,7 @@ typedef void* cprMutex_t; * Mutex information needed to hide OS differences in implementation. * To use mutexes, the application code may pass in a name to the * create function for mutexes. CPR does not use this field, it is - * solely for the convience of the application and to aid in debugging. + * solely for the convience of the application and to aid in debugging. * Upon an application calling the init routine, CPR will malloc the * memory for a mutex, set the handlePtr or handleInt as appropriate * and return a pointer to the mutex structure. @@ -144,7 +109,7 @@ typedef void* cprSignal_t; * Condition information needed to hide OS differences in implementation. * To use conditions, the application code may pass in a name to the * create function for mutexes. CPR does not use this field, it is - * solely for the convience of the application and to aid in debugging. + * solely for the convience of the application and to aid in debugging. * Upon an application calling the init routine, CPR will malloc the * memory for a condition, set the handlePtr or handleInt as appropriate * and return a pointer to the condition structure. diff --git a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_memory.h b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_memory.h index b11d89d028bc..c70647ef0dbb 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_memory.h +++ b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_memory.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_MEMORY_H_ #define _CPR_MEMORY_H_ @@ -45,7 +10,7 @@ #ifdef SIP_OS_WINDOWS #include "../win32/cpr_win_defines.h" #endif - + typedef void *cprBuffer_t; #endif diff --git a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_rand.h b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_rand.h index 4641df912e42..155aca64c359 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_rand.h +++ b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_rand.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_RAND_H_ #define _CPR_RAND_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_socket.h b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_socket.h index dfe8efc786fc..e561cb1e045d 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_socket.h +++ b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_socket.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_SOCKET_H_ #define _CPR_SOCKET_H_ @@ -125,7 +90,7 @@ typedef struct sockaddr_storage cpr_sockaddr_storage; // need uniform the defini * @param[in] addr_len Points to a cpr_socklen_t structure which on specifies the length * of the supplied cpr_sockaddr_t structure. * - * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. + * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. * * @note The possible error values this function should return are * @li [CPR_EBADF] socket is not a valid socket descriptor. @@ -150,7 +115,7 @@ cprBind(cpr_socket_t socket, * * @param[in] soc - The socket that needs to be destroyed * - * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. + * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. * * @note The possible error values this function should return are * @li [CPR_EBADF] socket is not a valid socket descriptor. @@ -188,7 +153,7 @@ cprCloseSocket(cpr_socket_t socket); * @param[in] addr_len - Points to a cpr_socklen_t structure which specifies * the length of the supplied cpr_sockaddr_t structure. * - * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. + * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. * * @note The possible error values this function should return are * @li [CPR_EBADF] socket is not a valid socket descriptor. @@ -216,7 +181,7 @@ cprConnect(cpr_socket_t socket, * @param[out] addr - A pointer to a cpr_sockaddr_t structure containing the peer address. * @param[out] addr_len - Points to a cpr_socklen_t structure which specifies * the length of the supplied cpr_sockaddr_t structure. - * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. + * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. * * @note If successful, the address argument shall point to the address of the socket * @note The possible error values this function should return are @@ -244,22 +209,22 @@ cprGetSockName(cpr_socket_t socket, * specified value. Implementations shall support values of backlog up to * SOMAXCONN. * If listen() is called with a backlog argument value that is less than zero - * (0), the function behaves as if it had been called with a backlog argument + * (0), the function behaves as if it had been called with a backlog argument * value of 0. A backlog argument of zero (0) may allow the socket to accept * connections, in which case the length of the listen queue may be set to an * implementation-defined minimum value. * - * @param[in] soc - Specifies the socket to get the peer address + * @param[in] soc - Specifies the socket to get the peer address * @param[in] backlog - The limit on the number of outstanding connections * - * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. + * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. * @note The possible error values this function should return are * @li [CPR_EBADF] The socket argument is not a valid file descriptor * @li [CPR_EINVAL] cprListen() has not been called on the socket descriptor. * @li [CPR_ENOTSOCK] The descriptor references a file, not a socket. * @li [CPR_EDESTADDRREQ] The socket is not bound to a local address */ -cpr_status_e +cpr_status_e cprListen(cpr_socket_t socket, uint16_t backlog); @@ -268,7 +233,7 @@ cprListen(cpr_socket_t socket, * * @brief The cprRecv() function shall receive a message from a socket. * - * This function is normally used with connected sockets because it does not permit + * This function is normally used with connected sockets because it does not permit * the application to retrieve the source address of received data. The cprRecv() * function shall return the length of the message written to the buffer pointed * to by the "buf" argument. @@ -402,12 +367,12 @@ cprRecvFrom(cpr_socket_t socket, * @param[in] nfds Specifies the argument range of file descriptors to be tested. The * descriptors from zero through nfds-1 in the descriptor sets shall be examined. * - * @param[in] read_fds If not a null pointer, this is a pointer to an fd_set object. + * @param[in] read_fds If not a null pointer, this is a pointer to an fd_set object. * @li On input this specifies the file descriptors to be checked for being ready to read. * @li On output this specifies the file descriptors that are ready to read. * - * @param[in] write_fds If not a null pointer, this is a pointer to an fd_set object. - * @li On input this specifies the file descriptors to be checked for being ready to write. + * @param[in] write_fds If not a null pointer, this is a pointer to an fd_set object. + * @li On input this specifies the file descriptors to be checked for being ready to write. * @li On output this specifies the file descriptors that are ready to write. * * @note If you specify a non-NULL value for write_fds then note that this function will @@ -417,21 +382,21 @@ cprRecvFrom(cpr_socket_t socket, * out if the socket was generally available for a write operation. You should really * only check for writability when you know you have something to write to a socket. * - * @param[in] except_fds If not a null pointer, this is a pointer to an fd_set object. - * @li On input this specifies the file descriptors to be checked for errors/exceptions pending. + * @param[in] except_fds If not a null pointer, this is a pointer to an fd_set object. + * @li On input this specifies the file descriptors to be checked for errors/exceptions pending. * @li On output this specifies the file descriptors that have errors/exceptions pending. * - * @param[in] timeout If not a null pointer, this points to an object of type struct cpr_timeval - * that specifies the maximum time interval to wait for the selection to complete. - * If timeout expires, the function shall return. If the parameter is a null pointer, the function + * @param[in] timeout If not a null pointer, this points to an object of type struct cpr_timeval + * that specifies the maximum time interval to wait for the selection to complete. + * If timeout expires, the function shall return. If the parameter is a null pointer, the function * will block indefinitely until at least one file descriptor meets the criteria. * - * @note While this function supports multiple file descriptor types, only file descriptors referring to a + * @note While this function supports multiple file descriptor types, only file descriptors referring to a * socket are guaranteed to be supported. * @note Note that the "nfds" parameter is not used in Windows. * - * @return Upon successful completion, cprSelect() shall return the number of file descriptors ready. - * Otherwise, SOCKET_ERROR shall be returned and cpr_errno set to indicate the error where read_fds, + * @return Upon successful completion, cprSelect() shall return the number of file descriptors ready. + * Otherwise, SOCKET_ERROR shall be returned and cpr_errno set to indicate the error where read_fds, * write_fds and error_fds are not modified. * * The possible error values this function should return are @@ -673,8 +638,8 @@ cprSetSockNonBlock(cpr_socket_t socket); * * @brief The cprSocket() is the CPR wrapper for the "socket" API * - * The cprSocket() function shall create an unbound socket in a - * communications domain, and return a file descriptor that can be used + * The cprSocket() function shall create an unbound socket in a + * communications domain, and return a file descriptor that can be used * in later function calls that operate on sockets. * * @param[in] domain The communications domain, i.e. address family, in which a socket is to diff --git a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_stddef.h b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_stddef.h index 60cc5b935da9..8f63dc5c3a6d 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_stddef.h +++ b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_stddef.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_STDDEF_H_ #define _CPR_STDDEF_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_stdio.h b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_stdio.h index 3e2aad99da10..73d6cfcc3e60 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_stdio.h +++ b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_stdio.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_STDIO_H_ #define _CPR_STDIO_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_stdlib.h b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_stdlib.h index 44d110d73e8f..65e4c5558fa7 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_stdlib.h +++ b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_stdlib.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_STDLIB_H_ #define _CPR_STDLIB_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_string.h b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_string.h index cbc61a54f184..3b981b08971e 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_string.h +++ b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_string.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_STRING_H_ #define _CPR_STRING_H_ @@ -79,7 +44,7 @@ sstrncpy(char *dst, const char *src, unsigned long max); /** * sstrncat - * + * * @brief The CPR wrapper for strncat * * This is Cisco's *safe* version of strncat. The string will always @@ -98,6 +63,54 @@ sstrncpy(char *dst, const char *src, unsigned long max); char * sstrncat(char *s1, const char *s2, unsigned long max); +/* + * flex_string + */ +#define FLEX_STRING_CHUNK_SIZE 256 + +typedef struct { + char *buffer; + size_t buffer_length; + size_t string_length; +} flex_string; + +/* + * flex_string_init + * + * Not thread-safe + */ +void flex_string_init(flex_string *fs); + +/* + * flex_string_free + * + * Not thread-safe + */ +void flex_string_free(flex_string *fs); + +/* + * flex_string_check_alloc + * + * Allocate enough chunks to hold the new minimum size. + * + * Not thread-safe + */ +void flex_string_check_alloc(flex_string *fs, size_t new_min_length); + +/* + * flex_string_append + * + * Not thread-safe + */ +void flex_string_append(flex_string *fs, const char *more); + +/* + * flex_string_sprintf + * + * Not thread-safe + */ +void flex_string_sprintf(flex_string *fs, const char *format, ...); + __END_DECLS #endif diff --git a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_strings.h b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_strings.h index 6f82db260931..c960521e4527 100755 --- a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_strings.h +++ b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_strings.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_STRINGS_H_ #define _CPR_STRINGS_H_ @@ -66,8 +31,8 @@ __BEGIN_DECLS * The cpr_strcasecmp performs case insensitive string comparison of the "s1" * and the "s2" strings. * - * @param[in] s1 - The first string - * @param[in] s2 - The second string + * @param[in] s1 - The first string + * @param[in] s2 - The second string * * @return integer <,=,> 0 depending on whether s1 is <,=,> s2 */ @@ -81,8 +46,8 @@ int cpr_strcasecmp(const char *s1, const char *s2); * The cpr_strncasecmp performs case insensitive string comparison for specific * length "len". * - * @param[in] s1 - The first string - * @param[in] s2 - The second string + * @param[in] s1 - The first string + * @param[in] s2 - The second string * @param[in] len - The length to be compared * * @return integer <,=,> 0 depending on whether s1 is <,=,> s2 diff --git a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_threads.h b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_threads.h index 97c6635cc9cc..a13adfc8924a 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_threads.h +++ b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_threads.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_THREADS_H_ #define _CPR_THREADS_H_ @@ -70,7 +35,7 @@ typedef struct { } cpr_thread_t; /** - * Thread start routine signature + * Thread start routine signature */ typedef void *(*cprThreadStartRoutine)(void *data); @@ -85,8 +50,8 @@ typedef void *(*cprThreadStartRoutine)(void *data); * current process. If the input parameter "name" is present, then this is used * for debugging purposes. The startRoutine is the address of the function where * the thread execution begins. The start routine prototype is defined as - * follows - * @code + * follows + * @code * int32_t (*cprThreadStartRoutine)(void* data) * @endcode * @@ -116,8 +81,8 @@ cprThread_t cprCreateThread(const char *name, * @param[in] thread - thread to destroy. * * @return CPR_SUCCESS or CPR_FAILURE. errno should be set for FAILURE case. - * - * @note In Linux there will never be a success indication as the + * + * @note In Linux there will never be a success indication as the * calling thread will have been terminated. */ cprRC_t cprDestroyThread(cprThread_t thread); diff --git a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_time.h b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_time.h index 66e13b217070..4b0fb9b2c632 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_time.h +++ b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_time.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_TIME_H_ #define _CPR_TIME_H_ @@ -52,8 +17,8 @@ __BEGIN_DECLS #include "../darwin/cpr_darwin_time.h" #endif -/** - * The generic "time" value strucutre +/** + * The generic "time" value strucutre */ struct cpr_timeval { diff --git a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_timers.h b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_timers.h index f57b52f0f0a7..56e884a6c53a 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_timers.h +++ b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_timers.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_TIMERS_H_ #define _CPR_TIMERS_H_ @@ -60,7 +25,7 @@ typedef void *cprTimer_t; * and return a pointer to the timer structure. */ -/** +/** * Information CPR needs to send back to the application * when a timer expires. */ @@ -74,7 +39,7 @@ typedef struct { /* Function prototypes */ /** - * cprSleep + * cprSleep * * @brief Suspend the calling thread * The cprSleep function blocks the calling thread for the indicated number of @@ -91,12 +56,12 @@ void cprSleep(uint32_t duration); * cprCreateTimer * * @brief Initialize a timer - * + * * The cprCreateTimer function is called to allow the OS to perform whatever * work is needed to create a timer. The input name parameter is optional. If present, CPR assigns * this name to the timer to assist in debugging. The callbackMsgQueue is the * address of a message queue created with cprCreateMsgQueue. This is the - * queue where the timer expire message will be sent. + * queue where the timer expire message will be sent. * So, when this timer expires a msg of type "applicationMsgId" will be sent to the msg queue * "callbackMsgQueue" indicating that timer applicationTimerId has expired. * @@ -152,9 +117,9 @@ boolean cprIsTimerRunning(cprTimer_t timer); /** * cprDestroyTimer * - * @brief Destroys a timer. + * @brief Destroys a timer. * - * This function will cancel the timer and then destroy it. It sets + * This function will cancel the timer and then destroy it. It sets * all links to NULL and then frees the timer block. * * @param[in] timer - which timer to destroy diff --git a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_types.h b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_types.h index 332625e2560b..33f1707e32a2 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/include/cpr_types.h +++ b/media/webrtc/signaling/src/sipcc/cpr/include/cpr_types.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_TYPES_H_ #define _CPR_TYPES_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_align.h b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_align.h index d8ca79ff1e78..50a63b23ac8e 100755 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_align.h +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_align.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef __CPR_LINUX_ALIGN_H__ #define __CPR_LINUX_ALIGN_H__ @@ -54,12 +19,12 @@ #define ALIGN_MASK(alignment) (~((alignment) - 1)) /* - * Macro to set the minimum alignment + * Macro to set the minimum alignment */ #define ALIGN_MIN(align,align_min) (((align) > (align_min)) ? (align) : (align_min)) /* - * Macro to round up or down "val" to be a multiple of "align", assuming + * Macro to round up or down "val" to be a multiple of "align", assuming * "align" is a power of 2. if "align" is zero then no action will * be performed */ diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_assert.h b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_assert.h index c110f7320ed3..aba13d09c77a 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_assert.h +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_assert.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_LINUX_ASSERT_H_ #define _CPR_LINUX_ASSERT_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_errno.c b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_errno.c index fee74f0a5dc4..3a593de2bdd8 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_errno.c +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_errno.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_errno.h" #include @@ -186,8 +151,8 @@ static int8_t errno_table[] = * * @brief Translates to "cpr_errno" Macro * - * pSIPCC uses the cpr_errno macro to print the errno - * for error conditions. This function is used to map the standard + * pSIPCC uses the cpr_errno macro to print the errno + * for error conditions. This function is used to map the standard * errno to standard CPR errors * * @return The CPR error number diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_errno.h b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_errno.h index 0daaed3702ab..213cb022c433 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_errno.h +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_errno.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_LINUX_ERRNO_H_ #define _CPR_LINUX_ERRNO_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_in.h b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_in.h index 2b3d6c377fea..4bcd21f7b7a2 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_in.h +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_in.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_LINUX_IN_H_ #define _CPR_LINUX_IN_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_init.c b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_init.c index ed541ae1a4e3..00b1a327a917 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_init.c +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_init.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * @section intro_sec Introduction @@ -64,8 +29,8 @@ * @li Debug/Logging Abstraction * * @section file_list EXTERNAL APIS - * The External APIs that need to be exposed by CPR to the pSIPCC application are - * defined in the following header files. The documentation within + * The External APIs that need to be exposed by CPR to the pSIPCC application are + * defined in the following header files. The documentation within * each header file lists the functions/macros that @b NEED to be defined for * pSIPCC to work correctly. Example functions (and an implementation for * Linux) is available for most functions defined in these headers. Look under @@ -85,7 +50,7 @@ * @li cpr_stddef.h * @li cpr_time.h * @li cpr_types.h - * + * * The function prototypes in these header files are implemented in the * binaries related to memory and string functionality. The prototypes are * given so that vendors can use these functions for implementation of other @@ -131,7 +96,7 @@ * * @file cpr_linux_init.c * @brief This file contains CPR initialization routines - * + * * DESCRIPTION * Initialization routine for the Cisco Portable Runtime layer * running in the Linux operating System. @@ -141,7 +106,7 @@ * @addtogroup Initialization The initialization module * @ingroup CPR * @brief The intialization module consists of APIs used to initialize or destroy the CPR layer by pSipCC - * + * * @{ */ #include "cpr.h" @@ -157,12 +122,12 @@ #include "plat_debug.h" /** - * Mutex to manage message queue list. + * Mutex to manage message queue list. */ extern pthread_mutex_t msgQueueListMutex; /** - * Boolean to check that cprPreInit been called + * Boolean to check that cprPreInit been called */ static boolean pre_init_called = FALSE; @@ -179,11 +144,11 @@ int32_t cprInfo = TRUE; /** * cprPreInit * - * @brief The cprPreInit function IS called from pSIPCC @b before any components are initialized. + * @brief The cprPreInit function IS called from pSIPCC @b before any components are initialized. * * This function @b SHOULD initialize those portions of the CPR that * are needed before applications can start using it. The memory subsystem - * (sandbox) is initialized from this routine. + * (sandbox) is initialized from this routine. * * * @return CPR_SUCCESS or CPR_FAILURE @@ -216,7 +181,7 @@ cprPreInit (void) CPR_ERROR("%s: timer pre init failed %d\n", fname, returnCode); return CPR_FAILURE; } - + return CPR_SUCCESS; } @@ -225,7 +190,7 @@ cprPreInit (void) /** * cprPostInit * - * @brief The cprPostInit function IS called from pSIPCC @b after all the components are initialized. + * @brief The cprPostInit function IS called from pSIPCC @b after all the components are initialized. * * This function @b SHOULD complete any CPR activities before the phone is * operational. In other words a call to this function will be the last line of diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_ipc.c b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_ipc.c index 0b7e00470f3e..42a0b45d1a9c 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_ipc.c +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_ipc.c @@ -1,44 +1,9 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** - * @brief CPR layer for interprocess communication + * @brief CPR layer for interprocess communication * * The name of this file may be overly broad, rather this file deals * with IPC via message queues. A user may create, destroy and @@ -48,7 +13,7 @@ * The send/get APIs attempt to reliably deliver messages even when * under stress. Two mechanisms have been added to deal with a full * message queue. First, the message queue size may be extended to - * allow more messages to be handled than supported by an OS. + * allow more messages to be handled than supported by an OS. * Second, if the queue is indeed full a sleep-and-retry * method is used to force a context-switch to allow for other threads * to run in hope of clearing some messages off of the queue. The @@ -78,7 +43,7 @@ #define STATIC static /* @def The Message Queue depth */ -#define OS_MSGTQL 31 +#define OS_MSGTQL 31 /* * Internal CPR API @@ -194,7 +159,7 @@ static const char unnamed_string[] = "unnamed"; * will sleep the timeout interval to allow the msg queue to be * drained. * - * Note: 25 attempts for upto .5 seconds at the interval of + * Note: 25 attempts for upto .5 seconds at the interval of * CPR_SND_TIMEOUT_WAIT_INTERVAL worst case. */ #define CPR_ATTEMPTS_TO_SEND 25 @@ -233,10 +198,10 @@ cprMoveMsgToQueue(cpr_msg_queue_t *msgq); * perform whatever work is needed to create a message queue. * If the name is present, CPR should assign this name to the message queue to assist in - * debugging. The message queue depth is the second input parameter and is for - * setting the desired queue depth. This parameter may not be supported by all OS. + * debugging. The message queue depth is the second input parameter and is for + * setting the desired queue depth. This parameter may not be supported by all OS. * Its primary intention is to set queue depth beyond the default queue depth - * limitation. + * limitation. * On any OS where there is no limit on the message queue depth or * its queue depth is sufficiently large then this parameter is ignored on that * OS. @@ -276,7 +241,7 @@ cprCreateMessageQueue (const char *name, uint16_t depth) */ key = ftok("/proc/self", key_id++); printf("key = %x\n", key); - + if (key == -1) { CPR_ERROR("%s: Key generation failed: %d\n", fname, errno); cpr_free(msgq); @@ -293,32 +258,32 @@ cprCreateMessageQueue (const char *name, uint16_t depth) /* Remove message queue */ msgq->queueId = msgget(key, (IPC_CREAT | 0666)); if (msgctl(msgq->queueId, IPC_RMID, &buf) == -1) { - + CPR_ERROR("%s: Destruction failed: %s: %d\n", fname, msgq->name, errno); - + return NULL; } msgq->queueId = msgget(key, (IPC_CREAT | 0666)); } } else { printf("there was no preexisting q..\n"); - + } - - - + + + if (msgq->queueId == -1) { CPR_ERROR("%s: Creation failed: %s: %d\n", fname, name, errno); if (errno == EEXIST) { - + } - + cpr_free(msgq); return NULL; } printf("create message q with id=%x\n", msgq->queueId); - + /* flush the q before ?? */ /* @@ -368,8 +333,8 @@ cprCreateMessageQueue (const char *name, uint16_t depth) * The cprDestroyMessageQueue function is called to destroy a message queue. The * function drains any messages from the queue and the frees the * message queue. Any messages on the queue are to be deleted, and not sent to the intended - * recipient. It is the application's responsibility to ensure that no threads are - * blocked on a message queue when it is destroyed. + * recipient. It is the application's responsibility to ensure that no threads are + * blocked on a message queue when it is destroyed. * * @param[in] msgQueue - message queue to destroy * @@ -383,7 +348,7 @@ cprDestroyMessageQueue (cprMsgQueue_t msgQueue) void *msg; struct msqid_ds buf; printf("Destroy message Q called..\n"); - + msgq = (cpr_msg_queue_t *) msgQueue; if (msgq == NULL) { @@ -612,7 +577,7 @@ cprSendMessage (cprMsgQueue_t msgQueue, void *msg, void **ppUserData) msgq = (cpr_msg_queue_t *) msgQueue; - /* + /* * Attempt to send message */ do { @@ -949,7 +914,7 @@ cprMoveMsgToQueue (cpr_msg_queue_t *msgq) /** * @} - * + * * @addtogroup MsgQIPCAPIs The Message Queue IPC APIs * @{ */ diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_ipc.h b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_ipc.h index 30155c735d64..b4cf254af8bc 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_ipc.h +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_ipc.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_CNU_IPC_H_ #define _CPR_CNU_IPC_H_ @@ -83,7 +48,7 @@ extern pthread_mutex_t msgQueueListMutex; /** * cprGetDepth - * + * * Get depth of a message queue */ uint16_t cprGetDepth(cprMsgQueue_t msgQueue); diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_locks.c b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_locks.c index 877f263e3d24..b945d1cd2210 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_locks.c +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_locks.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr.h" #include "cpr_stdlib.h" diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_locks.h b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_locks.h index 6849f83ebaf4..ef6e2a9a7693 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_locks.h +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_locks.h @@ -1,47 +1,12 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_LINUX_LOCKS_H_ #define _CPR_LINUX_LOCKS_H_ -/* - * System Mutexes. +/* + * System Mutexes. */ extern pthread_mutex_t linuxThreadMutex; #endif diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_private.h b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_private.h index 5dea9c2988a6..985cf04d1c1e 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_private.h +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_private.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_LINUX_PRIVATE_H_ #define _CPR_LINUX_PRIVATE_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_rand.h b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_rand.h index 53511685c4fd..8fa8b07a267e 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_rand.h +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_rand.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_LINUX_RAND_H_ #define _CPR_LINUX_RAND_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_socket.c b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_socket.c index 758507712d27..0259fa2710f2 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_socket.c +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_socket.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdio.h" @@ -55,8 +20,8 @@ //const cpr_in6_addr_t in6addr_any = IN6ADDR_ANY_INIT; const cpr_ip_addr_t ip_addr_invalid = {0}; -#define IN6ADDRSZ 16 -#define INT16SZ 2 +#define IN6ADDRSZ 16 +#define INT16SZ 2 #define INADDRSZ 4 #define MAX_RETRY_FOR_EAGAIN 10 @@ -81,7 +46,7 @@ static int cpr_inet_pton6(const char *src, uint8_t *dst); * @param[in] addr_len Points to a cpr_socklen_t structure which on specifies the length * of the supplied cpr_sockaddr_t structure. * - * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. + * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. * * @note The possible error values this function should return are * @li [CPR_EBADF] socket is not a valid socket descriptor. @@ -112,7 +77,7 @@ cprBind (cpr_socket_t soc, * * @param[in] soc - The socket that needs to be destroyed * - * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. + * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. * * @note The possible error values this function should return are * @li [CPR_EBADF] socket is not a valid socket descriptor. @@ -153,7 +118,7 @@ cprCloseSocket (cpr_socket_t soc) * @param[in] addr_len - Points to a cpr_socklen_t structure which specifies * the length of the supplied cpr_sockaddr_t structure. * - * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. + * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. * * @note The possible error values this function should return are * @li [CPR_EBADF] socket is not a valid socket descriptor. @@ -196,7 +161,7 @@ cprConnect (cpr_socket_t soc, * @param[out] addr - A pointer to a cpr_sockaddr_t structure containing the peer address. * @param[out] addr_len - Points to a cpr_socklen_t structure which specifies * the length of the supplied cpr_sockaddr_t structure. - * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. + * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. * * @note If successful, the address argument shall point to the address of the socket * @note The possible error values this function should return are @@ -231,15 +196,15 @@ cprGetSockName (cpr_socket_t soc, * specified value. Implementations shall support values of backlog up to * SOMAXCONN. * If listen() is called with a backlog argument value that is less than zero - * (0), the function behaves as if it had been called with a backlog argument + * (0), the function behaves as if it had been called with a backlog argument * value of 0. A backlog argument of zero (0) may allow the socket to accept * connections, in which case the length of the listen queue may be set to an * implementation-defined minimum value. * - * @param[in] soc - Specifies the socket to get the peer address + * @param[in] soc - Specifies the socket to get the peer address * @param[in] backlog - The limit on the number of outstanding connections * - * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. + * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. * @note The possible error values this function should return are * @li [CPR_EBADF] The socket argument is not a valid file descriptor * @li [CPR_EINVAL] cprListen() has not been called on the socket descriptor. @@ -258,7 +223,7 @@ cprListen (cpr_socket_t soc, * * @brief The cprRecv() function shall receive a message from a socket. * - * This function is normally used with connected sockets because it does not permit + * This function is normally used with connected sockets because it does not permit * the application to retrieve the source address of received data. The cprRecv() * function shall return the length of the message written to the buffer pointed * to by the "buf" argument. @@ -419,26 +384,26 @@ cprRecvFrom (cpr_socket_t soc, * * @param[in] nfds Specifies the argument range of file descriptors to be tested. The * descriptors from zero through nfds-1 in the descriptor sets shall be examined. - * @param[in] read_fds If not a null pointer, this is a pointer to an fd_set object. + * @param[in] read_fds If not a null pointer, this is a pointer to an fd_set object. * @li On input this specifies the file descriptors to be checked for being ready to read. * @li On output this specifies the file descriptors that are ready to read. - * @param[in] write_fds If not a null pointer, this is a pointer to an fd_set object. - * @li On input this specifies the file descriptors to be checked for being ready to write. + * @param[in] write_fds If not a null pointer, this is a pointer to an fd_set object. + * @li On input this specifies the file descriptors to be checked for being ready to write. * @li On output this specifies the file descriptors that are ready to write. - * @param[in] except_fds If not a null pointer, this is a pointer to an fd_set object. - * @li On input this specifies the file descriptors to be checked for errors/exceptions pending. + * @param[in] except_fds If not a null pointer, this is a pointer to an fd_set object. + * @li On input this specifies the file descriptors to be checked for errors/exceptions pending. * @li On output this specifies the file descriptors that have errors/exceptions pending. - * @param[in] timeout If not a null pointer, this points to an object of type struct cpr_timeval - * that specifies the maximum time interval to wait for the selection to complete. - * If timeout expires, the function shall return. If the parameter is a null pointer, the function + * @param[in] timeout If not a null pointer, this points to an object of type struct cpr_timeval + * that specifies the maximum time interval to wait for the selection to complete. + * If timeout expires, the function shall return. If the parameter is a null pointer, the function * will block indefinitely until at least one file descriptor meets the criteria. * - * @note While this function supports multiple file descriptor types, only file descriptors referring to a + * @note While this function supports multiple file descriptor types, only file descriptors referring to a * socket are guaranteed to be supported. * @note Note that the "nfds" parameter is not used in Windows. * - * @return Upon successful completion, cprSelect() shall return the number of file descriptors ready. - * Otherwise, SOCKET_ERROR shall be returned and cpr_errno set to indicate the error where read_fds, + * @return Upon successful completion, cprSelect() shall return the number of file descriptors ready. + * Otherwise, SOCKET_ERROR shall be returned and cpr_errno set to indicate the error where read_fds, * write_fds and error_fds are not modified. * @note The possible error values this function should return are * @li [CPR_EBADF] The socket argument is not a valid file descriptor @@ -463,7 +428,7 @@ cprSelect (uint32_t nfds, t.tv_usec = timeout->tv_usec; t_p = &t; } else { - t_p = NULL; + t_p = NULL; } rc = (int16_t) select(nfds, read_fds, write_fds, except_fds, t_p); @@ -685,8 +650,8 @@ cprSetSockNonBlock (cpr_socket_t soc) * * @brief The cprSocket() is the CPR wrapper for the "socket" API * - * The cprSocket() function shall create an unbound socket in a - * communications domain, and return a file descriptor that can be used + * The cprSocket() function shall create an unbound socket in a + * communications domain, and return a file descriptor that can be used * in later function calls that operate on sockets. * * @param[in] domain The communications domain, i.e. address family, in which a socket is to @@ -770,7 +735,7 @@ cpr_inet_pton (int af, const char *src, void *dst) /** - * Utility function that sets up the socket address, using + * Utility function that sets up the socket address, using * the name and the pid to guarantee uniqueness * * @param[in] addr - socket fd to bind with the IPC address. diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_socket.h b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_socket.h index 00da940e6cf5..7cc7877386c9 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_socket.h +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_socket.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_LINUX_SOCKET_H_ #define _CPR_LINUX_SOCKET_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_stdio.c b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_stdio.c index 264beb7420e8..48b101bbca3d 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_stdio.c +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_stdio.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_stdio.h" #include "cpr_string.h" diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_stdio.h b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_stdio.h index fc241b73b0dd..72cf1e96c0f8 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_stdio.h +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_stdio.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_LINUX_STDIO_H_ #define _CPR_LINUX_STDIO_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_string.c b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_string.c index 1c7aef972c85..099fc735cd0f 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_string.c +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_string.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_stdlib.h" @@ -90,8 +55,8 @@ cpr_strdup (const char *str) * The cpr_strcasecmp performs case insensitive string comparison of the "s1" * and the "s2" strings. * - * @param[in] s1 - The first string - * @param[in] s2 - The second string + * @param[in] s1 - The first string + * @param[in] s2 - The second string * * @return integer <,=,> 0 depending on whether s1 is <,=,> s2 */ @@ -131,8 +96,8 @@ cpr_strcasecmp (const char *s1, const char *s2) * The cpr_strncasecmp performs case insensitive string comparison for specific * length "len". * - * @param[in] s1 - The first string - * @param[in] s2 - The second string + * @param[in] s1 - The first string + * @param[in] s2 - The second string * @param[in] len - The length to be compared * * @return integer <,=,> 0 depending on whether s1 is <,=,> s2 @@ -166,12 +131,12 @@ cpr_strncasecmp (const char *s1, const char *s2, size_t len) * * @brief The same as strstr, but ignores case * - * The strcasestr performs the strstr function, but ignores the case. - * This function shall locate the first occurrence in the string - * pointed to by s1 of the sequence of bytes (excluding the terminating + * The strcasestr performs the strstr function, but ignores the case. + * This function shall locate the first occurrence in the string + * pointed to by s1 of the sequence of bytes (excluding the terminating * null byte) in the string pointed to by s2. * - * @param[in] s1 - The input string + * @param[in] s1 - The input string * @param[in] s2 - The pattern to be matched * * @return A pointer to the first occurrence of string s2 found diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_string.h b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_string.h index d066758f12ba..78f8e9c29377 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_string.h +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_string.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_LINUX_STRING_H_ #define _CPR_LINUX_STRING_H_ @@ -57,7 +22,7 @@ * @return The duplicated string or NULL in case of no memory * */ -char * +char * cpr_strdup(const char *str); diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_strings.h b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_strings.h index f0456c018a68..69ffc1ab6f62 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_strings.h +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_strings.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_LINUX_STRINGS_H_ #define _CPR_LINUX_STRINGS_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_threads.c b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_threads.c index 04212a2e2b48..36d0844adbc5 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_threads.c +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_threads.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr.h" #include "cpr_stdlib.h" @@ -58,15 +23,15 @@ * current process. If the input parameter "name" is present, then this is used * for debugging purposes. The startRoutine is the address of the function where * the thread execution begins. The start routine prototype is defined as - * follows - * @code + * follows + * @code * int32_t (*cprThreadStartRoutine)(void* data) * @endcode * * @param[in] name - name of the thread created (optional) * @param[in] startRoutine - function where thread execution begins - * @param[in] stackSize - size of the thread's stack - * @param[in] priority - thread's execution priority + * @param[in] stackSize - size of the thread's stack + * @param[in] priority - thread's execution priority * @param[in] data - parameter to pass to startRoutine * * Return Value: Thread handle or NULL if creation failed. @@ -90,9 +55,9 @@ cprCreateThread (const char *name, threadPtr = (cpr_thread_t *)cpr_malloc(sizeof(cpr_thread_t)); if (threadPtr != NULL) { if (pthread_attr_init(&attr) != 0) { - + CPR_ERROR("%s - Failed to init attribute for thread %s\n", - fname, name); + fname, name); cpr_free(threadPtr); return (cprThread_t)NULL; } @@ -146,8 +111,8 @@ cprCreateThread (const char *name, * @param[in] thread - thread to destroy. * * @return CPR_SUCCESS or CPR_FAILURE. errno should be set for FAILURE case. - * - * @note In Linux there will never be a success indication as the + * + * @note In Linux there will never be a success indication as the * calling thread will have been terminated. */ cprRC_t @@ -184,9 +149,9 @@ cprDestroyThread (cprThread_t thread) * cprAdjustRelativeThreadPriority * * @brief The function sets the relative thread priority up or down by the given value. - * + * * This function is used pSIPCC to set up the thread priority. The values of the - * priority range from -20 (Maximum priority) to +19 (Minimum priority). + * priority range from -20 (Maximum priority) to +19 (Minimum priority). * * @param[in] relPri - nice value of the thread -20 is MAX and 19 is MIN * @@ -215,7 +180,7 @@ cprAdjustRelativeThreadPriority (int relPri) */ /** - * cprGetThreadId + * cprGetThreadId * * @brief Return the pthread ID for the given CPR thread. * diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_time.h b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_time.h index 203c2a884ccf..182bab66ffb0 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_time.h +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_time.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_LINUX_TIME_H_ #define _CPR_LINUX_TIME_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_timers.h b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_timers.h index 519e3c9606c8..39ebda82f165 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_timers.h +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_timers.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_LINUX_TIMERS_H_ #define _CPR_LINUX_TIMERS_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_timers_using_select.c b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_timers_using_select.c index 79cbd0d0864f..a9d8f215a264 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_timers_using_select.c +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_timers_using_select.c @@ -1,47 +1,12 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * @brief CPR layer for Timers. * * This file contains the Cisco Portable Runtime layer for non-blocking - * timers. This implementation is for the Linux operating system using + * timers. This implementation is for the Linux operating system using * select with a timeout. * * Timer Service runs in its own thread and blocks on select @@ -102,7 +67,7 @@ *-------------------------------------------------------------------------- */ -typedef struct timer_ipc_cmd_s +typedef struct timer_ipc_cmd_s { cpr_timer_t *timer_ptr; void *user_data_ptr; @@ -113,7 +78,7 @@ typedef struct timer_ipc_cmd_s typedef struct timer_ipc_s { uint32_t msg_type; - union + union { timer_ipc_cmd_t cmd; cprRC_t result; @@ -209,7 +174,7 @@ static void send_api_result(cprRC_t result, struct sockaddr_un *addr, sockle */ /** - * cprSleep + * cprSleep * * @brief Suspend the calling thread * The cprSleep function blocks the calling thread for the indicated number of @@ -237,7 +202,7 @@ cprSleep (uint32_t duration) /** * @} */ - + /** * @defgroup TimerInternal The Timer internal functions * @ingroup Timers @@ -256,15 +221,15 @@ cprSleep (uint32_t duration) * @param[in] data - opaque data * @return - CPR_SUCCESS or CPR_FAILURE */ -static cprRC_t addTimerToList (cpr_timer_t *cprTimerPtr, uint32_t duration, void *data) +static cprRC_t addTimerToList (cpr_timer_t *cprTimerPtr, uint32_t duration, void *data) { static const char fname[] = "addTimerToList"; timer_ipc_t tmr_cmd = {0}; timer_ipc_t tmr_rsp={0}; - + API_ENTER(); - + //CPR_INFO("%s: cprTimerptr=0x%x dur=%d user_data=%x\n", // fname, cprTimerPtr, duration, data); tmr_cmd.msg_type = TMR_CMD_ADD; @@ -281,7 +246,7 @@ static cprRC_t addTimerToList (cpr_timer_t *cprTimerPtr, uint32_t duration, void strerror(errno), fname); API_RETURN(CPR_FAILURE); } - + } else { CPR_ERROR("can not make IPC connection, client_sock is invalid %s\n", fname); API_RETURN(CPR_FAILURE); @@ -331,7 +296,7 @@ static cprRC_t addTimer (cpr_timer_t *cprTimerPtr, uint32_t duration, void *data CPR_ERROR("%s - Timer %s has not been initialized.\n", fname, cprTimerPtr->name); errno = EINVAL; - + return(CPR_FAILURE); } @@ -340,7 +305,7 @@ static cprRC_t addTimer (cpr_timer_t *cprTimerPtr, uint32_t duration, void *data CPR_ERROR("%s - Timer %s is already active.\n", fname, cprTimerPtr->name); errno = EAGAIN; return(CPR_FAILURE); - + } /* Sanity tests passed, store the data the application passed in */ @@ -357,7 +322,7 @@ static cprRC_t addTimer (cpr_timer_t *cprTimerPtr, uint32_t duration, void *data * when the timer before them expires and when the newly * inserted timer expires. */ - + /* Check for insertion into an empty list */ if (timerListHead == NULL) { //CPR_INFO("no timer in the list case..\n"); @@ -367,7 +332,7 @@ static cprRC_t addTimer (cpr_timer_t *cprTimerPtr, uint32_t duration, void *data /* Insert timer into list */ timerList = timerListHead; while (timerList != NULL) { - + /* * If the duration on this new timer are less than the * timer in the list, insert this new timer before @@ -440,14 +405,14 @@ removeTimerFromList (cpr_timer_t *cprTimerPtr) static const char fname[] = "removeTimerFromList"; timer_ipc_t tmr_cmd = {0}; timer_ipc_t tmr_rsp = {0}; - + API_ENTER(); - - //CPR_INFO("%s:remove timer from list=0x%x\n",fname, cprTimerPtr); + + //CPR_INFO("%s:remove timer from list=0x%x\n",fname, cprTimerPtr); tmr_cmd.msg_type = TMR_CMD_REMOVE; tmr_cmd.u.cmd.timer_ptr = cprTimerPtr; - + //CPR_INFO("sending messge of type=%d\n", tmr_cmd.msg_type); /* simply post a request here to the timer service.. */ @@ -462,12 +427,12 @@ removeTimerFromList (cpr_timer_t *cprTimerPtr) CPR_ERROR("%s:client_sock invalid, no IPC connection \n", fname); API_RETURN(CPR_FAILURE); } - + /* * wait for the timer service to excute the request * so that we get result of operation */ - + if (recvfrom(client_sock, &tmr_rsp, sizeof(timer_ipc_t),0, NULL, NULL) < 0) { //CPR_INFO("error in recving the result error=%s\n", strerror(errno)); API_RETURN(CPR_FAILURE); @@ -498,7 +463,7 @@ removeTimer (cpr_timer_t *cprTimerPtr) timerBlk *timerPtr; //CPR_INFO("removing timer..0x%x\n", cprTimerPtr); - + /* * No need to sanitize the cprTimerPtr data as only * internal CPR functions call us and they have already @@ -508,7 +473,7 @@ removeTimer (cpr_timer_t *cprTimerPtr) */ timerPtr = (timerBlk *) cprTimerPtr->u.handlePtr; //CPR_INFO("%s: timer ptr=%x\n", fname, timerPtr); - + if (timerPtr != NULL) { /* Walk the list looking for this timer to cancel. */ timerList = timerListHead; @@ -551,9 +516,9 @@ removeTimer (cpr_timer_t *cprTimerPtr) timerList->duration = -1; timerList->timerActive = FALSE; cprTimerPtr->data = NULL; - + return(CPR_SUCCESS); - + } /* Walk the list */ @@ -575,16 +540,16 @@ removeTimer (cpr_timer_t *cprTimerPtr) timerPtr->duration = -1; timerPtr->cprTimerPtr->data = NULL; timerPtr->timerActive = FALSE; - + return(CPR_SUCCESS); - + } /* Bad application! */ CPR_ERROR("%s - Timer not initialized.\n", fname); errno = EINVAL; return(CPR_FAILURE); - + } /** @@ -598,12 +563,12 @@ removeTimer (cpr_timer_t *cprTimerPtr) * cprCreateTimer * * @brief Initialize a timer - * + * * The cprCreateTimer function is called to allow the OS to perform whatever * work is needed to create a timer. The input name parameter is optional. If present, CPR assigns * this name to the timer to assist in debugging. The callbackMsgQueue is the * address of a message queue created with cprCreateMsgQueue. This is the - * queue where the timer expire message will be sent. + * queue where the timer expire message will be sent. * So, when this timer expires a msg of type "applicationMsgId" will be sent to the msg queue * "callbackMsgQueue" indicating that timer applicationTimerId has expired. * @@ -676,7 +641,7 @@ cprCreateTimer (const char *name, timerPtr->cprTimerPtr = cprTimerPtr; cprTimerPtr->u.handlePtr = timerPtr; //CPR_INFO("cprTimerCreate: timer_t=%x blk=%x\n",cprTimerPtr, timerPtr); - + return cprTimerPtr; } @@ -755,7 +720,7 @@ cprIsTimerRunning (cprTimer_t timer) timerBlk *timerPtr; //CPR_INFO("istimerrunning(): timer=0x%x\n", timer); - + cprTimerPtr = (cpr_timer_t *) timer; if (cprTimerPtr != NULL) { timerPtr = (timerBlk *) cprTimerPtr->u.handlePtr; @@ -800,7 +765,7 @@ cprCancelTimer (cprTimer_t timer) cprRC_t rc = CPR_SUCCESS; //CPR_INFO("cprCancelTimer: timer ptr=%x\n", timer); - + cprTimerPtr = (cpr_timer_t *) timer; if (cprTimerPtr != NULL) { timerPtr = (timerBlk *) cprTimerPtr->u.handlePtr; @@ -878,9 +843,9 @@ cprUpdateTimer (cprTimer_t timer, uint32_t duration) /** * cprDestroyTimer * - * @brief Destroys a timer. + * @brief Destroys a timer. * - * This function will cancel the timer and then destroy it. It sets + * This function will cancel the timer and then destroy it. It sets * all links to NULL and then frees the timer block. * * @param[in] timer - which timer to destroy @@ -895,7 +860,7 @@ cprDestroyTimer (cprTimer_t timer) cprRC_t rc; //CPR_INFO("cprDestroyTimer:destroying timer=%x\n", timer); - + cprTimerPtr = (cpr_timer_t *) timer; if (cprTimerPtr != NULL) { rc = cprCancelTimer(timer); @@ -935,7 +900,7 @@ cprRC_t cpr_timer_pre_init (void) { static const char fname[] = "cpr_timer_pre_init"; int32_t returnCode; - + /* start the timer service first */ returnCode = (int32_t)pthread_create(&timerThreadId, NULL, timerThread, NULL); if (returnCode == -1) { @@ -948,7 +913,7 @@ cprRC_t cpr_timer_pre_init (void) * TBD:we should really implement wait on timerthread using condvar. */ cprSleep(1000); - + return CPR_SUCCESS; } @@ -965,8 +930,8 @@ cprRC_t cpr_timer_de_init(void) // close all sockets.. close(client_sock); close(serv_sock); - - + + // destroy api mutex pthread_mutex_destroy(&api_mutex); @@ -989,10 +954,10 @@ cprRC_t cpr_timer_de_init(void) * * @return This function eventually starts an infinite loop on a "select". */ -void *timerThread (void *data) +void *timerThread (void *data) { static const char fname[] = "timerThread"; - + //CPR_INFO("timerThread:started..\n"); #ifndef HOST #ifndef PTHREAD_SET_NAME @@ -1014,7 +979,7 @@ void *timerThread (void *data) if (start_timer_service_loop() == CPR_FAILURE) { CPR_ERROR("%s: timer service loop failed\n", fname); } - + return NULL; } @@ -1054,7 +1019,7 @@ static int select_sockets (void) FD_ZERO(&socks); FD_SET(serv_sock, &socks); - + return (serv_sock); } @@ -1072,29 +1037,29 @@ static cprRC_t read_timer_cmd () int rcvlen; timer_ipc_t tmr_cmd ={0}; cprRC_t ret = CPR_FAILURE; - - + + rcvlen =recvfrom(serv_sock, &tmr_cmd, sizeof(timer_ipc_t), 0, NULL, NULL); - + if (rcvlen > 0) { //CPR_INFO("got message type=%d\n", tmr_cmd.msg_type); switch(tmr_cmd.msg_type) { case TMR_CMD_ADD: - //CPR_INFO("request to add timer ptr=%x duration=%d datptr=%x\n", + //CPR_INFO("request to add timer ptr=%x duration=%d datptr=%x\n", // tmr_cmd.u.cmd.timer_ptr, tmr_cmd.u.cmd.duration, tmr_cmd.u.cmd.user_data_ptr); - + ret = addTimer(tmr_cmd.u.cmd.timer_ptr,tmr_cmd.u.cmd.duration, (void *)tmr_cmd.u.cmd.user_data_ptr); break; - + case TMR_CMD_REMOVE: //CPR_INFO("request to remove timer ptr=%x\n", tmr_cmd.u.cmd.timer_ptr); ret = removeTimer(tmr_cmd.u.cmd.timer_ptr); break; - + default: CPR_ERROR("%s:invalid ipc command = %d\n", tmr_cmd.msg_type); ret = CPR_FAILURE; @@ -1110,9 +1075,9 @@ static cprRC_t read_timer_cmd () /* send the result back */ send_api_result(ret, &tmr_client_addr, sizeof(tmr_client_addr)); - + return (ret); - + } /** @@ -1125,7 +1090,7 @@ void send_api_result(cprRC_t retVal, struct sockaddr_un *addr, socklen_t len) { static const char fname[] = "send_api_result"; timer_ipc_t tmr_rsp = {0}; - + tmr_rsp.msg_type = TMR_RESULT; tmr_rsp.u.result = retVal; if (sendto(serv_sock, &tmr_rsp, sizeof(timer_ipc_t),0, (struct sockaddr *)addr, len) < 0) { @@ -1153,7 +1118,7 @@ cprRC_t start_timer_service_loop (void) /* initialize server and client addresses used for sending.*/ cpr_set_sockun_addr((cpr_sockaddr_un_t *) &tmr_serv_addr, SERVER_PATH, getpid()); cpr_set_sockun_addr((cpr_sockaddr_un_t *) &tmr_client_addr, CLIENT_PATH, getpid()); - + /* * init mutex and cond var. * these are used for making API synchronous etc.. @@ -1163,8 +1128,8 @@ cprRC_t start_timer_service_loop (void) strerror(errno)); return CPR_FAILURE; } - - + + /* open a unix datagram socket for client library */ client_sock = socket(AF_LOCAL, SOCK_DGRAM, 0); if (client_sock == INVALID_SOCKET) { @@ -1208,7 +1173,7 @@ cprRC_t start_timer_service_loop (void) tv.tv_sec = (timerListHead->duration)/1000; tv.tv_usec = (timerListHead->duration%1000)*1000; //CPR_INFO("%s:time duration on head =%d sec:%d usec (or %d msec)\n", - // fname, tv.tv_sec, tv.tv_usec, + // fname, tv.tv_sec, tv.tv_usec, // timerListHead->duration); use_timeout = TRUE; } else { @@ -1218,7 +1183,7 @@ cprRC_t start_timer_service_loop (void) } ret = select(lsock + 1, &socks, NULL, NULL, (use_timeout == TRUE) ? &tv:NULL); - + if (ret == -1) { CPR_ERROR("%s:error in select err=%s\n", fname, strerror(errno)); @@ -1230,7 +1195,7 @@ cprRC_t start_timer_service_loop (void) timerListHead->duration = 0; process_expired_timers(); } else { - + if (FD_ISSET(serv_sock, &socks)) { //CPR_INFO("Got something on serv_sock..\n"); /* first reduce the duration of the head by current run time */ @@ -1240,7 +1205,7 @@ cprRC_t start_timer_service_loop (void) // timerListHead->duration); /* set the head with the remaining duration(tv) as indicated by select */ timerListHead->duration = tv.tv_sec * 1000 + (tv.tv_usec/1000); - } + } /* read the ipc message to remove or add a timer */ (void) read_timer_cmd(); } @@ -1252,7 +1217,7 @@ cprRC_t start_timer_service_loop (void) /** * * Process the timers expired. Generally this is called when head timer - * has expired. + * has expired. * @note we need to process the list as there could be * other timers too in the list which have expired. * @@ -1272,7 +1237,7 @@ void process_expired_timers() { if (timerListHead->duration > 0) { return; } - + /* There are one or more expired timers on the list */ processingTimers = TRUE; @@ -1289,7 +1254,7 @@ void process_expired_timers() { timerListHead->cprTimerPtr->name; //CPR_INFO("%s: timer %s expired..\n",fname, // timerMsg->expiredTimerName); - + timerMsg->expiredTimerId = timerListHead->cprTimerPtr->applicationTimerId; timerMsg->usrData = diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_tst.c b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_tst.c index 7b53b8494b94..5fb7787ec530 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_tst.c +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_tst.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr.h" #include "cpr_stdlib.h" diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_tst.h b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_tst.h index b3aedfd2afbe..8ce2ca4d5d27 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_tst.h +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_tst.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_LINUX_TST_H_ #define _CPR_LINUX_TST_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_types.h b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_types.h index 6b1969a6b081..6eca4a1d6841 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_types.h +++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_types.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_LINUX_TYPES_H_ #define _CPR_LINUX_TYPES_H_ @@ -56,7 +21,7 @@ */ typedef uint8_t boolean; -/* +/* * Define size_t * defined in numerous header files */ @@ -70,7 +35,7 @@ typedef uint8_t boolean; /* * Define MIN/MAX * defined in param.h - * + * * The GNU versions of the MAX and MIN macros do two things better than * the old versions: * 1. they are more optimal as they only evaluate a & b once by creating a diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_assert.h b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_assert.h index fe0415f63c82..fefa548e1acb 100755 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_assert.h +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_assert.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_CNU_ASSERT_H_ #define _CPR_CNU_ASSERT_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_debug.c b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_debug.c index 8631e1d2b37b..116680b7333f 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_debug.c +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_debug.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr.h" diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_debug.h b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_debug.h index a39bee16b2ce..df74c46e65d9 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_debug.h +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_debug.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_WIN_DEBUG_H_ #define _CPR_WIN_DEBUG_H_ @@ -63,4 +28,4 @@ typedef enum { //char testData1[15] = "Hello World"; //char testData2[15] = "allo monde"; -#endif +#endif diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_defines.h b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_defines.h index 44c229c4ab69..526c008b9d6f 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_defines.h +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_defines.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_WIN_DEFINES_H #define _CPR_WIN_DEFINES_H @@ -110,7 +75,7 @@ void cprEnableSwap (void); * Msg queue information needed to hide OS differences in implementation. * To use msg queues, the application code may pass in a name to the * create function for msg queues. CPR does not use this field, it is - * solely for the convenience of the application and to aid in debugging. + * solely for the convenience of the application and to aid in debugging. */ typedef struct { const char *name; diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_errno.c b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_errno.c index d108bbf85f69..dbcccaddc2ec 100755 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_errno.c +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_errno.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_errno.h b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_errno.h index 481986b4efff..33fe2bedc877 100755 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_errno.h +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_errno.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_CNU_ERRNO_H_ #define _CPR_CNU_ERRNO_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_in.h b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_in.h index d46805ba31ca..5273a5ad4398 100755 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_in.h +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_in.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_WIN_IN_H_ #define _CPR_WIN_IN_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_init.c b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_init.c index 975e66e7a85c..9a00f63afcfc 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_init.c +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_init.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr.h" #include "cpr_types.h" diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_ipc.c b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_ipc.c index 89f74168e208..d3213901a894 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_ipc.c +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_ipc.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_ipc.h" @@ -286,7 +251,7 @@ cprGetMessage (cprMsgQueue_t msgQueue, { CloseHandle(pThreadPtr->u.handlePtr); } - pCprMsgQueue->handlePtr = NULL; // zap the thread ptr, since the thread is going away now + pCprMsgQueue->handlePtr = NULL; // zap the thread ptr, since the thread is going away now _endthreadex(0); break; case MSG_BUF: diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_ipc.h b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_ipc.h index 8ebd0a1587ea..c106b224ba55 100755 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_ipc.h +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_ipc.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_WIN_IPC_H_ #define _CPR_WIN_IPC_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_locks.c b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_locks.c index 5f8b9b3f7aaf..eea3ba9039a1 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_locks.c +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_locks.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_locks.h" diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_locks.h b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_locks.h index 5d73f6cb474d..42c28471339e 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_locks.h +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_locks.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_WIN_LOCKS_H_ #define _CPR_WIN_LOCKS_H_ @@ -45,13 +10,13 @@ typedef struct { /* Number of waiting thread */ - int noWaiters; - + int noWaiters; + /* Serialise access to the waiting thread count */ - CRITICAL_SECTION noWaitersLock; + CRITICAL_SECTION noWaitersLock; /* Semaphore used to queue up threads waiting for the condition to be signalled */ - HANDLE sema; + HANDLE sema; } cpr_condition_t; diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_rand.c b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_rand.c index 4c975dde4bba..7e08a694021e 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_rand.c +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_rand.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr.h" @@ -47,24 +12,24 @@ * On WIN32 platform, there is no security support, for now generate * enough random number of bytes using normal "rand()" function. * - * Parameters: + * Parameters: * buf - pointer to the buffer to store the result of random - * bytes requested. - * len - pointer to the length of the desired random bytes. - * When calling the function, the integer's value - * should be set to the desired number of random + * bytes requested. + * len - pointer to the length of the desired random bytes. + * When calling the function, the integer's value + * should be set to the desired number of random * bytes ('buf' should be of at least this size). * upon success, its value will be set to the * actual number of random bytes being returned. - * (realistically, there is a maximum number of + * (realistically, there is a maximum number of * random bytes that can be returned at a time. * if the caller request more than that, the * 'len' will indicate how many bytes are actually being * returned) on failure, its value will be set to 0. * - * Return Value: + * Return Value: * 1 - success. - * 0 - fail. + * 0 - fail. */ int cpr_crypto_rand (uint8_t *buf, int *len) { @@ -74,7 +39,7 @@ int cpr_crypto_rand (uint8_t *buf, int *len) */ int i, total_bytes; - if ((buf == NULL) || (len == NULL)) { + if ((buf == NULL) || (len == NULL)) { /* Invalid parameters */ return (0); } diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_rand.h b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_rand.h index c877b38baf30..ef2af1633aa9 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_rand.h +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_rand.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_WIN_RAND_H_ #define _CPR_WIN_RAND_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_socket.c b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_socket.c index 7ae8a7313642..17b67678350c 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_socket.c +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_socket.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "ctype.h" #include "cpr_types.h" @@ -50,13 +15,13 @@ #pragma comment(lib, "wsock32.lib") #pragma comment(lib, "ws2_32.lib") -#define IN6ADDRSZ 16 -#define INT16SZ 2 +#define IN6ADDRSZ 16 +#define INT16SZ 2 #define INADDRSZ 4 #define IS_DIGIT(ch) ((ch >= '0') && (ch <= '9')) //const cpr_in6_addr_t in6addr_any = IN6ADDR_ANY_INIT; -const cpr_ip_addr_t ip_addr_invalid = {0}; +const cpr_ip_addr_t ip_addr_invalid = {0}; // Function prototypes for windows calls until CPR is in such a state that it can include windows sockets. @@ -130,9 +95,9 @@ const cpr_ip_addr_t ip_addr_invalid = {0}; int SECReq_LookupSrvr(char* serverAddr, int serverType) ; -int SECSock_connect (int appType, - char * srvrAddrAndPort, - int blockingConnect, +int SECSock_connect (int appType, + char * srvrAddrAndPort, + int blockingConnect, int connTimeout, int ipTOS) ; int SECSock_getFD(int nSSL) ; @@ -452,14 +417,14 @@ cpr_status_e cprCloseSocket (cpr_socket_t socket) { int connid ; - + connid = cpr_sec_fd_to_connid(socket); if(connid == -1) return ((closesocket(socket) != 0) ? CPR_FAILURE : CPR_SUCCESS); secSock_close(cpr_sec_conn_tab[connid].ssl) ; cpr_sec_purge_entry(connid) ; - return CPR_SUCCESS ; + return CPR_SUCCESS ; } cpr_status_e @@ -725,9 +690,9 @@ cprShutDown (cpr_socket_t socket, * * @return Server is not enabled for security * CPR_SOC_NONSECURE - * + * * @todo Security is not implemented for win32 - * + * */ cpr_soc_sec_status_e cprSecLookupSrvr (char* ipaddr_str) @@ -745,20 +710,20 @@ cprSecLookupSrvr (char* ipaddr_str) #define HOST_AND_PORT_SIZE 64 /** - * + * * Securely connect to a remote server * * @param[in] hostAndPort server addr and port in host:port form - * @param[in] mode blocking connect or not + * @param[in] mode blocking connect or not * FALSE : non-blocking; TRUE: blocking * @param[in] tos TOS value - * + * * @param[out] localPort local port used for the connection * * @return INVALID SOCKET, connect failed * - * @todo Security is not implemented for win32 - * + * @todo Security is not implemented for win32 + * */ cpr_socket_t cprSecSocConnect (char *host, @@ -833,9 +798,9 @@ cprSecSocConnect (char *host, * @param sock socket descriptor * * @return connection failed, CPR_SOC_CONN_FAILED - * - * @todo Security is not implemented for win32 - * + * + * @todo Security is not implemented for win32 + * */ cpr_soc_connect_status_e cprSecSockIsConnected (cpr_socket_t sock) diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_socket.h b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_socket.h index b0b979a0f1dd..8c77268c31be 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_socket.h +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_socket.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_WIN_SOCKET_H_ #define _CPR_WIN_SOCKET_H_ @@ -64,7 +29,7 @@ typedef uint16_t sa_family_t; /* * nokelly: - * Created this type to get things to compile, but I know that this is not + * Created this type to get things to compile, but I know that this is not * necessarily going to work. */ #ifndef AF_LOCAL @@ -98,7 +63,7 @@ typedef unsigned int u_int; typedef int cpr_socklen_t; typedef SOCKET cpr_socket_t; typedef unsigned long u_long; -typedef unsigned short u_short; +typedef unsigned short u_short; #define SUPPORT_CONNECT_CONST const @@ -107,4 +72,4 @@ typedef unsigned short u_short; #endif #define MAX_RETRY_FOR_EAGAIN 10 -#endif +#endif diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_stdio.c b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_stdio.c index 7157dafeb0be..9419d1cdccfe 100755 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_stdio.c +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_stdio.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr.h" #include @@ -74,8 +39,8 @@ void err_msg (const char *_format, ...) { va_list ap; - - va_start(ap, _format); + + va_start(ap, _format); CSFLogErrorV("cpr", _format, ap); va_end(ap); } @@ -85,7 +50,7 @@ notice_msg (const char *_format, ...) { va_list ap; - va_start(ap, _format); + va_start(ap, _format); CSFLogInfoV("cpr", _format, ap); va_end(ap); } @@ -94,8 +59,8 @@ int32_t buginf (const char *_format, ...) { va_list ap; - - va_start(ap, _format); + + va_start(ap, _format); CSFLogDebugV("cpr", _format, ap); va_end(ap); diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_stdio.h b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_stdio.h index bdbb54c87cbd..0feed4279d5e 100755 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_stdio.h +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_stdio.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_WIN_STDIO_H_ #define _CPR_WIN_STDIO_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_string.c b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_string.c index f5362c94c039..e12e767e13b1 100755 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_string.c +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_string.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_string.h" diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_string.h b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_string.h index ba91726ce21b..0b689b8bd1a2 100755 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_string.h +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_string.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_WIN_STRING_H_ #define _CPR_WIN_STRING_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_strings.h b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_strings.h index 6203eb15db82..304deecf5db1 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_strings.h +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_strings.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef CPR_WIN32_STRINGS_H_ #define CPR_WIN32_STRINGS_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_threads.c b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_threads.c index e03726e11f5a..cd5a9fd5f4bd 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_threads.c +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_threads.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_types.h" #include "cpr_threads.h" @@ -96,11 +61,11 @@ cprSuspendThread(cprThread_t thread) int32_t returnCode; static const char fname[] = "cprSuspendThread"; cpr_thread_t *cprThreadPtr; - + cprThreadPtr = (cpr_thread_t*)thread; if (cprThreadPtr != NULL) { - - HANDLE *hThread; + + HANDLE *hThread; hThread = (HANDLE *)cprThreadPtr->u.handlePtr; if (hThread != NULL) { @@ -112,8 +77,8 @@ cprSuspendThread(cprThread_t thread) return(CPR_FAILURE); } return(CPR_SUCCESS); - - // Bad application! + + // Bad application! } } CPR_ERROR("%s - NULL pointer passed in.\n", fname); @@ -125,7 +90,7 @@ cprSuspendThread(cprThread_t thread) /** * cprResumeThread * - * Resume execution of a previously suspended thread + * Resume execution of a previously suspended thread * * Parameters: thread - which system thread to resume * @@ -137,14 +102,14 @@ cprResumeThread(cprThread_t thread) int32_t returnCode; static const char fname[] = "cprResumeThread"; cpr_thread_t *cprThreadPtr; - + cprThreadPtr = (cpr_thread_t*)thread; if (cprThreadPtr != NULL) { HANDLE *hThread; hThread = (HANDLE *)cprThreadPtr->u.handlePtr; if (hThread != NULL) { - + returnCode = ResumeThread(hThread); if (returnCode == -1) { CPR_ERROR("%s - Resume thread failed: %d\n", @@ -153,7 +118,7 @@ cprResumeThread(cprThread_t thread) } return(CPR_SUCCESS); } - // Bad application! + // Bad application! } CPR_ERROR("%s - NULL pointer passed in.\n", fname); @@ -197,7 +162,7 @@ cprCreateThread(const char* name, startThreadDataPtr = (startThreadData *) cpr_malloc(sizeof(startThreadData)); if (threadPtr != NULL && startThreadDataPtr != NULL) { - + /* Assign name to CPR and CNU if one was passed in */ if (name != NULL) { threadPtr->name = name; @@ -206,12 +171,12 @@ cprCreateThread(const char* name, startThreadDataPtr->startRoutine = startRoutine; startThreadDataPtr->data = data; - serialize_lock = CreateEvent (NULL, FALSE, FALSE, NULL); + serialize_lock = CreateEvent (NULL, FALSE, FALSE, NULL); if (serialize_lock == NULL) { // Your code to deal with the error goes here. CPR_ERROR("%s - Event creation failure: %d\n", fname, GetLastError()); cpr_free(threadPtr); - threadPtr = NULL; + threadPtr = NULL; } else { @@ -219,8 +184,8 @@ cprCreateThread(const char* name, startThreadDataPtr->event = serialize_lock; threadPtr->u.handlePtr = (void*)_beginthreadex(NULL, 0, cprStartThread, (void*)startThreadDataPtr, 0, &ThreadId); - - if (threadPtr->u.handlePtr != NULL) { + + if (threadPtr->u.handlePtr != NULL) { threadPtr->threadId = ThreadId; result = WaitForSingleObject(serialize_lock, 1000); ResetEvent( serialize_lock ); @@ -229,7 +194,7 @@ cprCreateThread(const char* name, { CPR_ERROR("%s - Thread creation failure: %d\n", fname, GetLastError()); cpr_free(threadPtr); - threadPtr = NULL; + threadPtr = NULL; } CloseHandle( serialize_lock ); } diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_threads.cpp b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_threads.cpp index c8cc9cfaff66..3b4198a7930c 100755 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_threads.cpp +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_threads.cpp @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include @@ -63,10 +28,10 @@ cprSuspendThread(cprThread_t thread) int32_t returnCode; static const char fname[] = "cprSuspendThread"; cpr_thread_t *cprThreadPtr; - + cprThreadPtr = (cpr_thread_t*)thread; if (cprThreadPtr != NULL) { - + CWinThread *pCWinThread; pCWinThread = (CWinThread *)cprThreadPtr->u.handlePtr; if (pCWinThread != NULL) { @@ -77,7 +42,7 @@ cprSuspendThread(cprThread_t thread) return(CPR_FAILURE); } return(CPR_SUCCESS); - + /* Bad application! */ } } @@ -89,7 +54,7 @@ cprSuspendThread(cprThread_t thread) /** * cprResumeThread * - * Resume execution of a previously suspended thread + * Resume execution of a previously suspended thread * * Parameters: thread - which system thread to resume * @@ -101,13 +66,13 @@ cprResumeThread(cprThread_t thread) int32_t returnCode; static const char fname[] = "cprResumeThread"; cpr_thread_t *cprThreadPtr; - + cprThreadPtr = (cpr_thread_t*)thread; if (cprThreadPtr != NULL) { CWinThread *pCWinThread; pCWinThread = (CWinThread *)cprThreadPtr->u.handlePtr; if (pCWinThread != NULL) { - + returnCode = pCWinThread->ResumeThread(); if (returnCode == -1) { CPR_ERROR("%s - Resume thread failed: %d\n", @@ -153,14 +118,14 @@ cprCreateThread(const char* name, /* Malloc memory for a new thread */ threadPtr = (cpr_thread_t *)cpr_malloc(sizeof(cpr_thread_t)); if (threadPtr != NULL) { - + /* Assign name to CPR and CNU if one was passed in */ if (name != NULL) { threadPtr->name = name; } threadPtr->u.handlePtr = AfxBeginThread((AFX_THREADPROC)startRoutine, data, priority, stackSize); - + if (threadPtr->u.handlePtr != NULL) { PostThreadMessage(((CWinThread *)(threadPtr->u.handlePtr))->m_nThreadID, MSG_ECHO_EVENT, (unsigned long)&serialize_lock, 0); result = WaitForSingleObject(serialize_lock, 1000); @@ -171,7 +136,7 @@ cprCreateThread(const char* name, CPR_ERROR("%s - Thread creation failure: %d\n", fname, GetLastError()); cpr_free(threadPtr); threadPtr = NULL; - + } } else { /* Malloc failed */ diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_time.h b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_time.h index 7e504717a96a..7b179890ffb1 100755 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_time.h +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_time.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_WIN_TIME_H_ #define _CPR_WIN_TIME_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_timers.c b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_timers.c index d2303752f27b..ad70800791ff 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_timers.c +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_timers.c @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr.h" #include "cpr_types.h" diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_timers.h b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_timers.h index 428a29c40106..9925bcceb738 100755 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_timers.h +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_timers.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_WIN_TIMERS_H_ #define _CPR_WIN_TIMERS_H_ diff --git a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_types.h b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_types.h index c59a1e2a4b43..8db2dca58325 100644 --- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_types.h +++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_types.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CPR_WIN_TYPES_H_ #define _CPR_WIN_TYPES_H_ diff --git a/media/webrtc/signaling/src/sipcc/include/cc_blf.h b/media/webrtc/signaling/src/sipcc/include/cc_blf.h index 3b4f80120372..106b28343895 100644 --- a/media/webrtc/signaling/src/sipcc/include/cc_blf.h +++ b/media/webrtc/signaling/src/sipcc/include/cc_blf.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CC_BLF_H_ #define _CC_BLF_H_ diff --git a/media/webrtc/signaling/src/sipcc/include/cc_blf_listener.h b/media/webrtc/signaling/src/sipcc/include/cc_blf_listener.h index 6a934b7a9a63..af0353040a2f 100644 --- a/media/webrtc/signaling/src/sipcc/include/cc_blf_listener.h +++ b/media/webrtc/signaling/src/sipcc/include/cc_blf_listener.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CC_BLF_LISTENER_H_ #define _CC_BLF_LISTENER_H_ diff --git a/media/webrtc/signaling/src/sipcc/include/cc_call_feature.h b/media/webrtc/signaling/src/sipcc/include/cc_call_feature.h index f096dbb63c19..7e251baf93f6 100644 --- a/media/webrtc/signaling/src/sipcc/include/cc_call_feature.h +++ b/media/webrtc/signaling/src/sipcc/include/cc_call_feature.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * @mainpage Portable SIP Stack API diff --git a/media/webrtc/signaling/src/sipcc/include/cc_call_listener.h b/media/webrtc/signaling/src/sipcc/include/cc_call_listener.h index c5d9061ed6b9..7361d03a1042 100644 --- a/media/webrtc/signaling/src/sipcc/include/cc_call_listener.h +++ b/media/webrtc/signaling/src/sipcc/include/cc_call_listener.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CC_CALL_LISTENER_H_ #define _CC_CALL_LISTENER_H_ @@ -52,7 +17,7 @@ */ /** - * Notification for the creation of a new call + * Notification for the creation of a new call * @param call_handle call handle that is created. * @param call_state the call state * @param cc_cause cause that the call is created @@ -140,9 +105,9 @@ void CC_CallListener_callInfoChanged(cc_call_handle_t call_handle, cc_call_type_t call_type); /** - * Update Global Call Identification for a call. GCID can be used to collapse - * multiple call bubbles for the same call to a single call bubble. Please refer - * to the collpased call bubble as specified by the roundtable UI Spec. + * Update Global Call Identification for a call. GCID can be used to collapse + * multiple call bubbles for the same call to a single call bubble. Please refer + * to the collpased call bubble as specified by the roundtable UI Spec. * @param call_handle * @param gcid global call identification * @return void @@ -150,7 +115,7 @@ void CC_CallListener_callInfoChanged(cc_call_handle_t call_handle, void CC_CallListener_callGCIDChanged(cc_call_handle_t call_handle, char* gcid); /** - * Update the placed call information. This API reports the dialed digits for the + * Update the placed call information. This API reports the dialed digits for the * placed call. The number specified by this API should be logged in the placed call information. * @param call_handle call_handle * @param cld_name called party name diff --git a/media/webrtc/signaling/src/sipcc/include/cc_config.h b/media/webrtc/signaling/src/sipcc/include/cc_config.h index 7f1cc8a716aa..84530886a340 100644 --- a/media/webrtc/signaling/src/sipcc/include/cc_config.h +++ b/media/webrtc/signaling/src/sipcc/include/cc_config.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CC_CONFIG_H_ #define _CC_CONFIG_H_ @@ -144,7 +109,7 @@ #define CFGID_SPEAKER_ENABLED_BOOL CFGID_BEGIN_INDEX + 88 //tag:disableSpeaker #define CFGID_XFR_ONHOOK_ENABLED_BOOL CFGID_BEGIN_INDEX + 89 //tag:disableSpeaker #define CFGID_ROLLOVER_INT CFGID_BEGIN_INDEX + 90 //tag:rollover -#define CFGID_LOAD_FILE_STRING CFGID_BEGIN_INDEX + 91 //not from config file +#define CFGID_LOAD_FILE_STRING CFGID_BEGIN_INDEX + 91 //not from config file #define CFGID_BLF_ALERT_TONE_IDLE_INT CFGID_BEGIN_INDEX + 92 //tag:blfAudibleAlertSettingOfIdleStation #define CFGID_BLF_ALERT_TONE_BUSY_INT CFGID_BEGIN_INDEX + 93 //tag:blfAudibleAlertSettingOfBusyStation @@ -152,7 +117,7 @@ #define CFGID_JOIN_ACROSS_LINES_INT CFGID_BEGIN_INDEX + 95 //tag:joinAcrossLines -#if defined(_TNP_) +#if defined(_TNP_) #define ROUNDTABLE_INDEX_OFFSET 0 #else #define CFGID_MY_ACTIVE_MAC_ADDR_STRING CFGID_BEGIN_INDEX + 96 //not from configuration @@ -314,11 +279,11 @@ char* CC_Config_setDialPlan(const char *dial_plan_string, int len); /** * Set the fcp file - * @param fcp_plan_)string - path to the fcp plan) + * @param fcp_plan_)string - path to the fcp plan) * @param len - length, the maximum size will be 0xXXXX (tbd- pfg)) * @return string - fcp plan version stamp */ - + char* CC_Config_setFcp(const char *fcp_plan_string, int len); #endif /* _CC_CONFIG_H_ */ diff --git a/media/webrtc/signaling/src/sipcc/include/cc_constants.h b/media/webrtc/signaling/src/sipcc/include/cc_constants.h index 2b59a2720064..f4d1f7008642 100644 --- a/media/webrtc/signaling/src/sipcc/include/cc_constants.h +++ b/media/webrtc/signaling/src/sipcc/include/cc_constants.h @@ -1,48 +1,13 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CC_CONSTANTS_H_ #define _CC_CONSTANTS_H_ #include "cc_types.h" /** - * Max call servers + * Max call servers */ #define MAX_CALL_SERVERS 4 @@ -63,7 +28,7 @@ /** * Attrib bit in video available direction byte to indicate if the video is over CAST */ -#define CC_ATTRIB_CAST 0x8 +#define CC_ATTRIB_CAST 0x8 /** * Define the line id. The value 0 (CC_NO_LINE) means not set, it will be set by pSipcc system. @@ -314,7 +279,7 @@ typedef enum { CREATEOFFERERROR, CREATEANSWERERROR, SETLOCALDESC, - SETREMOTEDESC, + SETREMOTEDESC, SETLOCALDESCERROR, SETREMOTEDESCERROR, REMOTESTREAMADD, @@ -543,10 +508,10 @@ typedef enum { CC_SIS_SWAP, CC_SIS_CFWD_ANY_LINE } cc_sis_feature_id_e; - + /** * enum for conference participant status - */ + */ typedef enum { CCAPI_CONFPARTICIPANT_UNKNOWN, @@ -555,7 +520,7 @@ typedef enum { CCAPI_CONFPARTICIPANT_CONNECTED, CCAPI_CONFPARTICIPANT_ON_HOLD, CCAPI_CONFPARTICIPANT_DISCONNECTED -} cc_conf_participant_status_t; +} cc_conf_participant_status_t; typedef enum { diff --git a/media/webrtc/signaling/src/sipcc/include/cc_debug.h b/media/webrtc/signaling/src/sipcc/include/cc_debug.h index d9b942ab6ecd..308a7f79b77e 100644 --- a/media/webrtc/signaling/src/sipcc/include/cc_debug.h +++ b/media/webrtc/signaling/src/sipcc/include/cc_debug.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef CC_DEBUG_H_ #define CC_DEBUG_H_ diff --git a/media/webrtc/signaling/src/sipcc/include/cc_device_feature.h b/media/webrtc/signaling/src/sipcc/include/cc_device_feature.h index f5e40a3a3481..c772a9606bf6 100644 --- a/media/webrtc/signaling/src/sipcc/include/cc_device_feature.h +++ b/media/webrtc/signaling/src/sipcc/include/cc_device_feature.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CC_DEVICE_FEATURE_H_ #define _CC_DEVICE_FEATURE_H_ diff --git a/media/webrtc/signaling/src/sipcc/include/cc_device_listener.h b/media/webrtc/signaling/src/sipcc/include/cc_device_listener.h index 17dab74e91d2..0fe9e4c4b7f6 100644 --- a/media/webrtc/signaling/src/sipcc/include/cc_device_listener.h +++ b/media/webrtc/signaling/src/sipcc/include/cc_device_listener.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CC_DEVICE_LISTENER_H_ #define _CC_DEVICE_LISTENER_H_ diff --git a/media/webrtc/signaling/src/sipcc/include/cc_info.h b/media/webrtc/signaling/src/sipcc/include/cc_info.h index 73389d5f5af8..478bdff2946a 100644 --- a/media/webrtc/signaling/src/sipcc/include/cc_info.h +++ b/media/webrtc/signaling/src/sipcc/include/cc_info.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CC_INFO_H_ #define _CC_INFO_H_ @@ -59,7 +24,7 @@ /** - * Send SIP INFO message with the specified event_type and xml body + * Send SIP INFO message with the specified event_type and xml body * @param call_handle call handle * @param info_package the Info-Package header of the INFO message * @param info_type the Content-Type header of the INFO message diff --git a/media/webrtc/signaling/src/sipcc/include/cc_info_listener.h b/media/webrtc/signaling/src/sipcc/include/cc_info_listener.h index cb0a36f3b48a..9619d629eab5 100644 --- a/media/webrtc/signaling/src/sipcc/include/cc_info_listener.h +++ b/media/webrtc/signaling/src/sipcc/include/cc_info_listener.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CC_INFO_LISTENER_H_ #define _CC_INFO_LISTENER_H_ diff --git a/media/webrtc/signaling/src/sipcc/include/cc_service.h b/media/webrtc/signaling/src/sipcc/include/cc_service.h index f90d6b1e97ee..72eb5600289b 100644 --- a/media/webrtc/signaling/src/sipcc/include/cc_service.h +++ b/media/webrtc/signaling/src/sipcc/include/cc_service.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CC_SERVICE_H_ #define _CC_SERVICE_H_ diff --git a/media/webrtc/signaling/src/sipcc/include/cc_service_listener.h b/media/webrtc/signaling/src/sipcc/include/cc_service_listener.h index 47cce17ec627..be6f83e8b4e5 100644 --- a/media/webrtc/signaling/src/sipcc/include/cc_service_listener.h +++ b/media/webrtc/signaling/src/sipcc/include/cc_service_listener.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CC_SERVICE_LISTENER_H_ #define _CC_SERVICE_LISTENER_H_ @@ -70,8 +35,8 @@ void CC_ServiceListener_outOfService(cc_cucm_mode_t cucm_mode, cc_service_cause_ * @param additional_number the additional version number * @return void */ -void CC_ServiceListener_inService(cc_cucm_mode_t cucm_mode, - cc_service_cause_t service_cause, +void CC_ServiceListener_inService(cc_cucm_mode_t cucm_mode, + cc_service_cause_t service_cause, cc_string_t sis_ver_name, cc_uint32_t major_number, cc_uint32_t minor_number, @@ -95,7 +60,7 @@ void CC_ServiceListener_inService(cc_cucm_mode_t cucm_mode, * configuration changes and required the phone to re-register to make them * effective. * @param load_id [in] - firmware image name that phone should be running with - * @param inactive_load_d [in] firmaware image name for the inactive load image + * @param inactive_load_d [in] firmaware image name for the inactive load image * @param load_server [in] - address of load server to download the firmware * image load_id. * @param log_server [in] - log server address where error report need to be diff --git a/media/webrtc/signaling/src/sipcc/include/cc_types.h b/media/webrtc/signaling/src/sipcc/include/cc_types.h index 187df7ff5ca9..ab8b2a38150a 100644 --- a/media/webrtc/signaling/src/sipcc/include/cc_types.h +++ b/media/webrtc/signaling/src/sipcc/include/cc_types.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CC_TYPES_H_ #define _CC_TYPES_H_ diff --git a/media/webrtc/signaling/src/sipcc/include/ccapi_call.h b/media/webrtc/signaling/src/sipcc/include/ccapi_call.h index b0377452f56f..a3ae69a8e855 100644 --- a/media/webrtc/signaling/src/sipcc/include/ccapi_call.h +++ b/media/webrtc/signaling/src/sipcc/include/ccapi_call.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCAPI_CALL_H_ #define _CCAPI_CALL_H_ @@ -43,7 +8,7 @@ #include "ccapi_types.h" /** - * Get reference to call info + * Get reference to call info * @param [in] handle - call handle * @return cc_call_info_snap_t * NOTE: The info returned by this method must be released using CCAPI_Call_releaseCallInfo() @@ -61,8 +26,8 @@ void CCAPI_Call_releaseCallInfo(cc_callinfo_ref_t ref); * Retain the call info reference * @param [in] ref - reference to the call info to be retained * @return void - * NOTE: Application that has retained callInfo must call CCAPI_Call_releaseCallInfo() - * to free memory associated with this Info. + * NOTE: Application that has retained callInfo must call CCAPI_Call_releaseCallInfo() + * to free memory associated with this Info. */ void CCAPI_Call_retainCallInfo(cc_callinfo_ref_t ref); @@ -131,7 +96,7 @@ cc_return_t CCAPI_Call_answerCall(cc_call_handle_t handle, cc_sdp_direction_t vi cc_return_t CCAPI_Call_redial(cc_call_handle_t handle, cc_sdp_direction_t video_pref); /** - * Initiate Call Forward All + * Initiate Call Forward All * @param [in] handle - call handle * @return SUCCESS or FAILURE */ diff --git a/media/webrtc/signaling/src/sipcc/include/ccapi_call_info.h b/media/webrtc/signaling/src/sipcc/include/ccapi_call_info.h index a506b3c633d4..f23bef17062d 100644 --- a/media/webrtc/signaling/src/sipcc/include/ccapi_call_info.h +++ b/media/webrtc/signaling/src/sipcc/include/ccapi_call_info.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCAPI_CALL_INFO_H_ #define _CCAPI_CALL_INFO_H_ @@ -72,7 +37,7 @@ cc_call_attr_t CCAPI_CallInfo_getCallAttr(cc_callinfo_ref_t handle); cc_call_type_t CCAPI_CallInfo_getCallType(cc_callinfo_ref_t handle); /** - * get Called party name + * get Called party name * @param [in] handle - call info handle * @return called party name * NOTE: The memory for return string doesn't need to be freed it will be freed when the info reference is freed @@ -163,7 +128,7 @@ cc_string_t CCAPI_CallInfo_getPlacedCallPartyNumber(cc_callinfo_ref_t handle); /** * get call instance number * @param [in] handle - call info handle - * @return + * @return * NOTE: The memory for return string doesn't need to be freed it will be freed when the info reference is freed */ cc_int32_t CCAPI_CallInfo_getCallInstance(cc_callinfo_ref_t handle); @@ -255,7 +220,7 @@ cc_boolean CCAPI_CallInfo_hasCapability(cc_callinfo_ref_t handle, cc_int32_t fe /** * get Allowed Feature set * @param [in] handle - call info handle - * @param [in,out] feat_set - array of len CC_CALL_CAP_MAX + * @param [in,out] feat_set - array of len CC_CALL_CAP_MAX * @return cc_return_t - CC_SUCCESS or CC_FAILURE */ cc_return_t CCAPI_CallInfo_getCapabilitySet(cc_callinfo_ref_t handle, cc_int32_t feat_set[]); @@ -292,7 +257,7 @@ cc_string_t CCAPI_CallInfo_getINFOBody(cc_callinfo_ref_t handle); * Get the call log reference * @param [in] handle - call info handle * @return cc_string_t - INFO body - * NOTE: Memory associated with the call log is tied to the cc_callinfo_ref_t handle + * NOTE: Memory associated with the call log is tied to the cc_callinfo_ref_t handle * this would be freed when the callinfo ref is freed. */ cc_calllog_ref_t CCAPI_CallInfo_getCallLogRef(cc_callinfo_ref_t handle); @@ -307,13 +272,13 @@ cc_sdp_direction_t CCAPI_CallInfo_getVideoDirection(cc_callinfo_ref_t handle); /** * Returns the Audio mute state for this call * @return boolean true=muted false=not muted - */ + */ cc_boolean CCAPI_CallInfo_isAudioMuted(cc_callinfo_ref_t handle); /** * Returns the Video mute state for this call * @return boolean true=muted false=not muted - */ + */ cc_boolean CCAPI_CallInfo_isVideoMuted(cc_callinfo_ref_t handle); /** diff --git a/media/webrtc/signaling/src/sipcc/include/ccapi_call_listener.h b/media/webrtc/signaling/src/sipcc/include/ccapi_call_listener.h index 9220f24aab13..1a78c46ea586 100644 --- a/media/webrtc/signaling/src/sipcc/include/ccapi_call_listener.h +++ b/media/webrtc/signaling/src/sipcc/include/ccapi_call_listener.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCAPI_CALL_LISTENER_H_ #define _CCAPI_CALL_LISTENER_H_ @@ -49,7 +14,7 @@ * @param [in] info - reference to call info * @return void * NOTE: The memory associated with callInfo will be freed immediately upon return from this method. - * If the application wishesd to retain a copy it should invoke CCAPI_Call_retainCallInfo() API. Once retained + * If the application wishesd to retain a copy it should invoke CCAPI_Call_retainCallInfo() API. Once retained * it can be released by invoking the CCAPI_Call_releaseCallInfo API. */ void CCAPI_CallListener_onCallEvent(ccapi_call_event_e event, cc_call_handle_t handle, cc_callinfo_ref_t info); diff --git a/media/webrtc/signaling/src/sipcc/include/ccapi_calllog.h b/media/webrtc/signaling/src/sipcc/include/ccapi_calllog.h index a6bd202f2e45..9a1ba3624705 100644 --- a/media/webrtc/signaling/src/sipcc/include/ccapi_calllog.h +++ b/media/webrtc/signaling/src/sipcc/include/ccapi_calllog.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "cpr_stdio.h" #include "ccapi_call.h" diff --git a/media/webrtc/signaling/src/sipcc/include/ccapi_conf_roster.h b/media/webrtc/signaling/src/sipcc/include/ccapi_conf_roster.h index 5a690bda2e3e..b3b7ccca9fc9 100644 --- a/media/webrtc/signaling/src/sipcc/include/ccapi_conf_roster.h +++ b/media/webrtc/signaling/src/sipcc/include/ccapi_conf_roster.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCAPI_CONF_ROSTER_H_ #define _CCAPI_CONF_ROSTER_H_ @@ -53,7 +18,7 @@ typedef string_t cc_participant_ref_t; * * Returns list of conference participant information last received from the UCM. * Note that the list may include conference participants in various states in addition to Connected. -* [ For exampke, a listed participant may be in the ringing state (not yet on conference), +* [ For exampke, a listed participant may be in the ringing state (not yet on conference), * or disconnected state (leaving/left the conference).] Application should invoke * getConferenceParticipantStatus for each participant in the list to query exact status. * diff --git a/media/webrtc/signaling/src/sipcc/include/ccapi_device.h b/media/webrtc/signaling/src/sipcc/include/ccapi_device.h index 44101f05d5db..f27b1e28c1ac 100644 --- a/media/webrtc/signaling/src/sipcc/include/ccapi_device.h +++ b/media/webrtc/signaling/src/sipcc/include/ccapi_device.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCAPI_DEVICE_H_ #define _CCAPI_DEVICE_H_ @@ -43,21 +8,21 @@ #include "ccapi_types.h" -/** +/** * Get device ID - * @return cc_deviceinfo_ref_t - reference handle of the device + * @return cc_deviceinfo_ref_t - reference handle of the device */ cc_device_handle_t CCAPI_Device_getDeviceID(); /** * Get device reference handle * @param [in] id - device ID - * @return cc_deviceinfo_ref_t - reference handle of the device + * @return cc_deviceinfo_ref_t - reference handle of the device * NOTE: The info returned by this method must be released using CCAPI_Device_releaseDeviceInfo() */ cc_deviceinfo_ref_t CCAPI_Device_getDeviceInfo(cc_device_handle_t id); -/** +/** * Set full path of device configuration file. API will download and parse the config file using * provided location. * @param handle - device handle @@ -67,14 +32,14 @@ cc_deviceinfo_ref_t CCAPI_Device_getDeviceInfo(cc_device_handle_t id); void CCAPI_Device_configUpdate(cc_device_handle_t handle, file_path_t file_path); /** - * Retain the deviceInfo snapshot - this info shall not be freed until a + * Retain the deviceInfo snapshot - this info shall not be freed until a * CCAPI_Device_releaseDeviceInfo() API releases this resource. * @param [in] ref - refrence to the block to be freed * @return void - * NOTE: Application may use this API to retain the device info using this API inside - * CCAPI_DeviceListener_onDeviceEvent() App must release the Info using + * NOTE: Application may use this API to retain the device info using this API inside + * CCAPI_DeviceListener_onDeviceEvent() App must release the Info using * CCAPI_Device_releaseDeviceInfo() once it is done with it. - */ + */ void CCAPI_Device_retainDeviceInfo(cc_deviceinfo_ref_t ref); /** @@ -113,7 +78,7 @@ void CCAPI_Device_enableCamera(cc_device_handle_t handle, cc_boolean enable); /** * CCAPI_Device_setDigestNamePasswd - * + * * @param handle - device handle * @param name - The Digest auth name * @param passwd - The password for that name for the line @@ -124,14 +89,14 @@ void CCAPI_Device_setDigestNamePasswd (cc_device_handle_t handle, /** - * CCAPI_Device_IP_Update + * CCAPI_Device_IP_Update * * There is a update in the IP address and the values of new set * of signaling and media IP addresses are provided. * These value are compared with the current IP address values * and depending on what changed, restart and/or re-invite * action is taken. - * + * * The case being addressed. * 1) If the signaling IP change happens during a call, * the change is deferred till phone is idle. @@ -161,7 +126,7 @@ void CCAPI_Device_IP_Update (cc_device_handle_t handle, /** * CCAPI_Device_setVideoAutoTxPreference - * + * * @param handle - device handle * @param txPref - TRUE=> auto Tx Video prefered * @return void diff --git a/media/webrtc/signaling/src/sipcc/include/ccapi_device_info.h b/media/webrtc/signaling/src/sipcc/include/ccapi_device_info.h index 3c5daca720f7..0aaea9d32700 100644 --- a/media/webrtc/signaling/src/sipcc/include/ccapi_device_info.h +++ b/media/webrtc/signaling/src/sipcc/include/ccapi_device_info.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCAPI_DEVICE_INFO_H_ #define _CCAPI_DEVICE_INFO_H_ @@ -50,7 +15,7 @@ cc_deviceinfo_ref_t CCAPI_DeviceInfo_getDeviceHandle() ; /** * gets the device name - * @param [in] handle - reference to device info + * @param [in] handle - reference to device info * @returns - a pointer to the device name * NOTE: The memory for return string doesn't need to be freed it will be freed when the info reference is freed */ @@ -58,38 +23,38 @@ cc_string_t CCAPI_DeviceInfo_getDeviceName(cc_deviceinfo_ref_t handle) ; /** * gets the device idle status - * @param [in] handle - reference to device info + * @param [in] handle - reference to device info * @returns boolean - idle status */ cc_boolean CCAPI_DeviceInfo_isPhoneIdle(cc_deviceinfo_ref_t handle) ; /** * gets the service state - * @param [in] handle - reference to device info - * @returns cc_service_state_t - INS/OOS + * @param [in] handle - reference to device info + * @returns cc_service_state_t - INS/OOS */ cc_service_state_t CCAPI_DeviceInfo_getServiceState(cc_deviceinfo_ref_t handle) ; /** * gets the service cause - * @param [in] handle - reference to device info + * @param [in] handle - reference to device info * @returns cc_service_cause_t - reason for service state */ cc_service_cause_t CCAPI_DeviceInfo_getServiceCause(cc_deviceinfo_ref_t handle) ; /** * gets the cucm mode - * @param [in] handle - reference to device info + * @param [in] handle - reference to device info * @returns cc_cucm_mode_t - CUCM mode */ cc_cucm_mode_t CCAPI_DeviceInfo_getCUCMMode(cc_deviceinfo_ref_t handle) ; /** * gets list of handles to calls on the device - * @param [in] handle - reference to device info + * @param [in] handle - reference to device info * @param [out] handles - array of call handle to be returned * @param [in,out] count number allocated in array/elements returned - * @returns + * @returns */ void CCAPI_DeviceInfo_getCalls(cc_deviceinfo_ref_t handle, cc_call_handle_t handles[], cc_uint16_t *count) ; @@ -101,15 +66,15 @@ void CCAPI_DeviceInfo_getCalls(cc_deviceinfo_ref_t handle, cc_call_handle_t hand * @param [in,out] count number allocated in array/elements returned * @returns */ -void CCAPI_DeviceInfo_getCallsByState(cc_deviceinfo_ref_t handle, cc_call_state_t state, +void CCAPI_DeviceInfo_getCallsByState(cc_deviceinfo_ref_t handle, cc_call_state_t state, cc_call_handle_t handles[], cc_uint16_t *count) ; /** * gets list of handles to lines on the device - * @param [in] handle - reference to device info + * @param [in] handle - reference to device info * @param [in] handles - array of line handle to be returned * @param [in,out] count - pointer to count in array in-> memory allocated out-> num populated - * @returns + * @returns */ void CCAPI_DeviceInfo_getLines(cc_deviceinfo_ref_t handle, cc_lineid_t handles[], cc_uint16_t *count) ; @@ -124,10 +89,10 @@ void CCAPI_DeviceInfo_getFeatures(cc_deviceinfo_ref_t handle, cc_featureinfo_ref /** * gets handles of call agent servers - * @param [in] handle - reference to device info + * @param [in] handle - reference to device info * @param [in] handles - array of handles to call agent servers * @param [in,out] count - pointer to count in array in-> memory allocated out-> num populated - * @returns + * @returns */ void CCAPI_DeviceInfo_getCallServers(cc_deviceinfo_ref_t handle, cc_callserver_ref_t handles[], cc_uint16_t *count) ; @@ -200,14 +165,14 @@ cc_boolean CCAPI_DeviceInfo_isReceivedCallLoggingEnabled (cc_deviceinfo_ref_t ha /** * gets register/in service time - * This value should be read once the register completes successfully + * This value should be read once the register completes successfully * @param [in] handle - reference to device info * @returns long - time registration completed successfully. */ long long CCAPI_DeviceInfo_getRegTime (cc_deviceinfo_ref_t handle); /** - * Returns dot notation IP address used for registering phone. If phone is not + * Returns dot notation IP address used for registering phone. If phone is not * registered, then "0.0.0.0" is returned. * @param [in] handle - reference to device info * @return cc_string_t IP address used to register phone. @@ -230,7 +195,7 @@ cc_boolean CCAPI_DeviceInfo_isVideoCapEnabled(cc_deviceinfo_ref_t handle); /** * gets the device mwi_lamp state - * @param [in] handle - reference to device info + * @param [in] handle - reference to device info * @returns boolean - mwi_lamp state */ cc_boolean CCAPI_DeviceInfo_getMWILampState(cc_deviceinfo_ref_t handle); diff --git a/media/webrtc/signaling/src/sipcc/include/ccapi_device_listener.h b/media/webrtc/signaling/src/sipcc/include/ccapi_device_listener.h index a7e569ca7262..ed3a5a62497b 100644 --- a/media/webrtc/signaling/src/sipcc/include/ccapi_device_listener.h +++ b/media/webrtc/signaling/src/sipcc/include/ccapi_device_listener.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCAPI_DEVICE_LISTENER_H_ #define _CCAPI_DEVICE_LISTENER_H_ @@ -48,9 +13,9 @@ * @param [in] device_id - device id * @param [in] dev_info - reference to device info * @returns - * NOTE: The memory associated with deviceInfo will be freed immediately upon - * return from this method. If the application wishes to retain a copy it should - * invoke CCAPI_Device_retainDeviceInfo() API. once the info is retained it can be + * NOTE: The memory associated with deviceInfo will be freed immediately upon + * return from this method. If the application wishes to retain a copy it should + * invoke CCAPI_Device_retainDeviceInfo() API. once the info is retained it can be * released by invoking CCAPI_Device_releaseDeviceInfo() API */ void CCAPI_DeviceListener_onDeviceEvent(ccapi_device_event_e type, cc_device_handle_t device_id, cc_deviceinfo_ref_t dev_info); diff --git a/media/webrtc/signaling/src/sipcc/include/ccapi_feature_info.h b/media/webrtc/signaling/src/sipcc/include/ccapi_feature_info.h index 621336e3d40b..ea28472fe361 100644 --- a/media/webrtc/signaling/src/sipcc/include/ccapi_feature_info.h +++ b/media/webrtc/signaling/src/sipcc/include/ccapi_feature_info.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCAPIAPI_FEATURE_INFO_H_ #define _CCAPIAPI_FEATURE_INFO_H_ diff --git a/media/webrtc/signaling/src/sipcc/include/ccapi_line.h b/media/webrtc/signaling/src/sipcc/include/ccapi_line.h index 6c2412068518..45577ac4e74e 100644 --- a/media/webrtc/signaling/src/sipcc/include/ccapi_line.h +++ b/media/webrtc/signaling/src/sipcc/include/ccapi_line.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCAPI_LINE_H_ #define _CCAPI_LINE_H_ @@ -57,13 +22,13 @@ cc_lineinfo_ref_t CCAPI_Line_getLineInfo(cc_uint32_t line); */ cc_call_handle_t CCAPI_Line_CreateCall(cc_lineid_t line); -/** - * Retain the lineInfo snapshot - this info shall not be freed until a +/** + * Retain the lineInfo snapshot - this info shall not be freed until a * CCAPI_Line_releaseLineInfo() API releases this resource. * @param [in] ref - reference to the block to be retained * @return void - * NOTE: Application may use this API to retain the device info using this API inside - * CCAPI_LineListener_onLineEvent() App must release the Info using + * NOTE: Application may use this API to retain the device info using this API inside + * CCAPI_LineListener_onLineEvent() App must release the Info using * CCAPI_Line_releaseLineInfo() once it is done with it. */ void CCAPI_Line_retainLineInfo(cc_lineinfo_ref_t ref); diff --git a/media/webrtc/signaling/src/sipcc/include/ccapi_line_info.h b/media/webrtc/signaling/src/sipcc/include/ccapi_line_info.h index 0b636b4ff600..77e77fda1071 100644 --- a/media/webrtc/signaling/src/sipcc/include/ccapi_line_info.h +++ b/media/webrtc/signaling/src/sipcc/include/ccapi_line_info.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCAPI_LINE_INFO_H_ #define _CCAPI_LINE_INFO_H_ @@ -85,7 +50,7 @@ cc_string_t CCAPI_lineInfo_getExternalNumber(cc_lineinfo_ref_t line); * Get the physical button number on which this line is configured * @param [in] line - line reference handle * @return cc_uint32_t - button number - * NOTE: This API is deprecated please don't use this. the CCAPI_lineInfo_getID() returns the button number + * NOTE: This API is deprecated please don't use this. the CCAPI_lineInfo_getID() returns the button number * as we use the button as line id */ cc_uint32_t CCAPI_lineInfo_getButton(cc_lineinfo_ref_t line); @@ -121,7 +86,7 @@ cc_string_t CCAPI_lineInfo_getCFWDName(cc_lineinfo_ref_t line); /** * Get calls on line - * @param [in] line - lineID + * @param [in] line - lineID * @param [in, out] handles[] - Array of callinfo references * @param [in,out] count - count of call references populated * @return void @@ -136,7 +101,7 @@ void CCAPI_LineInfo_getCalls(cc_lineid_t line, cc_call_handle_t handles[], int * * @param [in,out] count - count of call references populated * @return void */ -void CCAPI_LineInfo_getCallsByState(cc_lineid_t line, cc_call_state_t state, +void CCAPI_LineInfo_getCallsByState(cc_lineid_t line, cc_call_state_t state, cc_call_handle_t handles[], int *count); /** @@ -192,7 +157,7 @@ cc_boolean CCAPI_LineInfo_hasCapability(cc_lineinfo_ref_t line, cc_int32_t feat /** * get Allowed Feature set * @param [in] handle - call info handle - * @param [in,out] feat_set - array of len CC_CALL_CAP_MAX + * @param [in,out] feat_set - array of len CC_CALL_CAP_MAX * @return cc_return_t - CC_SUCCESS or CC_FAILURE */ cc_return_t CCAPI_LineInfo_getCapabilitySet(cc_lineinfo_ref_t line, cc_int32_t feat_set[]); diff --git a/media/webrtc/signaling/src/sipcc/include/ccapi_line_listener.h b/media/webrtc/signaling/src/sipcc/include/ccapi_line_listener.h index 9fb40cf7fd74..9cf331e83d90 100644 --- a/media/webrtc/signaling/src/sipcc/include/ccapi_line_listener.h +++ b/media/webrtc/signaling/src/sipcc/include/ccapi_line_listener.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCAPI_LINE_LISTENER_H_ #define _CCAPI_LINE_LISTENER_H_ @@ -48,9 +13,9 @@ * @param [in] line - line id * @param [in] lineInfo - line info reference * @return cc_call_handle_t - handle of the call created - * NOTE: The memory associated with deviceInfo will be freed immediately upon - * return from this method. If the application wishes to retain a copy it should - * invoke CCAPI_Line_retainlineInfo() API. once the info is retained it can be + * NOTE: The memory associated with deviceInfo will be freed immediately upon + * return from this method. If the application wishes to retain a copy it should + * invoke CCAPI_Line_retainlineInfo() API. once the info is retained it can be * released by invoking CCAPI_Line_releaseLineInfo() API */ void CCAPI_LineListener_onLineEvent(ccapi_line_event_e line_event, cc_lineid_t line, cc_lineinfo_ref_t lineInfo); diff --git a/media/webrtc/signaling/src/sipcc/include/ccapi_service.h b/media/webrtc/signaling/src/sipcc/include/ccapi_service.h index 518f499725d8..0655a4d4b9b1 100644 --- a/media/webrtc/signaling/src/sipcc/include/ccapi_service.h +++ b/media/webrtc/signaling/src/sipcc/include/ccapi_service.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCAPI_SERVICE_H_ #define _CCAPI_SERVICE_H_ @@ -62,7 +27,7 @@ extern int g_compl_cfg; /** * This function creates various data module needed for initialization of * Sipcc stack. On reboot or after CCAPI_Service_destroy(), application must call - * first this function followed by CC_Service_start() + * first this function followed by CC_Service_start() * to bring Sipcc stack in in-service. This function * need to be called only once. * @return SUCCESS or FAILURE @@ -77,15 +42,15 @@ cc_return_t CCAPI_Service_create(); cc_return_t CCAPI_Service_destroy(); /** - * Bring up the Sipcc stack in service. - * + * Bring up the Sipcc stack in service. + * * @return SUCCESS or FAILURE */ cc_return_t CCAPI_Service_start(); /** - * Stop Sipcc stack - * + * Stop Sipcc stack + * * @return SUCCESS or FAILURE */ cc_return_t CCAPI_Service_stop(); @@ -93,26 +58,26 @@ cc_return_t CCAPI_Service_stop(); /** * CCAPI_Service_reregister * - * This API will result in stopping the stip stack (i.e unregister) followed - * by parsing of the current config followed by a - * start (i.e register) of the SIP stack, without the download of a new config - * file. This API is used in the APPLY config case + * This API will result in stopping the stip stack (i.e unregister) followed + * by parsing of the current config followed by a + * start (i.e register) of the SIP stack, without the download of a new config + * file. This API is used in the APPLY config case * * @param device_handle handle of the device, the response is for - * @param device_name + * @param device_name * @param cfg the config file name and path or the complete configuration * in memory. * @param from_memory boolean flag to indicate if the complete config * is sent. This parameter is meant to indicate if the "cfg" parameter * points to the file name or is a pointer to the complete config in memory. - * @return + * @return */ cc_return_t CCAPI_Service_reregister (int device_handle, const char *device_name, const char *cfg, int from_memory); /** * Reset request from the Reset Manager - * + * * @return void */ void CCAPI_Service_reset_request(); diff --git a/media/webrtc/signaling/src/sipcc/include/ccapi_types.h b/media/webrtc/signaling/src/sipcc/include/ccapi_types.h index c55050468529..7fbbc60605c8 100644 --- a/media/webrtc/signaling/src/sipcc/include/ccapi_types.h +++ b/media/webrtc/signaling/src/sipcc/include/ccapi_types.h @@ -1,41 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * @mainpage Portable SIP Stack API @@ -43,12 +8,12 @@ * @section intro_sec Introduction * The portable SIP stack is used in multiple SIP endpoints. This document * describes the API's provided by the portable SIP stack that third party - * vendors must implement to use the stack. + * vendors must implement to use the stack. * * @section hlapi NG APIs * This API provides 3 main sets of APIs (device, line. call) and provides ways to * invoke actions on these and get status and even callbacks - * + * * @subsection Management * @li cc_service.h @par * @@ -56,17 +21,17 @@ * @li ccapi_call.h @par * @li ccapi_call_info.h @par * @li ccapi_call_listener.h @par to be implemented by the vendor for events related to call - * + * * @subsection Line * @li ccapi_line.h @par * @li ccapi_line_info.h @par * @li ccapi_line_listener.h @par to be implemented by the vendor for events related to line - * + * * @subsection Device * @li ccapi_device.h @par * @li ccapi_device_info.h @par * @li ccapi_device_listener.h @par to be implemented by the vendor for events related to device - * + * * @subsection Misc * @li ccapi_types.h @par * @li cc_types.h @par diff --git a/media/webrtc/signaling/src/sipcc/include/ccsdp.h b/media/webrtc/signaling/src/sipcc/include/ccsdp.h index 11bc310a9c0c..457f6c74dc43 100644 --- a/media/webrtc/signaling/src/sipcc/include/ccsdp.h +++ b/media/webrtc/signaling/src/sipcc/include/ccsdp.h @@ -1,55 +1,20 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Cisco Systems SIP Stack. - * - * The Initial Developer of the Original Code is - * Cisco Systems (CSCO). - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Enda Mannion - * Suhas Nandakumar - * Ethan Hugg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * Skip this file if not doing video on the device. * - * The ccsdp_xxx api's provide a means to query and populate the SDP attributes - * for video m lines. These Api are not needed if we are not supporting video on - * the platform. For audio the stack will populate the appropriate attributes + * The ccsdp_xxx api's provide a means to query and populate the SDP attributes + * for video m lines. These Api are not needed if we are not supporting video on + * the platform. For audio the stack will populate the appropriate attributes * - * - * These API's can be invoked from the vcmCheckAttrs() and vcmPopulateAttrs() + * + * These API's can be invoked from the vcmCheckAttrs() and vcmPopulateAttrs() * methods to populate or extract the value of specific attributes in the video SDP. * These api require an handle to the SDP that is passed in the above methods. *
- * sdp_handle     The SDP handle 
+ * sdp_handle     The SDP handle
  * level       The level the attribute is defined.  Can be either
  *             SDP_SESSION_LEVEL or 0-n specifying a media line level.
  * inst_num    The instance number of the attribute.  Multiple instances
@@ -156,12 +121,12 @@ typedef enum {
 } sdp_result_e;
 
 /**
- * Indicates invalid bandwidth value 
+ * Indicates invalid bandwidth value
  */
 #define SDP_INVALID_VALUE          (-2)
 
 /**
- * Bandwidth modifier type for b= SDP line 
+ * Bandwidth modifier type for b= SDP line
  */
 typedef enum {
     SDP_BW_MODIFIER_INVALID = -1,
@@ -248,10 +213,10 @@ typedef enum {
     SDP_ATTR_INVALID
 } sdp_attr_e;
 
-/** 
+/**
  * Gets the value of the fmtp attribute- parameter-sets parameter for H.264 codec
  *
- * @param[in]  sdp_handle     The SDP handle 
+ * @param[in]  sdp_handle     The SDP handle
  * @param[in]  level       The level to check for the attribute.
  * @param[in]  cap_num     The capability number associated with the attribute if any.  If none, should be zero.
  * @param[in]  inst_num    The attribute instance number to check.
@@ -259,13 +224,13 @@ typedef enum {
  * @return      parameter-sets value.
  */
 
-const char* ccsdpAttrGetFmtpParamSets(void *sdp_handle, uint16_t level, 
+const char* ccsdpAttrGetFmtpParamSets(void *sdp_handle, uint16_t level,
                                             uint8_t cap_num, uint16_t inst_num);
 
 /**
  * Gets the value of the fmtp attribute- packetization-mode parameter for H.264 codec
  *
- * @param[in]  sdp_handle     The SDP handle 
+ * @param[in]  sdp_handle     The SDP handle
  * @param[in]  level       The level to check for the attribute.
  * @param[in]  cap_num     The capability number associated with the attribute if any.  If none, should be zero.
  * @param[in]  inst_num    The attribute instance number to check.
@@ -273,12 +238,12 @@ const char* ccsdpAttrGetFmtpParamSets(void *sdp_handle, uint16_t level,
  *
  * @return     sdp_result_e         SDP_SUCCESS = SUCCESS
  */
-sdp_result_e ccsdpAttrGetFmtpPackMode(void *sdp_handle, uint16_t level, 
+sdp_result_e ccsdpAttrGetFmtpPackMode(void *sdp_handle, uint16_t level,
                          uint8_t cap_num, uint16_t inst_num, uint16_t *val);
 /**
  * Gets the value of the fmtp attribute- level asymmetry allowed parameter for H.264 codec
  *
- * @param[in]  sdp_handle     The SDP handle 
+ * @param[in]  sdp_handle     The SDP handle
  * @param[in]  level       The level to check for the attribute.
  * @param[in]  cap_num     The capability number associated with the attribute if any.  If none, should be zero.
  * @param[in]  inst_num    The attribute instance number to check.
@@ -286,11 +251,11 @@ sdp_result_e ccsdpAttrGetFmtpPackMode(void *sdp_handle, uint16_t level,
  *
  * @return     sdp_result_e         SDP_SUCCESS = SUCCESS
  */
-sdp_result_e ccsdpAttrGetFmtpLevelAsymmetryAllowed(void *sdp_handle, uint16_t level, 
+sdp_result_e ccsdpAttrGetFmtpLevelAsymmetryAllowed(void *sdp_handle, uint16_t level,
                          uint8_t cap_num, uint16_t inst_num, uint16_t *val);
 
 
-/** 
+/**
  * Gets the value of the fmtp attribute- profile-level-id parameter for H.264 codec
  *
  * @param[in]  sdp_handle     The SDP handle returned by sdp_init_description.
@@ -303,10 +268,10 @@ sdp_result_e ccsdpAttrGetFmtpLevelAsymmetryAllowed(void *sdp_handle, uint16_t le
 const char* ccsdpAttrGetFmtpProfileLevelId (void *sdp_handle, uint16_t level,
                                           uint8_t cap_num, uint16_t inst_num);
 
-/** 
+/**
  * Gets the value of the fmtp attribute- max-mbps parameter for H.264 codec
  *
- * @param[in] sdp_handle     The SDP handle 
+ * @param[in] sdp_handle     The SDP handle
  * @param[in] level       The level to check for the attribute.
  * @param[in] cap_num     The capability number associated with the
  *                          attribute if any.  If none, should be zero.
@@ -322,7 +287,7 @@ sdp_result_e ccsdpAttrGetFmtpMaxMbps (void *sdp_handle, uint16_t level,
 /**
  * Gets the value of the fmtp attribute- max-fs parameter for H.264 codec
  *
- * @param[in] sdp_handle     The SDP handle 
+ * @param[in] sdp_handle     The SDP handle
  * @param[in] level       The level to check for the attribute.
  * @param[in] cap_num     The capability number associated with the
  *                          attribute if any.  If none, should be zero.
@@ -347,7 +312,7 @@ sdp_result_e ccsdpAttrGetFmtpMaxFs (void *sdp_handle, uint16_t level,
 sdp_result_e ccsdpAttrGetFmtpMaxCpb (void *sdp_handle, uint16_t level,
                                  uint8_t cap_num, uint16_t inst_num, uint32_t *val);
 
-/** 
+/**
  * Gets the value of the fmtp attribute- max-br parameter for H.264 codec
  *
  * @param[in] sdp_handle     The SDP handle
@@ -361,7 +326,7 @@ sdp_result_e ccsdpAttrGetFmtpMaxCpb (void *sdp_handle, uint16_t level,
 sdp_result_e ccsdpAttrGetFmtpMaxBr (void *sdp_handle, uint16_t level,
                              uint8_t cap_num, uint16_t inst_num, uint32_t* val);
 
-/** 
+/**
  * Returns the bandwidth value parameter from the b= line.
  *
  * @param[in] sdp_handle     The SDP handle
@@ -373,8 +338,8 @@ sdp_result_e ccsdpAttrGetFmtpMaxBr (void *sdp_handle, uint16_t level,
  */
 int ccsdpGetBandwidthValue (void *sdp_handle, uint16_t level, uint16_t inst_num);
 
-/** 
- * Add a new attribute of the specified type at the given level and capability 
+/**
+ * Add a new attribute of the specified type at the given level and capability
  * level or base attribute if cap_num is zero.
  *
  * @param[in] sdp_handle     The SDP handle
@@ -383,7 +348,7 @@ int ccsdpGetBandwidthValue (void *sdp_handle, uint16_t level, uint16_t inst_num)
  * @param[in] attr_type   The type of attribute to add.
  * @param[in] inst_num    Pointer to a uint16_t in which to return the instance number of the newly added attribute.
  *
- * @return     sdp_result_e       
+ * @return     sdp_result_e
  * 		SDP_SUCCESS            Attribute was added successfully.
  *              SDP_NO_RESOURCE        No memory avail for new attribute.
  *              SDP_INVALID_PARAMETER  Specified media line is not defined.
@@ -391,16 +356,16 @@ int ccsdpGetBandwidthValue (void *sdp_handle, uint16_t level, uint16_t inst_num)
 sdp_result_e ccsdpAddNewAttr (void *sdp_handle, uint16_t level, uint8_t cap_num,
                                sdp_attr_e attr_type, uint16_t *inst_num);
 
-/** 
+/**
  * Gets the value of the fmtp attribute- max-dpb parameter for H.264 codec
  *
- * @param[in] sdp_handle     The SDP handle 
+ * @param[in] sdp_handle     The SDP handle
  * @param[in] level       The level to check for the attribute.
  * @param[in] cap_num     The capability number associated with the attribute if any.  If none, should be zero.
  * @param[in] inst_num    The attribute instance number to check.
  * @param[out] *val       max-dpb value.
  *
- * @return     sdp_result_e       
+ * @return     sdp_result_e
  * 		SDP_SUCCESS            Attribute was added successfully.
  */
 
@@ -408,7 +373,7 @@ sdp_result_e ccsdpAttrGetFmtpMaxDpb (void *sdp_handle, uint16_t level,
                                uint8_t cap_num, uint16_t inst_num, uint32_t *val);
 
 
-/** 
+/**
  * Sets the value of the fmtp attribute payload type parameter for the given attribute.
  *
  * @param[in] sdp_handle     The SDP handle
diff --git a/media/webrtc/signaling/src/sipcc/include/config_api.h b/media/webrtc/signaling/src/sipcc/include/config_api.h
index 508eb062bc56..34e54e9a564a 100644
--- a/media/webrtc/signaling/src/sipcc/include/config_api.h
+++ b/media/webrtc/signaling/src/sipcc/include/config_api.h
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef _CONFIG_API_H_
 #define _CONFIG_API_H_
@@ -45,15 +10,15 @@
 
 /**
  * configFetchReq
- * 
- * This function tells the config manager to fetch the CTL file 
- * and then fetch the config  from the CUCM. It is expected that 
+ *
+ * This function tells the config manager to fetch the CTL file
+ * and then fetch the config  from the CUCM. It is expected that
  * this will result in processing of
  * the config file after the config managers response is received.
  *
- * The response received for this request is asynchronous and 
+ * The response received for this request is asynchronous and
  * should be handled via event provided by config manager.
- * The CCAPI_Config_reponse api needs to be called for the 
+ * The CCAPI_Config_reponse api needs to be called for the
  * handling of the response to the fetch request
  *
  */
@@ -66,7 +31,7 @@ void configFetchReq(int device_handle);
  * and a new config file needs to be downloaded.
  *
  * The error could be XML format error or minimum config not being
- * present in the config file.  It is expected that 
+ * present in the config file.  It is expected that
  * this will result in processing of
  * the config file after the config managers response is received.
  *
@@ -116,29 +81,29 @@ void configApplyConfigNotify(cc_string_t config_version,
 
 /**
  * dialPlanFetchReq
- * 
+ *
  * This function tells the get file request service to fetch the latest dial
  * plan from the CUCM.
  *
  * @param device_handle [in] handle of the device, the response is for
- * @param dialPlanFileName [in] the name of dialplan file to retrieve 
+ * @param dialPlanFileName [in] the name of dialplan file to retrieve
  * @return cc_boolean indicating success/failure
  *
  */
-cc_boolean dialPlanFetchReq(int device_handle, char* dialPlanFileName); 
+cc_boolean dialPlanFetchReq(int device_handle, char* dialPlanFileName);
 
 /**
  * fcpFetchReq
- * 
+ *
  * This function tells the get file request service to fetch the latest fcp
  * file from the CUCM.
  *
  * @param device_handle [in] handle of the device, the response is for
- * @param dialPlanFileName [in] the name of fcp file to retrieve 
+ * @param dialPlanFileName [in] the name of fcp file to retrieve
 *  @return cc_boolean indicating success/failure
  *
  */
-cc_boolean fcpFetchReq(int device_handle, char* fcpFileName); 
+cc_boolean fcpFetchReq(int device_handle, char* fcpFileName);
 
 
 cc_boolean CCAPI_Config_set_server_address(const char *ip_address);
diff --git a/media/webrtc/signaling/src/sipcc/include/dns_util.h b/media/webrtc/signaling/src/sipcc/include/dns_util.h
index 8da267d25db9..844fd72340fc 100644
--- a/media/webrtc/signaling/src/sipcc/include/dns_util.h
+++ b/media/webrtc/signaling/src/sipcc/include/dns_util.h
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  *  @section DNS APIS
diff --git a/media/webrtc/signaling/src/sipcc/include/peer_connection_types.h b/media/webrtc/signaling/src/sipcc/include/peer_connection_types.h
index b19918108706..e1fa8a864881 100644
--- a/media/webrtc/signaling/src/sipcc/include/peer_connection_types.h
+++ b/media/webrtc/signaling/src/sipcc/include/peer_connection_types.h
@@ -1,38 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef _PEER_CONNECTION_TYPES_H_
 #define _PEER_CONNECTION_TYPES_H_
diff --git a/media/webrtc/signaling/src/sipcc/include/plat_api.h b/media/webrtc/signaling/src/sipcc/include/plat_api.h
index 603f68313a80..a3f9ab464e27 100644
--- a/media/webrtc/signaling/src/sipcc/include/plat_api.h
+++ b/media/webrtc/signaling/src/sipcc/include/plat_api.h
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef _PLAT_API_H_
 #define _PLAT_API_H_
@@ -206,7 +171,7 @@ typedef enum
 } cc_debug_clear_cpr_options_e;
 
 /**
-  * cpr memory show sub-commands 
+  * cpr memory show sub-commands
   */
 typedef enum
 {
@@ -418,7 +383,7 @@ boolean platGetMWIStatus(cc_lineid_t line);
 
 /**
  * Check if the speaker or headset is enabled.
- * 
+ *
  * @return boolean if the speaker or headset is enabled, returns true.
  */
 boolean platGetSpeakerHeadsetMode();
@@ -475,12 +440,12 @@ plat_soc_status_e platSecIsServerSecure(void);
  * If mode == TRUE (blocking):
  *    int secEstablishSecureConnection(const char* serverAddr, *uint32_t port, secConnectionType type)
  *    @li ipMode is UNUSED
- *    @li "host" maps to "serverAddr", "type" should be determined by an application and use the value from SecServerType. 
+ *    @li "host" maps to "serverAddr", "type" should be determined by an application and use the value from SecServerType.
  *    @li localPort is passed in as 0
  * If mode == FALSE (non-blocking):
  *     int secConnect(const char* serverAddr, uint32_t port, *secConnectionType type, uint32_t localPort)
  *    @li ipMode is UNUSED
- *    @li "host" maps to "serverAddr", "type" should be determined by an application and use the value from SecServerType. 
+ *    @li "host" maps to "serverAddr", "type" should be determined by an application and use the value from SecServerType.
  *
  * @note The implementation should use the "setsockopt" to set the "tos" value passed
  * in this API on the created socket.
@@ -711,11 +676,11 @@ void platSetStatusMessage(char *msg);
  * This function MUST be implemented by the vendors. This is called by the core
  * library whenever some debugging information needs to be printed out.
  * call this function in order to clear the CPR Memory/Tracking statistics
- * 
+ *
  * Please also be aware that cpr_stdio.h has other logging functions as well.
  * Vendors need to implement this function and the functions (err_msg,
  * buginf....etc) found in cpr_stdio.h
- * 
+ *
  * @param[in] _format  format string
  * @param[in] ...     variable arg list
  *
@@ -745,7 +710,7 @@ int platGetAudioDeviceStatus(plat_audio_device_t device_type);
 
 /*
  * Returns the default gateway
- * 
+ *
  * @param void
  * @return u_long
  */
diff --git a/media/webrtc/signaling/src/sipcc/include/reset_api.h b/media/webrtc/signaling/src/sipcc/include/reset_api.h
index b7c2e1d74161..dc629d0b9a7b 100644
--- a/media/webrtc/signaling/src/sipcc/include/reset_api.h
+++ b/media/webrtc/signaling/src/sipcc/include/reset_api.h
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef _RESET_API_H_
 #define _RESET_API_H_
@@ -43,28 +8,28 @@
 
 /**
  * resetRequest
- * 
+ *
  * This function tells the reset Manager that the SIPCC module
  * wants to do a HARD RESET. This is most likely because of a request
  * from the CUCM.
  *
- * The response received for this request is asynchronous and 
+ * The response received for this request is asynchronous and
  * should be handled via event provided by reset manager.
- * The CCAPI_Service_shutdown api needs to be called for the 
+ * The CCAPI_Service_shutdown api needs to be called for the
  * handling of the response to the reset request
  *
  */
-void resetRequest(); 
+void resetRequest();
 
 
 /**
  * resetReady
- * 
- * This function tells the reset manager that call control is 
+ *
+ * This function tells the reset manager that call control is
  * ready for reset. This is called whenever the call control
  * determines that it is idle
- * 
- * The resetManager will keep track of events can initate 
+ *
+ * The resetManager will keep track of events can initate
  * reset when it has received ready.
  *
  */
@@ -72,12 +37,12 @@ void resetReady();
 
 /**
  * resetNotReady
- * 
- * This function tells the reset manager that call control is 
+ *
+ * This function tells the reset manager that call control is
  * NOT ready for reset. This is called whenever the call control
  * is not idle
- * 
- * The resetManager will keep track of events  and it CANNOT initate 
+ *
+ * The resetManager will keep track of events  and it CANNOT initate
  * reset until a resetReady event is received
  *
  */
diff --git a/media/webrtc/signaling/src/sipcc/include/sll_lite.h b/media/webrtc/signaling/src/sipcc/include/sll_lite.h
index 123fb7539be9..ee7f20b9911e 100644
--- a/media/webrtc/signaling/src/sipcc/include/sll_lite.h
+++ b/media/webrtc/signaling/src/sipcc/include/sll_lite.h
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef _SLL_LITE_H
 #define _SLL_LITE_H
@@ -52,7 +17,7 @@ typedef struct sll_lite_node_t_ {
  * List control structure
  */
 typedef struct sll_lite_list_t_ {
-    uint16_t        count;    /* number of elements on the list    */ 
+    uint16_t        count;    /* number of elements on the list    */
     sll_lite_node_t *head_p;  /* pointer to the head or first node */
     sll_lite_node_t *tail_p;  /* pointer to the tail or last node  */
 } sll_lite_list_t;
@@ -79,15 +44,15 @@ typedef enum {
 #define SLL_LITE_NODE_COUNT(link) \
      (((sll_lite_list_t *)link)->count)
 
-/** 
+/**
  * sll_lite_init initializes list control structure given by the
  * caller.
  *
  * @param[in] list - pointer to the list control structure
  *                  sll_lite_list_t
  *
- * @return        - SLL_LITE_RET_SUCCESS for success 
- *                - SLL_LITE_RET_INVALID_ARGS when arguments are 
+ * @return        - SLL_LITE_RET_SUCCESS for success
+ *                - SLL_LITE_RET_INVALID_ARGS when arguments are
  *                  invalid.
  */
 extern sll_lite_return_e
@@ -104,7 +69,7 @@ sll_lite_init(sll_lite_list_t *list);
  * @return        - SLL_LITE_RET_SUCCESS for success
  *                - SLL_LITE_RET_INVALID_ARGS when arguments are
  *                  invalid.
- */ 
+ */
 extern sll_lite_return_e
 sll_lite_link_head(sll_lite_list_t *list, sll_lite_node_t *node);
 
@@ -125,7 +90,7 @@ sll_lite_link_tail(sll_lite_list_t *list, sll_lite_node_t *node);
 
 /**
  * sll_lite_unlink_head removes head node from the head of the list and
- * returns it to the caller. 
+ * returns it to the caller.
  *
  * @param[in] list - pointer to the list control structure
  *                  sll_lite_list_t. The list must be
diff --git a/media/webrtc/signaling/src/sipcc/include/vcm.h b/media/webrtc/signaling/src/sipcc/include/vcm.h
index d67d8201e1cb..c3a61f71162d 100755
--- a/media/webrtc/signaling/src/sipcc/include/vcm.h
+++ b/media/webrtc/signaling/src/sipcc/include/vcm.h
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /** @section vcm  VCM APIs
  *
@@ -64,7 +29,7 @@
  */
 //The result maps to RTP payload type for using internally.
 #define GET_DYNAMIC_PAY_LOAD_TYPE(payload) (payload>>16)
-//The result maps to the enum vcm_media_payload_type_t. 
+//The result maps to the enum vcm_media_payload_type_t.
 #define GET_MEDIA_PAYLOAD_TYPE_ENUM(payload) (payload & 0xFFFF)
 
 /** Evaluates to TRUE for audio media streams where id is the mcap_id of the given stream */
@@ -448,7 +413,7 @@ void vcmRxAllocICE(cc_mcapid_t mcap_id,
         cc_streamid_t stream_id,
         cc_call_handle_t  call_handle,
         const char *peerconnection,
-        uint16_t level,  
+        uint16_t level,
         char **default_addr, /* Out */
         int *default_port, /* Out */
         char ***candidates, /* Out */
@@ -467,7 +432,7 @@ void vcmRxAllocICE(cc_mcapid_t mcap_id,
 void vcmGetIceParams(const char *peerconnection, char **ufragp, char **pwdp);
 
 /* Set remote ICE global parameters.
- * 
+ *
  *  @param[in]  peerconnection - the peerconnection in use
  *  @param[in]  ufrag - the ufrag
  *  @param[in]  pwd - the pwd
@@ -487,7 +452,7 @@ short vcmSetIceSessionParams(const char *peerconnection, char *ufrag, char *pwd)
 short vcmSetIceCandidate(const char *peerconnection, const char *icecandidate, uint16_t level);
 
 /* Set remote ICE media-level parameters.
- * 
+ *
  *  @param[in]  peerconnection - the peerconnection in use
  *  @param[in]  level - the m-line
  *  @param[in]  ufrag - the ufrag
@@ -514,7 +479,7 @@ short vcmStartIceChecks(const char *peerconnection);
  *  @param[in] mcap_id - group identifier to which stream belongs.
  *  @param[in]  peerconnection - the peerconnection in use
  *  @param[out] pc_stream_id - the id of the allocated stream
- * 
+ *
  *  TODO(ekr@rtfm.com): Revise along with everything else for the
  *  new stream model.
  *
@@ -591,7 +556,7 @@ int vcmRxStart(cc_mcapid_t mcap_id,
  *  @param[in]   call_handle  - call handle
  *  @param[in]   peerconnection - the peerconnection in use
  *  @param[in]   num_payloads  - number of codecs negotiated
- *  @param[in]   payloads      - list of negotiated codec details 
+ *  @param[in]   payloads      - list of negotiated codec details
  *  @param[in]   fingerprint_alg - the DTLS fingerprint algorithm
  *  @param[in]   fingerprint  - the DTLS fingerprint
  *  @param[in]   attrs        - media attributes
@@ -609,7 +574,7 @@ int vcmRxStartICE(cc_mcapid_t mcap_id,
         cc_call_handle_t  call_handle,
         const char *peerconnection,
         int num_payloads,
-        const vcm_media_payload_type_t* payloads,        
+        const vcm_media_payload_type_t* payloads,
         const char *fingerprint_alg,
         const char *fingerprint,
         vcm_mediaAttrs_t *attrs);
@@ -833,9 +798,9 @@ void vcmControlRinger(vcm_ring_mode_t ringMode,
 
 /**
  * Get current list of audio codec that could be used
- * @param request_type - 
+ * @param request_type -
  * The request_type should be VCM_DECODEONLY/ENCODEONLY/FULLDUPLEX/IGNORE
- * 
+ *
  * @return A bit mask should be returned that specifies the list of the audio
  * codecs. The bit mask should conform to the defines in this file.
  * #define VCM_RESOURCE_G711     0x00000001
@@ -847,7 +812,7 @@ int vcmGetAudioCodecList(int request_type);
 
 /**
  * Get current list of video codec that could be used
- * @param request_type - 
+ * @param request_type -
  * The request_type should be VCM_DECODEONLY/ENCODEONLY/FULLDUPLEX/IGNORE
  *
  * @return A bit mask should be returned that specifies the list of the audio
@@ -860,7 +825,7 @@ int vcmGetAudioCodecList(int request_type);
 int vcmGetVideoCodecList(int request_type);
 
 /**
- * Get max supported H.264 video packetization mode. 
+ * Get max supported H.264 video packetization mode.
  * @return maximum supported video packetization mode for H.264. Value returned
  * must be 0 or 1. Value 2 is not supported yet.
  */
@@ -869,7 +834,7 @@ int vcmGetVideoMaxSupportedPacketizationMode();
 /**
  * Get the rx/tx stream statistics associated with the call.
  * The rx/tx stats are defined as comma seperated string as follows.
- * Rx_stats: 
+ * Rx_stats:
  *   snprintf(rx_stats, CC_KFACTOR_STAT_LEN,
  *               "Dur=%d,Pkt=%d,Oct=%d,LatePkt=%d,LostPkt=%d,AvgJit=%d,VQMetrics=\"%s\"",
  *               duration, numberOfPackageReceived, numberOfByteReceived, numberOfLatePackage, numberOfPackageLost, averageJitter, qualityMatrics);
@@ -1025,11 +990,11 @@ int vcmDtmfBurst(int digit, int duration, int direction);
 /**
  * vcmGetILBCMode
  *
- * This method should return the mode that needs to be used in 
+ * This method should return the mode that needs to be used in
  * SDP
  * @return int
  */
-int vcmGetILBCMode(); 
+int vcmGetILBCMode();
 
 //Using C++ for gips. This is the end of extern "C" above.
 #ifdef __cplusplus
@@ -1037,6 +1002,6 @@ int vcmGetILBCMode();
 #endif
 
 
-  
+
 
 #endif /* _VCM_H_ */
diff --git a/media/webrtc/signaling/src/sipcc/include/xml_parser_defines.h b/media/webrtc/signaling/src/sipcc/include/xml_parser_defines.h
index 83044ca1c9fa..114b168026c7 100644
--- a/media/webrtc/signaling/src/sipcc/include/xml_parser_defines.h
+++ b/media/webrtc/signaling/src/sipcc/include/xml_parser_defines.h
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef XML_PARSER_DEFINES_H
 #define XML_PARSER_DEFINES_H
@@ -45,8 +10,8 @@
 
 
 /**
- * In general, when a parser constructs a xml string, 
- * it should translate the enum to cooresponding string 
+ * In general, when a parser constructs a xml string,
+ * it should translate the enum to cooresponding string
  * value that is defined in the accompanied xsd files.
  */
 /**
@@ -237,8 +202,8 @@ typedef enum {
 
 typedef signed long         xml_signed32;
 typedef unsigned long       xml_unsigned32;
-typedef unsigned short      xml_unsigned16; 
-typedef unsigned char       xml_unsigned8;  
+typedef unsigned short      xml_unsigned16;
+typedef unsigned char       xml_unsigned8;
 
 // start of copy from ccsip_eventbodies.h
 typedef struct State {
@@ -668,4 +633,4 @@ void *ccAllocXML(cc_size_t size);
  * @return void
  */
 void ccFreeXML(void *mem);
-#endif 
+#endif
diff --git a/media/webrtc/signaling/src/sipcc/plat/common/dns_utils.c b/media/webrtc/signaling/src/sipcc/plat/common/dns_utils.c
index 7f01a0d03938..b6fdeca22ca3 100644
--- a/media/webrtc/signaling/src/sipcc/plat/common/dns_utils.c
+++ b/media/webrtc/signaling/src/sipcc/plat/common/dns_utils.c
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "cpr_ipc.h"
 #include "cpr_types.h"
@@ -50,7 +15,7 @@
 #include "util_string.h"
 
 #ifdef SIP_OS_WINDOWS
-cc_int32_t 
+cc_int32_t
 dnsGetHostByName (const char *hname,
                    cpr_ip_addr_t *ipaddr_ptr,
                    cc_int32_t timeout,
diff --git a/media/webrtc/signaling/src/sipcc/plat/common/plat_debug.h b/media/webrtc/signaling/src/sipcc/plat/common/plat_debug.h
index 574c070c6c13..e77b47f62293 100644
--- a/media/webrtc/signaling/src/sipcc/plat/common/plat_debug.h
+++ b/media/webrtc/signaling/src/sipcc/plat/common/plat_debug.h
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef __PLAT_DEBUG_H__
 #define __PLAT_DEBUG_H__
diff --git a/media/webrtc/signaling/src/sipcc/plat/common/tnp_blf.h b/media/webrtc/signaling/src/sipcc/plat/common/tnp_blf.h
index 550e3bfc9ccf..7e279ed7a462 100755
--- a/media/webrtc/signaling/src/sipcc/plat/common/tnp_blf.h
+++ b/media/webrtc/signaling/src/sipcc/plat/common/tnp_blf.h
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef _TNP_BLF_H
 #define _TNP_BLF_H
diff --git a/media/webrtc/signaling/src/sipcc/plat/csf2g/model.c b/media/webrtc/signaling/src/sipcc/plat/csf2g/model.c
index d1571d6e05e9..1d4ca47fb9e4 100644
--- a/media/webrtc/signaling/src/sipcc/plat/csf2g/model.c
+++ b/media/webrtc/signaling/src/sipcc/plat/csf2g/model.c
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 /**
diff --git a/media/webrtc/signaling/src/sipcc/plat/csf2g/reset_api.c b/media/webrtc/signaling/src/sipcc/plat/csf2g/reset_api.c
index 6bc5324185c1..35314bf2f454 100644
--- a/media/webrtc/signaling/src/sipcc/plat/csf2g/reset_api.c
+++ b/media/webrtc/signaling/src/sipcc/plat/csf2g/reset_api.c
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "phone_debug.h"
 
diff --git a/media/webrtc/signaling/src/sipcc/plat/darwin/netif.c b/media/webrtc/signaling/src/sipcc/plat/darwin/netif.c
index 917b331c7d4c..b64e36ef5778 100644
--- a/media/webrtc/signaling/src/sipcc/plat/darwin/netif.c
+++ b/media/webrtc/signaling/src/sipcc/plat/darwin/netif.c
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include 
 #include 
@@ -277,7 +242,7 @@
      * so that the caller has a guarantee that both address come from the same
      * network address.
      */
-    
+
 //    if (getifaddr2(AF_INET, (struct sockaddr *) &inaddr, sizeof(inaddr),
 //            &lladdr) != 0)
 //        /* XXX */
diff --git a/media/webrtc/signaling/src/sipcc/plat/darwin/plat_api_stub.c b/media/webrtc/signaling/src/sipcc/plat/darwin/plat_api_stub.c
index 027528d1a9a6..556ce1de830e 100755
--- a/media/webrtc/signaling/src/sipcc/plat/darwin/plat_api_stub.c
+++ b/media/webrtc/signaling/src/sipcc/plat/darwin/plat_api_stub.c
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include 
 
@@ -54,7 +19,7 @@ int platThreadInit(char * tname)
 }
 
 /**
- * The initial initialization function for any platform related 
+ * The initial initialization function for any platform related
  * modules
  *
  *
@@ -198,8 +163,8 @@ boolean platGetMWIStatus(cc_lineid_t line)
 
 /**
  * platSecIsServerSecure
- * 
- * @brief Lookup the secure status of the server 
+ *
+ * @brief Lookup the secure status of the server
  *
  * This function looks at the the CCM server type by using the security library
  * and returns appropriate indication to the pSIPCC.
@@ -207,7 +172,7 @@ boolean platGetMWIStatus(cc_lineid_t line)
  *
  * @return   Server is security enabled or not
  *           PLAT_SOCK_SECURE or PLAT_SOCK_NONSECURE
- *             
+ *
  * @note This API maps to the following HandyIron API:
  *  int secIsServerSecure(SecServerType type) where type should be SRVR_TYPE_CCM
  */
@@ -222,10 +187,10 @@ plat_soc_status_e platSecIsServerSecure(void)
  * @brief  Securely connect to a remote server
  *
  * This function uses the security library APIs to connect to a remote server.
- * @param[in]  host         server addr 
+ * @param[in]  host         server addr
  * @param[in]  port         port number
  * @param[in]  ipMode       IP mode to indicate v6, v4 or both
- * @param[in]  mode         blocking connect or not 
+ * @param[in]  mode         blocking connect or not
  *                          FALSE: non-blocking; TRUE: blocking
  * @param[in]  tos          TOS value
  * @param[in]  connectionType Are we talking to Call-Agent
@@ -239,23 +204,23 @@ plat_soc_status_e platSecIsServerSecure(void)
  *
  * @pre        (hostAndPort not_eq NULL)
  * @pre        (localPort   not_eq NULL)
- *             
+ *
  * @note localPort is undefined when the return value is INVALID_SOCKET
  *
  * @note This API maps to the HandyIron APIs as follows:
- * If mode == TRUE (blocking): 
+ * If mode == TRUE (blocking):
  *    int secEstablishSecureConnection(const char* serverAddr, *uint32_t port, secConnectionType type)
  *    @li ipMode is UNUSED
  *    @li "host" maps to "serverAddr", "connectionType" maps to "type"
  *    @li localPort is passed in as 0
- * If mode == FALSE (non-blocking): 
+ * If mode == FALSE (non-blocking):
  *     int secConnect(const char* serverAddr, uint32_t port, *secConnectionType type, uint32_t localPort)
  *    @li ipMode is UNUSED
  *    @li "host" maps to "serverAddr", "connectionType" maps to "type"
  *
  * @note The implementation should use the "setsockopt" to set the "tos" value passed
  * in this API on the created socket.
- *               
+ *
  */
 cpr_socket_t
 platSecSocConnect (char *host,
@@ -274,13 +239,13 @@ platSecSocConnect (char *host,
  * Determine the status of a secure connection that was initiated
  * in non-blocking mode
  *
- * @param[in]    sock   socket descriptor 
+ * @param[in]    sock   socket descriptor
  *
  * @return   connection status
  *           @li connection complete: PLAT_SOCK_CONN_OK
  *           @li connection waiting:  PLAT_SOCK_CONN_WAITING
  *           @li connection failed:   PLAT_SOCK_CONN_FAILED
- *               
+ *
  * @note This API maps to the following HandyIron API:
  * int secIsConnectionReady (int connDesc)
  * The "sock" is the connection descriptor.
@@ -337,9 +302,9 @@ platSecSocSend (cpr_socket_t soc,
  *
  * @brief The platSecSocRecv() function shall receive a message from a secure socket.
  *
- * This function is normally used with connected sockets because it does not permit 
+ * This function is normally used with connected sockets because it does not permit
  * the application to retrieve the source address of received data.  The
- * platSecSocRecv() function shall return the length of the message written to 
+ * platSecSocRecv() function shall return the length of the message written to
  * the buffer pointed to by the "buf" argument.
  *
  * @param[in] soc  - Specifies the socket to receive data
@@ -374,11 +339,11 @@ platSecSocRecv (cpr_socket_t soc,
  * @brief The platSecSocClose function shall close a secure socket
  *
  * The platSecSocClose() function shall destroy the socket descriptor indicated
- * by socket.  
+ * by socket.
  *
  * @param[in] soc  - The socket that needs to be destroyed
  *
- * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. 
+ * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case.
  *
  * @note The possible error values this function should return are
  *         @li [CPR_EBADF]      socket is not a valid socket descriptor.
@@ -464,7 +429,7 @@ int platGetAudioDeviceStatus(plat_audio_device_t device_type)
 
 /*
  * Returns the default gateway
- * 
+ *
  * @param void
  * @return u_long
  */
diff --git a/media/webrtc/signaling/src/sipcc/plat/unix-common/random.c b/media/webrtc/signaling/src/sipcc/plat/unix-common/random.c
index c7c36bf52e63..f84fc9a4a341 100644
--- a/media/webrtc/signaling/src/sipcc/plat/unix-common/random.c
+++ b/media/webrtc/signaling/src/sipcc/plat/unix-common/random.c
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include 
 #include 
@@ -68,7 +33,7 @@
  *             'len' will indicate how many bytes are actually being
  *             returned) on failure, its value will be set to 0.
  *
- * @return 
+ * @return
  *     1 - success.
  *     0 - fail.
  *
@@ -104,7 +69,7 @@ platGenerateCryptoRand(uint8_t *buf, int *len)
         *len = 0;
         rc = 0; /* Failure */
     }
-        
+
     (void) close(fd);
     return rc;
 }
diff --git a/media/webrtc/signaling/src/sipcc/plat/win32/dns_utils.c b/media/webrtc/signaling/src/sipcc/plat/win32/dns_utils.c
index 77b87033ab05..7c47d8a7be41 100644
--- a/media/webrtc/signaling/src/sipcc/plat/win32/dns_utils.c
+++ b/media/webrtc/signaling/src/sipcc/plat/win32/dns_utils.c
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "cpr_ipc.h"
 #include "cpr_types.h"
diff --git a/media/webrtc/signaling/src/sipcc/plat/win32/mystub.c b/media/webrtc/signaling/src/sipcc/plat/win32/mystub.c
index a2d5367fd2c8..1ea483669b3f 100755
--- a/media/webrtc/signaling/src/sipcc/plat/win32/mystub.c
+++ b/media/webrtc/signaling/src/sipcc/plat/win32/mystub.c
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifdef _DEBUG
 #define new DEBUG_NEW
@@ -93,7 +58,7 @@ enum AUDIOFLAGS {
     HEADSET_AUDIOFLAG              = 0x0001<<2,
     SPEAKER_ON_REQUEST_AUDIOFLAG   = 0x0001<<3,
     SPEAKER_OFF_REQUEST_AUDIOFLAG  = 0x0001<<4,
-    ANY_AUDIOFLAGS                 = (HANDSET_AUDIOFLAG      | 
+    ANY_AUDIOFLAGS                 = (HANDSET_AUDIOFLAG      |
                                       SPEAKERPHONE_AUDIOFLAG |
                                       HEADSET_AUDIOFLAG)
 };
@@ -116,23 +81,23 @@ void cfg_sanity_check_media_range (void)
 {
     int32_t start_port = 0;
     int32_t end_port = 0;
-    boolean changed = FALSE;  
+    boolean changed = FALSE;
 
-    config_get_value(CFGID_MEDIA_PORT_RANGE_START, 
+    config_get_value(CFGID_MEDIA_PORT_RANGE_START,
                      &start_port, sizeof(start_port));
-    config_get_value(CFGID_MEDIA_PORT_RANGE_END, 
+    config_get_value(CFGID_MEDIA_PORT_RANGE_END,
                      &end_port, sizeof(end_port));
-                     
+
     // Ensure that the ports are on an even port boundary
-    if (start_port & 0x1) {                  
+    if (start_port & 0x1) {
         start_port =  start_port & ~0x1;
         changed = TRUE;
     }
-    if (end_port & 0x1) { 
+    if (end_port & 0x1) {
         end_port = end_port & ~0x1;
         changed = TRUE;
     }
-                  
+
     /*
      * If the ranges are swapped, swap them for convenience here
      */
@@ -140,15 +105,15 @@ void cfg_sanity_check_media_range (void)
         unsigned int temp = end_port;
         end_port = start_port;
         start_port = temp;
-        changed = TRUE; 
+        changed = TRUE;
     }
-    
+
     if ((end_port - start_port) < 4) {
         start_port  = RTP_START_PORT;
         end_port = RTP_END_PORT;
-        changed = TRUE; 
+        changed = TRUE;
     }
-    
+
     /*
      * We are trying to ensure that the start_port and the end_port
      * are in the range of 0x4000 through and including 0x7ffe.
@@ -167,20 +132,20 @@ void cfg_sanity_check_media_range (void)
      */
     if ((start_port < RTP_START_PORT) || (start_port > (RTP_END_PORT - 4))) {
         start_port = RTP_START_PORT;
-        changed = TRUE; 
+        changed = TRUE;
     }
 
     if ((end_port < (RTP_START_PORT + 4)) || (end_port > RTP_END_PORT)) {
         end_port = RTP_END_PORT;
-        changed = TRUE; 
-    } 
-    
+        changed = TRUE;
+    }
+
     if (changed) {
-        config_set_value(CFGID_MEDIA_PORT_RANGE_START, 
+        config_set_value(CFGID_MEDIA_PORT_RANGE_START,
                          &start_port, sizeof(start_port));
-        config_set_value(CFGID_MEDIA_PORT_RANGE_END, 
+        config_set_value(CFGID_MEDIA_PORT_RANGE_END,
                          &end_port, sizeof(end_port));
-    }      
+    }
 }
 
 
@@ -197,7 +162,7 @@ static debug_entry_t debug_table[MAX_DEBUG_CMDS];
 
 /*================================================================
  * From timer_platform.c which used to be included and needs to be FIXED
- *===============================================================*/	
+ *===============================================================*/
 
 
 extern struct tm *gmtime_r(const time_t *timer, struct tm *pts)
@@ -252,7 +217,7 @@ unsigned long seconds_to_gmt_string (unsigned long seconds, char *gmt_string)
 int PhoneAudioFlags = NO_AUDIOFLAGS;
 
 #include "lsm.h"
-void OnTerminateCall() 
+void OnTerminateCall()
 {
 	terminate_active_calls();
 }
diff --git a/media/webrtc/signaling/src/sipcc/plat/win32/plat_api_stub.c b/media/webrtc/signaling/src/sipcc/plat/win32/plat_api_stub.c
index e3ce82e18fa5..19df86e33524 100644
--- a/media/webrtc/signaling/src/sipcc/plat/win32/plat_api_stub.c
+++ b/media/webrtc/signaling/src/sipcc/plat/win32/plat_api_stub.c
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "cpr_types.h"
 #include "cc_constants.h"
@@ -54,7 +19,7 @@ int sipcc_platThreadInit(char * tname)
 }
 
 /**
- * The initial initialization function for any platform related 
+ * The initial initialization function for any platform related
  * modules
  *
  *
@@ -195,8 +160,8 @@ boolean sipcc_platGetMWIStatus(cc_lineid_t line)
 
 /**
  * platSecIsServerSecure
- * 
- * @brief Lookup the secure status of the server 
+ *
+ * @brief Lookup the secure status of the server
  *
  * This function looks at the the CCM server type by using the security library
  * and returns appropriate indication to the pSIPCC.
@@ -204,7 +169,7 @@ boolean sipcc_platGetMWIStatus(cc_lineid_t line)
  *
  * @return   Server is security enabled or not
  *           PLAT_SOCK_SECURE or PLAT_SOCK_NONSECURE
- *             
+ *
  * @note This API maps to the following HandyIron API:
  *  int secIsServerSecure(SecServerType type) where type should be SRVR_TYPE_CCM
  */
@@ -219,10 +184,10 @@ plat_soc_status_e sipcc_platSecIsServerSecure(void)
  * @brief  Securely connect to a remote server
  *
  * This function uses the security library APIs to connect to a remote server.
- * @param[in]  host         server addr 
+ * @param[in]  host         server addr
  * @param[in]  port         port number
  * @param[in]  ipMode       IP mode to indicate v6, v4 or both
- * @param[in]  mode         blocking connect or not 
+ * @param[in]  mode         blocking connect or not
  *                          FALSE: non-blocking; TRUE: blocking
  * @param[in]  tos          TOS value
  * @param[in]  connectionType Are we talking to Call-Agent
@@ -236,23 +201,23 @@ plat_soc_status_e sipcc_platSecIsServerSecure(void)
  *
  * @pre        (hostAndPort not_eq NULL)
  * @pre        (localPort   not_eq NULL)
- *             
+ *
  * @note localPort is undefined when the return value is INVALID_SOCKET
  *
  * @note This API maps to the HandyIron APIs as follows:
- * If mode == TRUE (blocking): 
+ * If mode == TRUE (blocking):
  *    int secEstablishSecureConnection(const char* serverAddr, *uint32_t port, secConnectionType type)
  *    @li ipMode is UNUSED
  *    @li "host" maps to "serverAddr", "connectionType" maps to "type"
  *    @li localPort is passed in as 0
- * If mode == FALSE (non-blocking): 
+ * If mode == FALSE (non-blocking):
  *     int secConnect(const char* serverAddr, uint32_t port, *secConnectionType type, uint32_t localPort)
  *    @li ipMode is UNUSED
  *    @li "host" maps to "serverAddr", "connectionType" maps to "type"
  *
  * @note The implementation should use the "setsockopt" to set the "tos" value passed
  * in this API on the created socket.
- *               
+ *
  */
 cpr_socket_t
 sipcc_platSecSocConnect (char *host,
@@ -271,13 +236,13 @@ sipcc_platSecSocConnect (char *host,
  * Determine the status of a secure connection that was initiated
  * in non-blocking mode
  *
- * @param[in]    sock   socket descriptor 
+ * @param[in]    sock   socket descriptor
  *
  * @return   connection status
  *           @li connection complete: PLAT_SOCK_CONN_OK
  *           @li connection waiting:  PLAT_SOCK_CONN_WAITING
  *           @li connection failed:   PLAT_SOCK_CONN_FAILED
- *               
+ *
  * @note This API maps to the following HandyIron API:
  * int secIsConnectionReady (int connDesc)
  * The "sock" is the connection descriptor.
@@ -292,8 +257,8 @@ plat_soc_connect_status_e sipcc_platSecSockIsConnected (cpr_socket_t sock)
  * @brief Generates a Random Number
  *
  * Generate crypto graphically random number for a desired length.
- * The function is expected to be much slower than the cpr_rand(). 
- * This function should be used when good random number is needed 
+ * The function is expected to be much slower than the cpr_rand().
+ * This function should be used when good random number is needed
  * such as random number that to be used for SRTP key for an example.
  *
  * @param[in] buf  - pointer to the buffer to store the result of random
@@ -310,7 +275,7 @@ plat_soc_connect_status_e sipcc_platSecSockIsConnected (cpr_socket_t sock)
  *             'len' will indicate how many bytes are actually being
  *             returned) on failure, its value will be set to 0.
  *
- * @return 
+ * @return
  *     1 - success.
  *     0 - fail.
  *
@@ -375,9 +340,9 @@ platSecSocSend (cpr_socket_t soc,
  *
  * @brief The platSecSocRecv() function shall receive a message from a secure socket.
  *
- * This function is normally used with connected sockets because it does not permit 
+ * This function is normally used with connected sockets because it does not permit
  * the application to retrieve the source address of received data.  The
- * platSecSocRecv() function shall return the length of the message written to 
+ * platSecSocRecv() function shall return the length of the message written to
  * the buffer pointed to by the "buf" argument.
  *
  * @param[in] soc  - Specifies the socket to receive data
@@ -412,11 +377,11 @@ platSecSocRecv (cpr_socket_t soc,
  * @brief The platSecSocClose function shall close a secure socket
  *
  * The platSecSocClose() function shall destroy the socket descriptor indicated
- * by socket.  
+ * by socket.
  *
  * @param[in] soc  - The socket that needs to be destroyed
  *
- * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case. 
+ * @return CPR_SUCCESS on success otherwise, CPR_FAILURE. cpr_errno needs to be set in this case.
  *
  * @note The possible error values this function should return are
  *         @li [CPR_EBADF]      socket is not a valid socket descriptor.
@@ -532,7 +497,7 @@ void sipcc_NotifyStateChange(callid_t callid, int32_t state)
 
 /*
  * Returns the default gateway
- * 
+ *
  * @param void
  * @return u_long
  */
diff --git a/media/webrtc/signaling/src/sipcc/plat/win32/plat_api_win.c b/media/webrtc/signaling/src/sipcc/plat/win32/plat_api_win.c
index eb0d78bb0939..c25a8b095094 100644
--- a/media/webrtc/signaling/src/sipcc/plat/win32/plat_api_win.c
+++ b/media/webrtc/signaling/src/sipcc/plat/win32/plat_api_win.c
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "cpr_ipc.h"
 #include "cpr_types.h"
@@ -52,7 +17,7 @@ char* sipcc_platGetIPAddr (void) {
 	char szHostName[128] = "";
 	struct sockaddr_in SocketAddress;
 	struct hostent     *pHost        = 0;
-	
+
 
 	WSADATA WSAData;
 
@@ -62,7 +27,7 @@ char* sipcc_platGetIPAddr (void) {
 		return "";
 	}
 
-	
+
 	if(gethostname(szHostName, sizeof(szHostName)))
 	{
 	  // Error handling -> call 'WSAGetLastError()'
diff --git a/media/webrtc/signaling/src/sipcc/stub/cc_blf_stub.c b/media/webrtc/signaling/src/sipcc/stub/cc_blf_stub.c
index 3f6d7b1042d9..ef7beabfd426 100755
--- a/media/webrtc/signaling/src/sipcc/stub/cc_blf_stub.c
+++ b/media/webrtc/signaling/src/sipcc/stub/cc_blf_stub.c
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "cc_constants.h"
 
diff --git a/media/webrtc/signaling/src/sipcc/stub/vcm_stub.c b/media/webrtc/signaling/src/sipcc/stub/vcm_stub.c
index 2894aa2d0bab..f7046231bd60 100755
--- a/media/webrtc/signaling/src/sipcc/stub/vcm_stub.c
+++ b/media/webrtc/signaling/src/sipcc/stub/vcm_stub.c
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /** @mainpage VCM APIs.
  *
@@ -48,7 +13,7 @@
  * @brief  APIs to interface with the Media layer.
  *
  * This file contains API that interface to the media layer on the platform.
- * The following APIs need to be implemented to have the sip stack interact 
+ * The following APIs need to be implemented to have the sip stack interact
  * and issue commands to the media layer.
  */
 
@@ -58,7 +23,7 @@
 #include "ccsdp.h"
 
 
-/** 
+/**
  *  The initialization of the VCM module
  *
  */
@@ -67,7 +32,7 @@ void vcmInit()
     return ;
 }
 
-/** 
+/**
  *   Should we remove this from external API
  *
  *  @param[in] mcap_id - group identifier to which stream belongs.
@@ -91,7 +56,7 @@ short vcmRxOpen(cc_mcapid_t mcap_id, cc_groupid_t group_id, cc_streamid_t stream
 {
     return 0;
 }
-/*! 
+/*!
  *  should we remove from external API
  *
  *  @param[in]  mcap_id - Media Capability ID
@@ -108,7 +73,7 @@ short vcmTxOpen(cc_mcapid_t mcap_id, cc_groupid_t group_id, cc_streamid_t stream
     return 0;
 }
 
-/*! 
+/*!
  *  Allocate(Reserve) a receive port.
  *
  *  @param[in]  mcap_id - Media Capability ID
@@ -410,7 +375,7 @@ int vcmGetRtpStats(cc_mcapid_t mcap_id, cc_groupid_t group_id,
  * media API into wlan to get the call bandwidth. The function
  * return is asynchronous and will block till the return media
  * callback signals to continue the execution.
- * 
+ *
  * @note If not using WLAN interface simply return true
  *
  * @return true if the bandwidth can be allocated else false.
@@ -425,7 +390,7 @@ boolean vcmAllocateBandwidth(cc_call_handle_t call_handle, int sessions)
 
 /**
  *
- * Free the bandwidth allocated for this call 
+ * Free the bandwidth allocated for this call
  * using the vcmAllocateBandwidth API
  *
  * @note  If not using WLAN provide a stub
@@ -503,11 +468,11 @@ void vcmSetRtcpDscp(cc_groupid_t group_id, int dscp)
 /**
  * Verify if the SDP attributes for the requested video codec are acceptable
  *
- * This method is called for video codecs only. This method should parse the 
- * Video SDP attributes using the SDP helper API and verify if received 
- * attributes are acceptable. If the attributes are acceptable any attribute 
- * values if needed by vcmTxStart method should be bundled in the desired 
- * structure and its pointer should be returned in rccappptr. This opaque 
+ * This method is called for video codecs only. This method should parse the
+ * Video SDP attributes using the SDP helper API and verify if received
+ * attributes are acceptable. If the attributes are acceptable any attribute
+ * values if needed by vcmTxStart method should be bundled in the desired
+ * structure and its pointer should be returned in rccappptr. This opaque
  * pointer shall be provided again when vcmTxStart is invoked.
  *
  * @param [in] media_type - codec for which we are negotiating
@@ -524,10 +489,10 @@ boolean vcmCheckAttribs(uint32_t media_type, void *sdp_p, int level, void **rcap
 }
 
 /**
- * Add Video attributes in the offer/answer SDP 
+ * Add Video attributes in the offer/answer SDP
  *
  * This method is called for video codecs only. This method should populate the
- * Video SDP attributes using the SDP helper API 
+ * Video SDP attributes using the SDP helper API
  *
  * @param [in] sdp_p - opaque SDP pointer to be used via SDP helper APIs
  * @param [in] level - Parameter to be used with SDP helper APIs
diff --git a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCall.cpp b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCall.cpp
index 83cc2d82074d..10671e7ddcd3 100644
--- a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCall.cpp
+++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCall.cpp
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "CC_Common.h"
 
@@ -61,15 +26,15 @@ static const char* logTag = "CC_SIPCCCall";
 
 CSF_IMPLEMENT_WRAP(CC_SIPCCCall, cc_call_handle_t);
 
-CC_SIPCCCall::CC_SIPCCCall (cc_call_handle_t aCallHandle) : 
-            callHandle(aCallHandle),  
+CC_SIPCCCall::CC_SIPCCCall (cc_call_handle_t aCallHandle) :
+            callHandle(aCallHandle),
             pMediaData(new CC_SIPCCCallMediaData(NULL,false,false,-1)),
             m_lock("CC_SIPCCCall")
 {
     CSFLogInfoS( logTag, "Creating  CC_SIPCCCall " << callHandle );
-    
+
     AudioControl * audioControl = VcmSIPCCBinding::getAudioControl();
-    
+
     if(audioControl)
     {
          pMediaData->volume = audioControl->getDefaultVolume();
@@ -105,14 +70,14 @@ void CC_SIPCCCall::setRemoteWindow (VideoWindowHandle window)
         CSFLogWarnS( logTag, "setRemoteWindow: no video provider found");
         return;
     }
-           
+
     for (StreamMapType::iterator entry =  pMediaData->streamMap.begin(); entry !=  pMediaData->streamMap.end(); entry++)
     {
         if (entry->second.isVideo)
         {
             // first video stream found
             int streamId = entry->first;
-            pVideo->setRemoteWindow(streamId,  pMediaData->remoteWindow); 
+            pVideo->setRemoteWindow(streamId,  pMediaData->remoteWindow);
 
             return;
         }
@@ -131,14 +96,14 @@ int CC_SIPCCCall::setExternalRenderer(VideoFormat vFormat, ExternalRendererHandl
         CSFLogWarnS( logTag, "setExternalRenderer: no video provider found");
         return -1;
     }
-           
+
     for (StreamMapType::iterator entry =  pMediaData->streamMap.begin(); entry !=  pMediaData->streamMap.end(); entry++)
     {
         if (entry->second.isVideo)
         {
             // first video stream found
             int streamId = entry->first;
-            return pVideo->setExternalRenderer(streamId,  pMediaData->videoFormat, pMediaData->extRenderer); 
+            return pVideo->setExternalRenderer(streamId,  pMediaData->videoFormat, pMediaData->extRenderer);
         }
     }
     CSFLogInfoS( logTag, "setExternalRenderer:no video stream found in call " << callHandle );
@@ -310,7 +275,7 @@ bool CC_SIPCCCall::transferStart (cc_sdp_direction_t video_pref)
     return (CCAPI_Call_transferStart(callHandle, video_pref) == CC_SUCCESS);
 }
 
-bool CC_SIPCCCall::transferComplete (CC_CallPtr otherLeg, 
+bool CC_SIPCCCall::transferComplete (CC_CallPtr otherLeg,
                                      cc_sdp_direction_t video_pref)
 {
     return (CCAPI_Call_transferComplete(callHandle, ((CC_SIPCCCall*)otherLeg.get())->callHandle, video_pref) == CC_SUCCESS);
@@ -401,7 +366,7 @@ bool CC_SIPCCCall::setAudioMute(bool mute)
     {
     	returnCode = false;
     }
-    
+
 	return returnCode;
 }
 
@@ -447,17 +412,17 @@ void CC_SIPCCCall::addStream(int streamId, bool isVideo)
 		mozilla::MutexAutoLock lock(m_lock);
 		pMediaData->streamMap[streamId].isVideo = isVideo;
 	}
-	// The new stream needs to be given any properties that the call has for it. 
+	// The new stream needs to be given any properties that the call has for it.
 	// At the moment the only candidate is the muted state
 	if (isVideo)
 	{
 #ifndef NO_WEBRTC_VIDEO
         VideoTermination * pVideo = VcmSIPCCBinding::getVideoTermination();
-        
+
         // if there is a window for this call apply it to the stream
         if ( pMediaData->remoteWindow != NULL)
         {
-            pVideo->setRemoteWindow(streamId,  pMediaData->remoteWindow); 
+            pVideo->setRemoteWindow(streamId,  pMediaData->remoteWindow);
         }
         else
         {
@@ -467,13 +432,13 @@ void CC_SIPCCCall::addStream(int streamId, bool isVideo)
 		if(pMediaData->extRenderer != NULL)
 		{
 			pVideo->setExternalRenderer(streamId, pMediaData->videoFormat, pMediaData->extRenderer);
-		} 
+		}
 		else
 		{
             CSFLogInfoS( logTag, "addStream: externalRenderer is NULL");
 
 		}
-     
+
 
         for (StreamMapType::iterator entry =  pMediaData->streamMap.begin(); entry !=  pMediaData->streamMap.end(); entry++)
         {
@@ -482,7 +447,7 @@ void CC_SIPCCCall::addStream(int streamId, bool isVideo)
     			// first is the streamId
     			pVideo->setAudioStreamId(entry->first);
     		}
-        }        
+        }
 		if (!pVideo->mute(streamId,  pMediaData->videoMuteState))
 		{
 			CSFLogErrorS( logTag, "setting video mute state failed for new stream: " << streamId);
@@ -493,8 +458,8 @@ void CC_SIPCCCall::addStream(int streamId, bool isVideo)
 		}
 #endif
 	}
-	else		
-	{	
+	else
+	{
 		AudioTermination * pAudio = VcmSIPCCBinding::getAudioTermination();
 		if (!pAudio->mute(streamId,  pMediaData->audioMuteState))
 		{
@@ -514,13 +479,13 @@ void CC_SIPCCCall::removeStream(int streamId)
 	if ( pMediaData->streamMap.erase(streamId) != 1)
 	{
 		CSFLogErrorS( logTag, "removeStream stream that was never in the streamMap: " << streamId);
-	} 
+	}
 }
 
 bool CC_SIPCCCall::setVolume(int volume)
 {
 	bool returnCode = false;
-    
+
     AudioTermination * pAudio = VcmSIPCCBinding::getAudioTermination();
 	{
     	mozilla::MutexAutoLock lock(m_lock);
@@ -559,7 +524,7 @@ void CC_SIPCCCall::originateP2PCall (cc_sdp_direction_t video_pref, const std::s
 	CCAPI_Config_set_server_address(ip.c_str());
     CCAPI_Call_originateCall(callHandle, video_pref, digits.c_str());
 }
- 
+
 /*
  * This method works asynchronously, there will be an onCallEvent with the resulting SDP
  * When Constraints are implemented the Audio and Video port will not be a parameter to CCAPI_CreateAnswer
@@ -578,7 +543,7 @@ void CC_SIPCCCall::createAnswer (const std::string & hints, const std::string &
 void CC_SIPCCCall::setLocalDescription(cc_jsep_action_t action, const std::string & sdp) {
 	CCAPI_SetLocalDescription(callHandle, action, sdp.c_str());
 }
-        
+
 void CC_SIPCCCall::setRemoteDescription(cc_jsep_action_t action, const std::string & sdp) {
 	CCAPI_SetRemoteDescription(callHandle, action, sdp.c_str());
 }
@@ -586,7 +551,7 @@ void CC_SIPCCCall::setRemoteDescription(cc_jsep_action_t action, const std::stri
 void CC_SIPCCCall::setPeerConnection(const std::string& handle)
 {
   CSFLogDebug(logTag, "setPeerConnection");
-  
+
   peerconnection = handle;  // Cache this here. we need it to make the CC_SIPCCCallInfo
   CCAPI_SetPeerConnection(callHandle, handle.c_str());
 }
diff --git a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCall.h b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCall.h
index e72a3fb9002c..c53b31795581 100644
--- a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCall.h
+++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCall.h
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef _CC_SIPCCCALL_H
 #define _CC_SIPCCCALL_H
@@ -54,7 +19,7 @@ namespace CSF
     struct StreamInfo
     {
 		// a bit of overkill having a structure just for video, but we may have other properties later
-    	bool isVideo;                    
+    	bool isVideo;
     };
     typedef std::map StreamMapType;
 
@@ -63,27 +28,27 @@ namespace CSF
     class CC_SIPCCCallMediaData
 	{
 	public:
-		CC_SIPCCCallMediaData(): 
-          remoteWindow(NULL), 
+		CC_SIPCCCallMediaData():
+          remoteWindow(NULL),
           streamMapMutex("CC_SIPCCCallMediaData"),
-          audioMuteState(false), 
-          videoMuteState(false), 
+          audioMuteState(false),
+          videoMuteState(false),
           volume(-1){}
 		CC_SIPCCCallMediaData(VideoWindowHandle remoteWindow,
-            bool audioMuteState, bool videoMuteState, int volume): 
+            bool audioMuteState, bool videoMuteState, int volume):
           remoteWindow(remoteWindow),
           streamMapMutex("CC_SIPCCCallMediaData"),
-          audioMuteState(audioMuteState), 
-          videoMuteState(videoMuteState), 
+          audioMuteState(audioMuteState),
+          videoMuteState(videoMuteState),
           volume(volume) {}
-        VideoWindowHandle remoteWindow; 
+        VideoWindowHandle remoteWindow;
 		ExternalRendererHandle extRenderer;
-		VideoFormat videoFormat;	
+		VideoFormat videoFormat;
         mozilla::Mutex streamMapMutex;
         StreamMapType streamMap;
         bool audioMuteState;
-        bool videoMuteState; 
-        int volume;        
+        bool videoMuteState;
+        int volume;
     private:
         CC_SIPCCCallMediaData(const CC_SIPCCCallMediaData&);
         CC_SIPCCCallMediaData& operator=(const CC_SIPCCCallMediaData&);
@@ -128,7 +93,7 @@ namespace CSF
         virtual bool conferenceStart (cc_sdp_direction_t video_pref);
         virtual bool conferenceComplete (CC_CallPtr otherLog, cc_sdp_direction_t video_pref);
         virtual bool transferStart (cc_sdp_direction_t video_pref);
-        virtual bool transferComplete (CC_CallPtr otherLeg, 
+        virtual bool transferComplete (CC_CallPtr otherLeg,
                                        cc_sdp_direction_t video_pref);
         virtual bool cancelTransferOrConferenceFeature();
         virtual bool directTransfer (CC_CallPtr target);
diff --git a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCallInfo.cpp b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCallInfo.cpp
index e509d2e30ac8..fb6c90abad47 100644
--- a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCallInfo.cpp
+++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCallInfo.cpp
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "CC_Common.h"
 
@@ -537,7 +502,7 @@ void CC_SIPCCCallInfo::generateCapabilities()
         else
         {
             caps.insert(CC_CallCapabilityEnum::canMuteAudio);
-        }       
+        }
 
         if ((CCAPI_CallInfo_getVideoDirection(callinfo_ref) == CC_SDP_DIRECTION_SENDRECV) ||
             (CCAPI_CallInfo_getVideoDirection(callinfo_ref) == CC_SDP_DIRECTION_SENDONLY))
diff --git a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCallInfo.h b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCallInfo.h
index ac9eee823a9f..7994626f07c6 100644
--- a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCallInfo.h
+++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCallInfo.h
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef _CC_SIPCC_CALLINFO_H
 #define _CC_SIPCC_CALLINFO_H
diff --git a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCallServerInfo.cpp b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCallServerInfo.cpp
index 1ce0a0b9bcd8..7ee1cce10090 100644
--- a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCallServerInfo.cpp
+++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCallServerInfo.cpp
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "CC_Common.h"
 
diff --git a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCallServerInfo.h b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCallServerInfo.h
index bd6e918ac519..22796f92a431 100644
--- a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCallServerInfo.h
+++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCallServerInfo.h
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef _CC_SIPCC_CALLSERVERINFO_H
 #define _CC_SIPCC_CALLSERVERINFO_H
diff --git a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCDevice.cpp b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCDevice.cpp
index 6505e111427e..2bf1927f7032 100644
--- a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCDevice.cpp
+++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCDevice.cpp
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "CC_Common.h"
 
@@ -116,7 +81,7 @@ void CC_SIPCCDevice::enableVideo(bool enable)
     CCAPI_Device_enableVideo(deviceHandle, enable);
 }
 
-void CC_SIPCCDevice::enableCamera(bool enable)    
+void CC_SIPCCDevice::enableCamera(bool enable)
 {
     CCAPI_Device_enableCamera(deviceHandle, enable);
 }
diff --git a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCDevice.h b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCDevice.h
index 489bc7354072..83de7c86d170 100644
--- a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCDevice.h
+++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCDevice.h
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef _CC_SIPCC_DEVICE_H
 #define _CC_SIPCC_DEVICE_H
@@ -65,7 +30,7 @@ namespace CSF
         virtual CC_CallPtr createCall();
 
         virtual void enableVideo(bool enable);
-        virtual void enableCamera(bool enable);    
+        virtual void enableCamera(bool enable);
 		virtual void setDigestNamePasswd (char *name, char *pw);
 
     private:
diff --git a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCDeviceInfo.cpp b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCDeviceInfo.cpp
index 5b779e92f2c1..96a9b8d0d131 100644
--- a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCDeviceInfo.cpp
+++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCDeviceInfo.cpp
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "CC_Common.h"
 
diff --git a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCDeviceInfo.h b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCDeviceInfo.h
index eeb664099290..0bef66abb646 100644
--- a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCDeviceInfo.h
+++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCDeviceInfo.h
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef _CC_SIPCC_DEVICEINFO_H
 #define _CC_SIPCC_DEVICEINFO_H
diff --git a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCFeatureInfo.cpp b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCFeatureInfo.cpp
index c8ec9b209e40..92236fe53844 100644
--- a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCFeatureInfo.cpp
+++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCFeatureInfo.cpp
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "CC_Common.h"
 
diff --git a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCFeatureInfo.h b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCFeatureInfo.h
index 0c34edf37b49..d6f55ec5820c 100644
--- a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCFeatureInfo.h
+++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCFeatureInfo.h
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef _CC_SIPCC_FEATUREINFO_H
 #define _CC_SIPCC_FEATUREINFO_H
diff --git a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCLine.cpp b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCLine.cpp
index 947b73918f90..31899da7d5f6 100644
--- a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCLine.cpp
+++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCLine.cpp
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "CC_Common.h"
 
diff --git a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCLine.h b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCLine.h
index d4585adcb9b0..06ef0be4030e 100644
--- a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCLine.h
+++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCLine.h
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef _CC_SIPCCLINE_H
 #define _CC_SIPCCLINE_H
diff --git a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCLineInfo.cpp b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCLineInfo.cpp
index fec6b796c191..38fd530dae9e 100644
--- a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCLineInfo.cpp
+++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCLineInfo.cpp
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "CC_Common.h"
 
diff --git a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCLineInfo.h b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCLineInfo.h
index c4f29fd74eec..4491992b91d0 100644
--- a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCLineInfo.h
+++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCLineInfo.h
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef _CC_SIPCC_LINEINFO_H
 #define _CC_SIPCC_LINEINFO_H
diff --git a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCService.cpp b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCService.cpp
index 5ca0ac54a695..08976a36c517 100644
--- a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCService.cpp
+++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCService.cpp
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifdef _WIN32
 #include  //plat_api.h seems to need some of the types defined in Windows.h (e.g. boolean)
@@ -91,15 +56,15 @@ extern "C"
 
 /**
  * configCtlFetchReq
- * 
- * This function tells the config manager to fetch the CTL file 
- * and then fetch the config  from the CUCM. It is expected that 
+ *
+ * This function tells the config manager to fetch the CTL file
+ * and then fetch the config  from the CUCM. It is expected that
  * this will result in processing of
  * the config file after the config managers response is received.
  *
- * The response received for this request is asynchronous and 
+ * The response received for this request is asynchronous and
  * should be handled via event provided by config manager.
- * The CCAPI_Config_reponse api needs to be called for the 
+ * The CCAPI_Config_reponse api needs to be called for the
  * handling of the response to the fetch request
  *
  */
@@ -122,14 +87,14 @@ void configCtlFetchReq(int device_handle)
 
 /**
  * configFetchReq
- * 
+ *
  * This function tells the config manager to fetch the latest config
  * from the CUCM. It is expected that this will result in processing of
  * the config file after the config managers response is received.
  *
- * The response received for this request is asynchronous and 
+ * The response received for this request is asynchronous and
  * should be handled via event provided by config manager.
- * The CCAPI_Config_reponse api needs to be called for the 
+ * The CCAPI_Config_reponse api needs to be called for the
  * handling of the response to the fetch request
  *
  * There are cases where only the config file is needed, for eg: during
@@ -150,7 +115,7 @@ void configFetchReq(int device_handle)
  * and a new config file needs to be downloaded.
  *
  * The error could be XML format error or minimum config not being
- * present in the config file.  It is expected that 
+ * present in the config file.  It is expected that
  * this will result in processing of
  * the config file after the config managers response is received.
  *
@@ -220,12 +185,12 @@ void ccmedia_flash_once_timer_callback (void)
 
 /**
  * dialPlanFetchReq
- * 
+ *
  * This function tells the get file request service to fetch the latest dial
  * plan from the CUCM.
  *
  * @param device_handle [in] handle of the device, the response is for
- * @param dialPlanFileName [in] the name of dialplan file to retrieve 
+ * @param dialPlanFileName [in] the name of dialplan file to retrieve
  *
  */
 cc_boolean dialPlanFetchReq(int device_handle, char* dialPlanFileName)
@@ -235,12 +200,12 @@ cc_boolean dialPlanFetchReq(int device_handle, char* dialPlanFileName)
 
 /**
  * fcpFetchReq
- * 
+ *
  * This function tells the get file request service to fetch the latest fcp
  * file from the CUCM.
  *
  * @param device_handle [in] handle of the device, the response is for
- * @param dialPlanFileName [in] the name of fcp file to retrieve 
+ * @param dialPlanFileName [in] the name of fcp file to retrieve
  *
  */
 cc_boolean fcpFetchReq(int device_handle, char* fcpFileName)
@@ -346,8 +311,8 @@ CC_SIPCCService* CC_SIPCCService::_self = NULL;
 CC_SIPCCService::CC_SIPCCService()
 : loggingMask(0),
   bCreated(false),
-  bStarted(false), 
-  m_lock("CC_SIPCCService"), 
+  bStarted(false),
+  m_lock("CC_SIPCCService"),
   bUseConfig(false)
 {
 	// Only one instance allowed!
@@ -561,7 +526,7 @@ void CC_SIPCCService::applyLoggingMask (int newMask)
     	CSFLogWarn( logTag, "Value of 0x%x specified for mask includes at least one bit value that exceeds the maximum supported bitfield value. "
                     "Ignoring unsupported bits.", newMask);
     }
-    
+
     CSFLogDebugS( logTag, "Applying a sipcc log mask = " << newMask);
 
     loggingMask = newMask & (HAS_21_BITS);
diff --git a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCService.h b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCService.h
index 816884d0864c..f2ba9fe9ba3b 100644
--- a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCService.h
+++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCService.h
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef _CC_SIPCC_SERVICE_H
 #define _CC_SIPCC_SERVICE_H
@@ -46,7 +11,7 @@ extern "C" {
 	// Callbacks from SIPCC.
     void configCtlFetchReq(int device_handle);
     char* platGetIPAddr();
-  
+
     void CCAPI_DeviceListener_onDeviceEvent(ccapi_device_event_e type, cc_device_handle_t hDevice, cc_deviceinfo_ref_t dev_info);
     void CCAPI_DeviceListener_onFeatureEvent(ccapi_device_event_e type, cc_deviceinfo_ref_t /* device_info */, cc_featureinfo_ref_t feature_info);
     void CCAPI_LineListener_onLineEvent(ccapi_line_event_e eventType, cc_lineid_t line, cc_lineinfo_ref_t info);
@@ -74,7 +39,7 @@ namespace CSF
     {
 	    friend void ::configCtlFetchReq(int device_handle);
 	    friend char* ::platGetIPAddr();
-      
+
 	public:
 	    CC_SIPCCService();
 	    virtual ~CC_SIPCCService();
@@ -102,7 +67,7 @@ namespace CSF
 
 	    virtual AudioControlPtr getAudioControl();
 	    virtual VideoControlPtr getVideoControl();
-	    
+
 	    // From the StreamObserver interface
 	    virtual void registerStream(cc_call_handle_t call, int streamId, bool isVideo);
     	virtual void deregisterStream(cc_call_handle_t call, int streamId);
diff --git a/media/webrtc/signaling/src/softphonewrapper/ccapi_plat_api_impl.cpp b/media/webrtc/signaling/src/softphonewrapper/ccapi_plat_api_impl.cpp
index 07724ba15ce3..ff58f5e78dc3 100644
--- a/media/webrtc/signaling/src/softphonewrapper/ccapi_plat_api_impl.cpp
+++ b/media/webrtc/signaling/src/softphonewrapper/ccapi_plat_api_impl.cpp
@@ -1,41 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Cisco Systems SIP Stack.
- *
- * The Initial Developer of the Original Code is
- * Cisco Systems (CSCO).
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Enda Mannion 
- *  Suhas Nandakumar 
- *  Ethan Hugg 
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "CC_Common.h"
 #include "csf_common.h"
@@ -122,7 +87,7 @@ int platGetAudioDeviceStatus(plat_audio_device_t device_type) {
 
 /**
  * Check if the speaker or headset is enabled.
- * 
+ *
  * @return boolean if the speaker or headset is enabled, returns true.
  */
 boolean platGetSpeakerHeadsetMode() {
@@ -390,8 +355,8 @@ boolean platGetMWIStatus(cc_lineid_t line) {
 
 /**
  * platSecIsServerSecure
- * 
- * @brief Lookup the secure status of the server 
+ *
+ * @brief Lookup the secure status of the server
  *
  * This function looks at the the CCM server type by using the security library
  * and returns appropriate indication to the pSIPCC.
@@ -399,7 +364,7 @@ boolean platGetMWIStatus(cc_lineid_t line) {
  *
  * @return   Server is security enabled or not
  *           PLAT_SOCK_SECURE or PLAT_SOCK_NONSECURE
- *             
+ *
  * @note This API maps to the following HandyIron API:
  *  int secIsServerSecure(SecServerType type) where type should be SRVR_TYPE_CCM
  */
@@ -413,10 +378,10 @@ plat_soc_status_e platSecIsServerSecure(void) {
  * @brief  Securely connect to a remote server
  *
  * This function uses the security library APIs to connect to a remote server.
- * @param[in]  host         server addr 
+ * @param[in]  host         server addr
  * @param[in]  port         port number
  * @param[in]  ipMode       IP mode to indicate v6, v4 or both
- * @param[in]  mode         blocking connect or not 
+ * @param[in]  mode         blocking connect or not
  *                          FALSE: non-blocking; TRUE: blocking
  * @param[in]  tos          TOS value
  * @param[in]  connectionType Are we talking to Call-Agent
@@ -430,23 +395,23 @@ plat_soc_status_e platSecIsServerSecure(void) {
  *
  * @pre        (hostAndPort not_eq NULL)
  * @pre        (localPort   not_eq NULL)
- *             
+ *
  * @note localPort is undefined when the return value is INVALID_SOCKET
  *
  * @note This API maps to the HandyIron APIs as follows:
- * If mode == TRUE (blocking): 
+ * If mode == TRUE (blocking):
  *    int secEstablishSecureConnection(const char* serverAddr, *uint32_t port, secConnectionType type)
  *    @li ipMode is UNUSED
  *    @li "host" maps to "serverAddr", "connectionType" maps to "type"
  *    @li localPort is passed in as 0
- * If mode == FALSE (non-blocking): 
+ * If mode == FALSE (non-blocking):
  *     int secConnect(const char* serverAddr, uint32_t port, *secConnectionType type, uint32_t localPort)
  *    @li ipMode is UNUSED
  *    @li "host" maps to "serverAddr", "connectionType" maps to "type"
  *
  * @note The implementation should use the "setsockopt" to set the "tos" value passed
  * in this API on the created socket.
- *               
+ *
  */
 cpr_socket_t
 platSecSocConnect (char *host,
@@ -464,13 +429,13 @@ platSecSocConnect (char *host,
  * Determine the status of a secure connection that was initiated
  * in non-blocking mode
  *
- * @param[in]    sock   socket descriptor 
+ * @param[in]    sock   socket descriptor
  *
  * @return   connection status
  *           @li connection complete: PLAT_SOCK_CONN_OK
  *           @li connection waiting:  PLAT_SOCK_CONN_WAITING
  *           @li connection failed:   PLAT_SOCK_CONN_FAILED
- *               
+ *
  * @note This API maps to the following HandyIron API:
  * int secIsConnectionReady (int connDesc)
  * The "sock" is the connection descriptor.
@@ -485,8 +450,8 @@ plat_soc_connect_status_e platSecSockIsConnected (cpr_socket_t sock) {
  * @brief Generates a Random Number
  *
  * Generate crypto graphically random number for a desired length.
- * The function is expected to be much slower than the cpr_rand(). 
- * This function should be used when good random number is needed 
+ * The function is expected to be much slower than the cpr_rand().
+ * This function should be used when good random number is needed
  * such as random number that to be used for SRTP key for an example.
  *
  * @param[in] buf  - pointer to the buffer to store the result of random
@@ -503,7 +468,7 @@ plat_soc_connect_status_e platSecSockIsConnected (cpr_socket_t sock) {
  *             'len' will indicate how many bytes are actually being
  *             returned) on failure, its value will be set to 0.
  *
- * @return 
+ * @return
  *     1 - success.
  *     0 - fail.
  *
@@ -559,7 +524,7 @@ int platGenerateCryptoRand(uint8_t *buf, int *len) {
 /*
    The version is to regulate certain features like Join, which are added in later releases.
   This is exchanged during registration with CUCM. It is a sheer luck that join may be working in some cases.
-  In this case Set API you have to store each of those API and return the same value in get. 
+  In this case Set API you have to store each of those API and return the same value in get.
 
   We can go over all platform API’ and see which one are mandatory, we can do this in an email or in a  meeting.
   Please send out list methods for which you need clarification.
diff --git a/media/webrtc/signaling/test/FakeMediaStreams.h b/media/webrtc/signaling/test/FakeMediaStreams.h
index 0f9f2cf5150a..01aca8afe7db 100644
--- a/media/webrtc/signaling/test/FakeMediaStreams.h
+++ b/media/webrtc/signaling/test/FakeMediaStreams.h
@@ -142,17 +142,17 @@ public:
     mMediaStream->Stop();
   }
 
-  
+
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMMEDIASTREAM
-    
+
   static already_AddRefed CreateInputStream(uint32_t aHintContents) {
     Fake_SourceMediaStream *source = new Fake_SourceMediaStream();
-    
+
     Fake_nsDOMMediaStream *ds = new Fake_nsDOMMediaStream(source);
     ds->SetHintContents(aHintContents);
     ds->AddRef();
-    
+
     return ds;
   }
 
diff --git a/media/webrtc/signaling/test/FakeMediaStreamsImpl.h b/media/webrtc/signaling/test/FakeMediaStreamsImpl.h
index db3b02bac15f..e48047c6b6cb 100644
--- a/media/webrtc/signaling/test/FakeMediaStreamsImpl.h
+++ b/media/webrtc/signaling/test/FakeMediaStreamsImpl.h
@@ -1,31 +1,6 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef FAKE_MEDIA_STREAMIMPL_H_
 #define FAKE_MEDIA_STREAMIMPL_H_
@@ -172,7 +147,7 @@ Fake_VideoStreamSource::Notify(nsITimer* aTimer)
 
 #if 0
 // Fake up buffer recycle bin
-mozilla::layers::BufferRecycleBin::BufferRecycleBin() : 
+mozilla::layers::BufferRecycleBin::BufferRecycleBin() :
  mLock("mozilla.layers.BufferRecycleBin.mLock") {
 }
 
diff --git a/media/webrtc/signaling/test/mediapipeline_unittest.cpp b/media/webrtc/signaling/test/mediapipeline_unittest.cpp
index d3bcb06295c2..23d5cde15b7a 100644
--- a/media/webrtc/signaling/test/mediapipeline_unittest.cpp
+++ b/media/webrtc/signaling/test/mediapipeline_unittest.cpp
@@ -106,7 +106,7 @@ class TestAgent {
     test_utils.sts_target()->Dispatch(
         WrapRunnable(this, &TestAgent::StopInt),
         NS_DISPATCH_SYNC);
-    
+
     PR_Sleep(1000); // Deal with race condition
   }
 
diff --git a/media/webrtc/signaling/test/signaling_unittests.cpp b/media/webrtc/signaling/test/signaling_unittests.cpp
index 5905c9d8e01c..c9119d8c7866 100644
--- a/media/webrtc/signaling/test/signaling_unittests.cpp
+++ b/media/webrtc/signaling/test/signaling_unittests.cpp
@@ -38,7 +38,7 @@ namespace test {
 
 static const std::string strSampleSdpAudioVideoNoIce =
   "v=0\r\n"
-  "o=Cisco-SIPUA 4949 0 IN IP4 10.86.255.143\r\n"
+  "o=Mozilla-SIPUA 4949 0 IN IP4 10.86.255.143\r\n"
   "s=SIP Call\r\n"
   "t=0 0\r\n"
   "a=ice-ufrag:qkEP\r\n"
@@ -307,7 +307,7 @@ class ParsedSDP {
     Parse();
   }
 
-  
+
   void ReplaceLine(std::string objType, std::string content)
   {
     std::multimap::iterator it;
@@ -320,8 +320,8 @@ class ParsedSDP {
       sdp_map_.insert(std::pair(objType, make_pair(line_no,value)));
     }
   }
-  
-  void AddLine(std::string content) 
+
+  void AddLine(std::string content)
   {
     size_t whiteSpace = content.find(' ');
     std::string key;
@@ -375,7 +375,7 @@ class ParsedSDP {
         ice_candidates_.insert(std::pair(levels_, cand));
        } else {
         sdp_without_ice_ += line;
-      }    
+      }
       if (line.find("m=") == 0) {
         // This is an m-line
         ++levels_;
@@ -412,7 +412,7 @@ class ParsedSDP {
     return sdp;
   }
 
-  
+
 
   std::string sdp_;
   std::string sdp_without_ice_;
@@ -481,7 +481,7 @@ class SignalingAgent {
   void CreateOffer(const char* hints, bool audio, bool video) {
 
     // Create a media stream as if it came from GUM
-    Fake_AudioStreamSource *audio_stream = 
+    Fake_AudioStreamSource *audio_stream =
       new Fake_AudioStreamSource();
 
     nsresult ret;
@@ -582,12 +582,12 @@ class SignalingAgent {
          it != sdp.ice_candidates_.end(); ++it) {
       if ((*it).first != 0) {
         std::cerr << "Adding trickle ICE candidate " << (*it).second << std::endl;
-        
+
         ASSERT_TRUE(NS_SUCCEEDED(pc->AddIceCandidate((*it).second.c_str(), "", (*it).first)));
       }
     }
   }
-  
+
 
   bool IceCompleted() {
     uint32_t state;
@@ -689,7 +689,7 @@ public:
     a1_.CreateOffer(hints, true, true);
     a1_.SetLocal(TestObserver::OFFER, a1_.offer());
   }
-  
+
   void OfferAnswer(const char* ahints, const char* bhints) {
     a1_.CreateOffer(ahints, true, true);
     a1_.SetLocal(TestObserver::OFFER, a1_.offer());
diff --git a/mobile/android/base/AnimatorProxy.java b/mobile/android/base/AnimatorProxy.java
new file mode 100644
index 000000000000..7904a30a431f
--- /dev/null
+++ b/mobile/android/base/AnimatorProxy.java
@@ -0,0 +1,338 @@
+/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package org.mozilla.gecko;
+
+import android.graphics.Matrix;
+import android.graphics.RectF;
+import android.os.Build;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
+import android.view.animation.Transformation;
+
+import java.lang.ref.WeakReference;
+import java.util.WeakHashMap;
+
+public class AnimatorProxy {
+    private static final WeakHashMap PROXIES =
+            new WeakHashMap();
+
+    private static interface AnimatorProxyImpl {
+        public float getAlpha();
+        public void setAlpha(float alpha);
+
+        public float getTranslationX();
+        public void setTranslationX(float translationX);
+
+        public float getTranslationY();
+        public void setTranslationY(float translationY);
+
+        public View getView();
+    }
+
+    private AnimatorProxyImpl mImpl;
+
+    private AnimatorProxy(AnimatorProxyImpl impl) {
+        mImpl = impl;
+    }
+
+    public static AnimatorProxy create(View view) {
+        AnimatorProxy proxy = PROXIES.get(view);
+        boolean needsAnimationProxy = (Build.VERSION.SDK_INT < 11);
+
+        // If the view's animation proxy has been overridden from somewhere else, we need to
+        // create a new AnimatorProxy for the view.
+        if (proxy == null || (needsAnimationProxy && proxy.mImpl != view.getAnimation())) {
+            AnimatorProxyImpl impl = (needsAnimationProxy ? new AnimatorProxyPreHC(view) :
+                                                            new AnimatorProxyPostHC(view));
+
+            proxy = new AnimatorProxy(impl);
+            PROXIES.put(view, proxy);
+        }
+
+        return proxy;
+    }
+
+    public int getHeight() {
+        View view = mImpl.getView();
+        if (view != null)
+            return view.getHeight();
+
+        return 0;
+    }
+
+    public void setHeight(int height) {
+        View view = mImpl.getView();
+        if (view != null) {
+            ViewGroup.LayoutParams lp = view.getLayoutParams();
+            lp.height = height;
+            view.setLayoutParams(lp);
+        }
+    }
+
+    public int getScrollX() {
+        View view = mImpl.getView();
+        if (view != null)
+            return view.getScrollX();
+
+        return 0;
+    }
+
+    public int getScrollY() {
+        View view = mImpl.getView();
+        if (view != null)
+            return view.getScrollY();
+
+        return 0;
+    }
+
+    public void scrollTo(int scrollX, int scrollY) {
+        View view = mImpl.getView();
+        if (view != null)
+            view.scrollTo(scrollX, scrollY);
+    }
+
+    public float getAlpha() {
+        return mImpl.getAlpha();
+    }
+
+    public void setAlpha(float alpha) {
+        mImpl.setAlpha(alpha);
+    }
+
+    public float getTranslationX() {
+        return mImpl.getTranslationX();
+    }
+
+    public void setTranslationX(float translationX) {
+        mImpl.setTranslationX(translationX);
+    }
+
+    public float getTranslationY() {
+        return mImpl.getTranslationY();
+    }
+
+    public void setTranslationY(float translationY) {
+        mImpl.setTranslationY(translationY);
+    }
+
+    /*
+     * AnimatorProxyPreHC uses the technique used by the NineOldAndroids described here:
+     * http://jakewharton.com/advanced-pre-honeycomb-animation/
+     *
+     * Some of this code is based on Jake Wharton's AnimatorProxy released as part of
+     * the NineOldAndroids library under the Apache License 2.0.
+     */
+    private static class AnimatorProxyPreHC extends Animation implements AnimatorProxyImpl {
+        private WeakReference mViewRef;
+
+        private final RectF mBefore;
+        private final RectF mAfter;
+        private final Matrix mTempMatrix;
+
+        private float mAlpha;
+        private float mTranslationX;
+        private float mTranslationY;
+
+        public AnimatorProxyPreHC(View view) {
+            mBefore = new RectF();
+            mAfter = new RectF();
+            mTempMatrix = new Matrix();
+
+            mAlpha = 1;
+            mTranslationX = 0;
+            mTranslationY = 0;
+
+            loadCurrentTransformation(view);
+
+            setDuration(0);
+            setFillAfter(true);
+            view.setAnimation(this);
+
+            mViewRef = new WeakReference(view);
+        }
+
+        private void loadCurrentTransformation(View view) {
+            Animation animation = view.getAnimation();
+            if (animation == null)
+                return;
+
+            Transformation transformation = new Transformation();
+            float[] matrix = new float[9];
+
+            animation.getTransformation(AnimationUtils.currentAnimationTimeMillis(), transformation);
+            transformation.getMatrix().getValues(matrix);
+
+            mAlpha = transformation.getAlpha();
+            mTranslationX = matrix[Matrix.MTRANS_X];
+            mTranslationY = matrix[Matrix.MTRANS_Y];
+        }
+
+        private void prepareForUpdate() {
+            View view = mViewRef.get();
+            if (view != null)
+                computeRect(mBefore, view);
+        }
+
+        private void computeRect(final RectF r, View view) {
+            final float w = view.getWidth();
+            final float h = view.getHeight();
+
+            r.set(0, 0, w, h);
+
+            final Matrix m = mTempMatrix;
+            m.reset();
+            transformMatrix(m, view);
+            mTempMatrix.mapRect(r);
+
+            r.offset(view.getLeft(), view.getTop());
+        }
+
+        private void transformMatrix(Matrix m, View view) {
+            m.postTranslate(mTranslationX, mTranslationY);
+        }
+
+        private void invalidateAfterUpdate() {
+            View view = mViewRef.get();
+            if (view == null || view.getParent() == null)
+                return;
+
+            final RectF after = mAfter;
+            computeRect(after, view);
+            after.union(mBefore);
+
+            ((View)view.getParent()).invalidate(
+                    (int) Math.floor(after.left),
+                    (int) Math.floor(after.top),
+                    (int) Math.ceil(after.right),
+                    (int) Math.ceil(after.bottom));
+        }
+
+        @Override
+        public float getAlpha() {
+            return mTranslationX;
+        }
+
+        @Override
+        public void setAlpha(float alpha) {
+            if (alpha == alpha)
+                return;
+
+            mAlpha = alpha;
+
+            View view = mViewRef.get();
+            if (view != null)
+                view.invalidate();
+        }
+
+        @Override
+        public float getTranslationX() {
+            return mTranslationX;
+        }
+
+        @Override
+        public void setTranslationX(float translationX) {
+            if (mTranslationX == translationX)
+                return;
+
+            prepareForUpdate();
+            mTranslationX = translationX;
+            invalidateAfterUpdate();
+        }
+
+        @Override
+        public float getTranslationY() {
+            return mTranslationY;
+        }
+
+        @Override
+        public void setTranslationY(float translationY) {
+            if (mTranslationY == translationY)
+                return;
+
+            prepareForUpdate();
+            mTranslationY = translationY;
+            invalidateAfterUpdate();
+        }
+
+        @Override
+        public View getView() {
+            return mViewRef.get();
+        }
+
+        @Override
+        protected void applyTransformation(float interpolatedTime, Transformation t) {
+            View view = mViewRef.get();
+            if (view != null) {
+                t.setAlpha(mAlpha);
+                transformMatrix(t.getMatrix(), view);
+            }
+        }
+    }
+
+    private static class AnimatorProxyPostHC implements AnimatorProxyImpl {
+        private WeakReference mViewRef;
+
+        public AnimatorProxyPostHC(View view) {
+            mViewRef = new WeakReference(view);
+        }
+
+        @Override
+        public float getAlpha() {
+            View view = mViewRef.get();
+            if (view != null)
+                return view.getAlpha();
+
+            return 1;
+        }
+
+        @Override
+        public void setAlpha(float alpha) {
+            View view = mViewRef.get();
+            if (view != null)
+                view.setAlpha(alpha);
+        }
+
+        @Override
+        public float getTranslationX() {
+            View view = mViewRef.get();
+            if (view != null)
+                return view.getTranslationX();
+
+            return 0;
+        }
+
+        @Override
+        public void setTranslationX(float translationX) {
+            View view = mViewRef.get();
+            if (view != null)
+                view.setTranslationX(translationX);
+        }
+
+        @Override
+        public float getTranslationY() {
+            View view = mViewRef.get();
+            if (view != null)
+                return view.getTranslationY();
+
+            return 0;
+        }
+
+        @Override
+        public void setTranslationY(float translationY) {
+            View view = mViewRef.get();
+            if (view != null)
+                view.setTranslationY(translationY);
+        }
+
+        @Override
+        public View getView() {
+            return mViewRef.get();
+        }
+    }
+}
+
diff --git a/mobile/android/base/BrowserApp.java b/mobile/android/base/BrowserApp.java
index b2237d8e1410..cffc0f0493bb 100644
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -34,6 +34,7 @@ import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.animation.Interpolator;
 import android.widget.LinearLayout;
 import android.widget.Toast;
 
@@ -73,6 +74,13 @@ abstract public class BrowserApp extends GeckoApp
 
     private PropertyAnimator mMainLayoutAnimator;
 
+    private static final Interpolator sTabsInterpolator = new Interpolator() {
+        public float getInterpolation(float t) {
+            t -= 1.0f;
+            return t * t * t * t * t + 1.0f;
+        }
+    };
+
     private FindInPageBar mFindInPageBar;
 
     // We'll ask for feedback after the user launches the app this many times.
@@ -500,29 +508,32 @@ abstract public class BrowserApp extends GeckoApp
         if (mTabsPanel.isShown())
             mTabsPanel.setDescendantFocusability(ViewGroup.FOCUS_AFTER_DESCENDANTS);
 
-        mMainLayoutAnimator = new PropertyAnimator(150);
+        mMainLayoutAnimator = new PropertyAnimator(450, sTabsInterpolator);
         mMainLayoutAnimator.setPropertyAnimationListener(this);
 
+        boolean usingTextureView = mLayerView.shouldUseTextureView();
+        mMainLayoutAnimator.setUseHardwareLayer(usingTextureView);
+
         if (hasTabsSideBar()) {
-            mMainLayoutAnimator.attach(mBrowserToolbar.getLayout(),
-                                       PropertyAnimator.Property.SHRINK_LEFT,
-                                       width);
+            mBrowserToolbar.prepareTabsAnimation(mMainLayoutAnimator, width);
 
             // Set the gecko layout for sliding.
             if (!mTabsPanel.isShown()) {
                 ((LinearLayout.LayoutParams) mGeckoLayout.getLayoutParams()).setMargins(0, 0, 0, 0);
-                mGeckoLayout.scrollTo(mTabsPanel.getWidth() * -1, 0);
+                if (!usingTextureView)
+                    mGeckoLayout.scrollTo(mTabsPanel.getWidth() * -1, 0);
                 mGeckoLayout.requestLayout();
             }
 
             mMainLayoutAnimator.attach(mGeckoLayout,
-                                       PropertyAnimator.Property.SLIDE_LEFT,
-                                       width);
-
+                                       usingTextureView ? PropertyAnimator.Property.TRANSLATION_X :
+                                                          PropertyAnimator.Property.SCROLL_X,
+                                       usingTextureView ? width : -width);
         } else {
             mMainLayoutAnimator.attach(mMainLayout,
-                                       PropertyAnimator.Property.SLIDE_TOP,
-                                       height);
+                                       usingTextureView ? PropertyAnimator.Property.TRANSLATION_Y :
+                                                          PropertyAnimator.Property.SCROLL_Y,
+                                       usingTextureView ? height : -height);
         }
 
         mMainLayoutAnimator.start();
@@ -530,30 +541,39 @@ abstract public class BrowserApp extends GeckoApp
 
     @Override
     public void onPropertyAnimationStart() {
-        mMainHandler.post(new Runnable() {
-            public void run() {
-                mBrowserToolbar.updateTabs(true);
-            }
-        });
+        mBrowserToolbar.updateTabs(true);
+
+        // Although the tabs panel is not animating per se, it will be re-drawn several
+        // times while the main/gecko layout slides to left/top. Adding a hardware layer
+        // here considerably improves the frame rate of the animation.
+        if (Build.VERSION.SDK_INT >= 11)
+            mTabsPanel.setLayerType(View.LAYER_TYPE_HARDWARE, null);
     }
 
     @Override
     public void onPropertyAnimationEnd() {
-        mMainHandler.post(new Runnable() {
-            public void run() {
-                if (hasTabsSideBar() && mTabsPanel.isShown()) {
-                    // Fake the gecko layout to have been shrunk, instead of sliding.
-                    ((LinearLayout.LayoutParams) mGeckoLayout.getLayoutParams()).setMargins(mTabsPanel.getWidth(), 0, 0, 0);
-                    mGeckoLayout.scrollTo(0, 0);
-                    mGeckoLayout.requestLayout();
-                }
+        // Destroy the hardware layer used during the animation
+        if (Build.VERSION.SDK_INT >= 11)
+            mTabsPanel.setLayerType(View.LAYER_TYPE_NONE, null);
 
-                if (!mTabsPanel.isShown()) {
-                    mBrowserToolbar.updateTabs(false);
-                    mTabsPanel.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
-                }
-            }
-        });
+        if (hasTabsSideBar() && mTabsPanel.isShown()) {
+            boolean usingTextureView = mLayerView.shouldUseTextureView();
+
+            int leftMargin = (usingTextureView ? 0 : mTabsPanel.getWidth());
+            int rightMargin = (usingTextureView ? mTabsPanel.getWidth() : 0);
+            ((LinearLayout.LayoutParams) mGeckoLayout.getLayoutParams()).setMargins(leftMargin, 0, rightMargin, 0);
+
+            if (!usingTextureView)
+                mGeckoLayout.scrollTo(0, 0);
+
+            mGeckoLayout.requestLayout();
+        }
+
+        if (!mTabsPanel.isShown()) {
+            mBrowserToolbar.updateTabs(false);
+            mBrowserToolbar.finishTabsAnimation();
+            mTabsPanel.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
+        }
     }
 
     /* Favicon methods */
@@ -928,7 +948,7 @@ abstract public class BrowserApp extends GeckoApp
     protected void onNewIntent(Intent intent) {
         super.onNewIntent(intent);
 
-        if (!Intent.ACTION_MAIN.equals(intent.getAction()))
+        if (!Intent.ACTION_MAIN.equals(intent.getAction()) || !mInitialized)
             return;
 
         (new GeckoAsyncTask(mAppContext, GeckoAppShell.getHandler()) {
diff --git a/mobile/android/base/BrowserToolbar.java b/mobile/android/base/BrowserToolbar.java
index cf2dd57116c7..30b239d5a461 100644
--- a/mobile/android/base/BrowserToolbar.java
+++ b/mobile/android/base/BrowserToolbar.java
@@ -51,12 +51,15 @@ public class BrowserToolbar implements ViewSwitcher.ViewFactory,
                                        Animation.AnimationListener {
     private static final String LOGTAG = "GeckoToolbar";
     private LinearLayout mLayout;
-    private Button mAwesomeBar;
+    private View mAwesomeBar;
+    private View mAwesomeBarRightEdge;
+    private View mAddressBarBg;
     private TextView mTitle;
     private int mTitlePadding;
     private boolean mSiteSecurityVisible;
     private boolean mAnimateSiteSecurity;
     private ImageButton mTabs;
+    private int mTabsPaneWidth;
     private ImageView mBack;
     private ImageView mForward;
     public ImageButton mFavicon;
@@ -112,12 +115,29 @@ public class BrowserToolbar implements ViewSwitcher.ViewFactory,
         mShowSiteSecurity = false;
         mShowReader = false;
 
+        // Only used on tablet layout. We need a separate view for the background
+        // because we need to slide it left/right for hiding/shoing the tabs sidebar
+        // See prepareTabsAnimation().
+        mAddressBarBg = mLayout.findViewById(R.id.address_bar_bg);
+
+        // Only used on tablet layout. The tabs sidebar slide animation is implemented
+        // in terms of translating the inner elements of the tablet toolbar to give the
+        // impression of resizing. In order to do this, This "fake" right edge  is kept
+        // in the same position during the animation while the elements on the left
+        // (favicon, back, forware, lock icon, title, ...) slide behind it.
+        // See prepareTabsAnimation().
+        mAwesomeBarRightEdge = mLayout.findViewById(R.id.awesome_bar_right_edge);
+
+        // This will hold the translation width inside the toolbar when the tabs
+        // pane is visible. It will affect the padding applied to the title TextView.
+        mTabsPaneWidth = 0;
+
         mTitle = (TextView) mLayout.findViewById(R.id.awesome_bar_title);
         mTitlePadding = mTitle.getPaddingRight();
         if (Build.VERSION.SDK_INT >= 16)
             mTitle.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
 
-        mAwesomeBar = (Button) mLayout.findViewById(R.id.awesome_bar);
+        mAwesomeBar = mLayout.findViewById(R.id.awesome_bar);
         mAwesomeBar.setOnClickListener(new Button.OnClickListener() {
             public void onClick(View v) {
                 mActivity.autoHideTabs();
@@ -460,6 +480,54 @@ public class BrowserToolbar implements ViewSwitcher.ViewFactory,
         updateTabs(mActivity.areTabsShown());
     }
 
+    public void prepareTabsAnimation(PropertyAnimator animator, int width) {
+        // This is negative before we want to keep the right edge in the same
+        // position while animating the left-most elements below.
+        animator.attach(mAwesomeBarRightEdge,
+                        PropertyAnimator.Property.TRANSLATION_X,
+                        -width);
+
+        animator.attach(mAwesomeBar,
+                        PropertyAnimator.Property.TRANSLATION_X,
+                        width);
+        animator.attach(mAddressBarBg,
+                        PropertyAnimator.Property.TRANSLATION_X,
+                        width);
+        animator.attach(mTabs,
+                        PropertyAnimator.Property.TRANSLATION_X,
+                        width);
+        animator.attach(mTabsCount,
+                        PropertyAnimator.Property.TRANSLATION_X,
+                        width);
+        animator.attach(mBack,
+                        PropertyAnimator.Property.TRANSLATION_X,
+                        width);
+        animator.attach(mForward,
+                        PropertyAnimator.Property.TRANSLATION_X,
+                        width);
+        animator.attach(mTitle,
+                        PropertyAnimator.Property.TRANSLATION_X,
+                        width);
+        animator.attach(mFavicon,
+                        PropertyAnimator.Property.TRANSLATION_X,
+                        width);
+        animator.attach(mSiteSecurity,
+                        PropertyAnimator.Property.TRANSLATION_X,
+                        width);
+
+        mTabsPaneWidth = width;
+
+        // Only update title padding immediatelly when shrinking the browser
+        // toolbar. Leave the padding update to the end of the animation when
+        // expanding (see finishTabsAnimation()).
+        if (mTabsPaneWidth > 0)
+            setPageActionVisibility(mStop.getVisibility() == View.VISIBLE);
+    }
+
+    public void finishTabsAnimation() {
+        setPageActionVisibility(mStop.getVisibility() == View.VISIBLE);
+    }
+
     public void updateTabs(boolean areTabsShown) {
         if (areTabsShown) {
             mTabs.getBackground().setLevel(TABS_EXPANDED);
@@ -511,7 +579,7 @@ public class BrowserToolbar implements ViewSwitcher.ViewFactory,
         // We want title to fill the whole space available for it when there are icons
         // being shown on the right side of the toolbar as the icons already have some
         // padding in them. This is just to avoid wasting space when icons are shown.
-        mTitle.setPadding(0, 0, (!mShowReader && !isLoading ? mTitlePadding : 0), 0);
+        mTitle.setPadding(0, 0, (!mShowReader && !isLoading ? mTitlePadding : 0) + mTabsPaneWidth, 0);
 
         updateFocusOrder();
     }
diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java
index a7740b77d6bd..b2080fc022fc 100644
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -175,7 +175,7 @@ abstract public class GeckoApp
     protected FormAssistPopup mFormAssistPopup;
     protected TabsPanel mTabsPanel;
 
-    private LayerView mLayerView;
+    protected LayerView mLayerView;
     private AbsoluteLayout mPluginContainer;
 
     private FullScreenHolder mFullScreenPluginContainer;
@@ -1671,7 +1671,7 @@ abstract public class GeckoApp
 
         if (mLayerView == null) {
             LayerView layerView = (LayerView) findViewById(R.id.layer_view);
-            layerView.createLayerClient(GeckoAppShell.getEventDispatcher());
+            layerView.initializeView(GeckoAppShell.getEventDispatcher());
             mLayerView = layerView;
         }
 
diff --git a/mobile/android/base/Makefile.in b/mobile/android/base/Makefile.in
index 68208e435f54..72ad5c566b2d 100644
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -40,6 +40,7 @@ FENNEC_JAVA_FILES = \
   ActivityHandlerHelper.java \
   AndroidImport.java \
   AndroidImportPreference.java \
+  AnimatorProxy.java \
   AlertNotification.java \
   AnimatedHeightLayout.java \
   AwesomeBar.java \
diff --git a/mobile/android/base/PropertyAnimator.java b/mobile/android/base/PropertyAnimator.java
index 21c3abc3426f..5b8a2418b979 100644
--- a/mobile/android/base/PropertyAnimator.java
+++ b/mobile/android/base/PropertyAnimator.java
@@ -5,36 +5,37 @@
 
 package org.mozilla.gecko;
 
+import android.os.Build;
 import android.os.Handler;
 import android.util.Log;
+import android.view.Choreographer;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.animation.AnimationUtils;
 import android.view.animation.DecelerateInterpolator;
 import android.view.animation.Interpolator;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Timer;
-import java.util.TimerTask;
 
-public class PropertyAnimator extends TimerTask {
+public class PropertyAnimator implements Runnable {
     private static final String LOGTAG = "GeckoPropertyAnimator";
 
-    private Timer mTimer;
-    private Interpolator mInterpolator;
-
     public static enum Property {
-        SHRINK_LEFT,
-        SHRINK_TOP,
-        SLIDE_TOP,
-        SLIDE_LEFT
+        ALPHA,
+        TRANSLATION_X,
+        TRANSLATION_Y,
+        SCROLL_X,
+        SCROLL_Y,
+        HEIGHT
     }
 
     private class ElementHolder {
         View view;
+        AnimatorProxy proxy;
         Property property;
-        int from;
-        int to;
+        float from;
+        float to;
     }
 
     public static interface PropertyAnimationListener {
@@ -42,38 +43,39 @@ public class PropertyAnimator extends TimerTask {
         public void onPropertyAnimationEnd();
     }
 
-    private int mCount;
-    private int mDuration;
+    private Interpolator mInterpolator;
+    private long mStartTime;
+    private long mDuration;
+    private float mDurationReciprocal;
     private List mElementsList;
     private PropertyAnimationListener mListener;
-
-    // Default refresh rate in ms.
-    private static final int INTERVAL = 10;
+    private FramePoster mFramePoster;
+    private boolean mUseHardwareLayer;
 
     public PropertyAnimator(int duration) {
-        mDuration = duration;
-        mTimer = new Timer();
-        mInterpolator = new DecelerateInterpolator();
-        mElementsList = new ArrayList();
+        this(duration, new DecelerateInterpolator());
     }
 
-    public void attach(View view, Property property, int to) {
-        if (!(view instanceof ViewGroup) && (property == Property.SHRINK_LEFT ||
-                                             property == Property.SHRINK_TOP)) {
-            Log.i(LOGTAG, "Margin can only be animated on Viewgroups");
-            return;
-        }
+    public PropertyAnimator(int duration, Interpolator interpolator) {
+        mDuration = duration;
+        mDurationReciprocal = 1.0f / (float) mDuration;
+        mInterpolator = interpolator;
+        mElementsList = new ArrayList();
+        mFramePoster = FramePoster.create(this);
+        mUseHardwareLayer = true;
+    }
 
+    public void setUseHardwareLayer(boolean useHardwareLayer) {
+        mUseHardwareLayer = useHardwareLayer;
+    }
+
+    public void attach(View view, Property property, float to) {
         ElementHolder element = new ElementHolder();
 
         element.view = view;
+        element.proxy = AnimatorProxy.create(view);
         element.property = property;
-
-        // Sliding should happen in the negative.
-        if (property == Property.SLIDE_TOP || property == Property.SLIDE_LEFT)
-            element.to = to * -1;
-        else
-            element.to = to;
+        element.to = to;
 
         mElementsList.add(element);
     }
@@ -84,39 +86,46 @@ public class PropertyAnimator extends TimerTask {
 
     @Override
     public void run() {
-        float interpolation = mInterpolator.getInterpolation((float) (mCount * INTERVAL) / (float) mDuration);
+        int timePassed = (int) (AnimationUtils.currentAnimationTimeMillis() - mStartTime);
+        if (timePassed >= mDuration) {
+            stop();
+            return;
+        }
+
+        float interpolation = mInterpolator.getInterpolation(timePassed * mDurationReciprocal);
 
         for (ElementHolder element : mElementsList) { 
-            int delta = element.from + (int) ((element.to - element.from) * interpolation);
+            float delta = element.from + ((element.to - element.from) * interpolation);
             invalidate(element, delta);
         }
 
-        mCount++;
-
-        if (mCount * INTERVAL >= mDuration)
-            stop();
+        mFramePoster.postNextAnimationFrame();
     }
 
     public void start() {
-        mCount = 0;
+        mStartTime = AnimationUtils.currentAnimationTimeMillis();
 
         // Fix the from value based on current position and property
         for (ElementHolder element : mElementsList) {
-            if (element.property == Property.SLIDE_TOP)
-                element.from = element.view.getScrollY();
-            else if (element.property == Property.SLIDE_LEFT)
-                element.from = element.view.getScrollX();
-            else {
-                ViewGroup.MarginLayoutParams params = ((ViewGroup.MarginLayoutParams) element.view.getLayoutParams());
-                if (element.property == Property.SHRINK_TOP)
-                    element.from = params.topMargin;
-                else if (element.property == Property.SHRINK_LEFT)
-                    element.from = params.leftMargin;
-            }
+            if (element.property == Property.ALPHA)
+                element.from = element.proxy.getAlpha();
+            else if (element.property == Property.TRANSLATION_Y)
+                element.from = element.proxy.getTranslationY();
+            else if (element.property == Property.TRANSLATION_X)
+                element.from = element.proxy.getTranslationX();
+            else if (element.property == Property.SCROLL_Y)
+                element.from = element.proxy.getScrollY();
+            else if (element.property == Property.SCROLL_X)
+                element.from = element.proxy.getScrollX();
+            else if (element.property == Property.HEIGHT)
+                element.from = element.proxy.getHeight();
+
+            if (shouldEnableHardwareLayer(element))
+                element.view.setLayerType(View.LAYER_TYPE_HARDWARE, null);
         }
 
         if (mDuration != 0) {
-            mTimer.scheduleAtFixedRate(this, 0, INTERVAL);
+            mFramePoster.postFirstAnimationFrame();
 
             if (mListener != null)
                 mListener.onPropertyAnimationStart();
@@ -124,13 +133,13 @@ public class PropertyAnimator extends TimerTask {
     }
 
     public void stop() {
-        cancel();
-        mTimer.cancel();
-        mTimer.purge();
+        mFramePoster.cancelAnimationFrame();
 
         // Make sure to snap to the end position.
         for (ElementHolder element : mElementsList) { 
             invalidate(element, element.to);
+            if (shouldEnableHardwareLayer(element))
+                element.view.setLayerType(View.LAYER_TYPE_NONE, null);
         }
 
         mElementsList.clear();
@@ -141,39 +150,115 @@ public class PropertyAnimator extends TimerTask {
         }
     }
 
-    private void invalidate(final ElementHolder element, final int delta) {
+    private boolean shouldEnableHardwareLayer(ElementHolder element) {
+        if (!mUseHardwareLayer)
+            return false;
+
+        if (Build.VERSION.SDK_INT < 11)
+            return false;
+
+        if (!(element.view instanceof ViewGroup))
+            return false;
+
+        if (element.property == Property.ALPHA ||
+            element.property == Property.TRANSLATION_Y ||
+            element.property == Property.TRANSLATION_X)
+            return true;
+
+        return false;
+    }
+
+    private void invalidate(final ElementHolder element, final float delta) {
         final View view = element.view;
 
-        Handler handler = view.getHandler();
-        if (handler == null)
+        // check to see if the view was detached between the check above and this code
+        // getting run on the UI thread.
+        if (view.getHandler() == null)
             return;
 
-        // Post the layout changes on the view's UI thread.
-        handler.post(new Runnable() {
-            @Override
-            public void run() {
-                // check to see if the view was detached between the check above and this code
-                // getting run on the UI thread.
-                if (view.getHandler() == null)
-                    return;
-            
-                if (element.property == Property.SLIDE_TOP) {
-                    view.scrollTo(view.getScrollX(), delta);
-                    return;
-                } else if (element.property == Property.SLIDE_LEFT) {
-                    view.scrollTo(delta, view.getScrollY());
-                    return;
+        if (element.property == Property.ALPHA)
+            element.proxy.setAlpha(delta);
+        else if (element.property == Property.TRANSLATION_Y)
+            element.proxy.setTranslationY(delta);
+        else if (element.property == Property.TRANSLATION_X)
+            element.proxy.setTranslationX(delta);
+        else if (element.property == Property.SCROLL_Y)
+            element.proxy.scrollTo(element.proxy.getScrollX(), (int) delta);
+        else if (element.property == Property.SCROLL_X)
+            element.proxy.scrollTo((int) delta, element.proxy.getScrollY());
+        else if (element.property == Property.HEIGHT)
+            element.proxy.setHeight((int) delta);
+    }
+
+    private static abstract class FramePoster {
+        public static FramePoster create(Runnable r) {
+            if (Build.VERSION.SDK_INT >= 16)
+                return new FramePosterPostJB(r);
+            else
+                return new FramePosterPreJB(r);
+        }
+
+        public abstract void postFirstAnimationFrame();
+        public abstract void postNextAnimationFrame();
+        public abstract void cancelAnimationFrame();
+    }
+
+    private static class FramePosterPreJB extends FramePoster {
+        // Default refresh rate in ms.
+        private static final int INTERVAL = 10;
+
+        private Handler mHandler;
+        private Runnable mRunnable;
+
+        public FramePosterPreJB(Runnable r) {
+            mHandler = new Handler();
+            mRunnable = r;
+        }
+
+        @Override
+        public void postFirstAnimationFrame() {
+            mHandler.post(mRunnable);
+        }
+
+        @Override
+        public void postNextAnimationFrame() {
+            mHandler.postDelayed(mRunnable, INTERVAL);
+        }
+
+        @Override
+        public void cancelAnimationFrame() {
+            mHandler.removeCallbacks(mRunnable);
+        }
+    }
+
+    private static class FramePosterPostJB extends FramePoster {
+        private Choreographer mChoreographer;
+        private Choreographer.FrameCallback mCallback;
+
+        public FramePosterPostJB(final Runnable r) {
+            mChoreographer = Choreographer.getInstance();
+
+            mCallback = new Choreographer.FrameCallback() {
+                @Override
+                public void doFrame(long frameTimeNanos) {
+                    r.run();
                 }
+            };
+        }
 
-                ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
+        @Override
+        public void postFirstAnimationFrame() {
+            postNextAnimationFrame();
+        }
 
-                if (element.property == Property.SHRINK_TOP)
-                    params.setMargins(params.leftMargin, delta, params.rightMargin, params.bottomMargin);
-                else if (element.property == Property.SHRINK_LEFT)
-                    params.setMargins(delta, params.topMargin, params.rightMargin, params.bottomMargin);
+        @Override
+        public void postNextAnimationFrame() {
+            mChoreographer.postFrameCallback(mCallback);
+        }
 
-                view.requestLayout();
-            }
-        });
+        @Override
+        public void cancelAnimationFrame() {
+            mChoreographer.removeFrameCallback(mCallback);
+        }
     }
 }
diff --git a/mobile/android/base/TabsTray.java b/mobile/android/base/TabsTray.java
index fb0968ea1ba8..194c9f828276 100644
--- a/mobile/android/base/TabsTray.java
+++ b/mobile/android/base/TabsTray.java
@@ -8,16 +8,17 @@ package org.mozilla.gecko;
 import org.mozilla.gecko.PropertyAnimator.Property;
 
 import android.content.Context;
-import android.graphics.PointF;
+import android.graphics.Rect;
 import android.graphics.drawable.Drawable;
 import android.text.TextUtils;
 import android.util.AttributeSet;
-import android.view.GestureDetector;
-import android.view.GestureDetector.SimpleOnGestureListener;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
+import android.view.VelocityTracker;
 import android.view.View;
+import android.view.ViewConfiguration;
 import android.view.ViewGroup;
+import android.widget.AbsListView;
 import android.widget.AbsListView.RecyclerListener;
 import android.widget.BaseAdapter;
 import android.widget.Button;
@@ -40,19 +41,10 @@ public class TabsTray extends LinearLayout
     private TabsAdapter mTabsAdapter;
     private boolean mWaitingForClose;
 
-    private GestureDetector mGestureDetector;
-    private TabSwipeGestureListener mListener;
-    // Minimum velocity swipe that will close a tab, in inches/sec
-    private static final int SWIPE_CLOSE_VELOCITY = 5;
-    // Time to animate non-flicked tabs of screen, in milliseconds
-    private static final int MAX_ANIMATION_TIME = 250;
-    // Extra weight given to detecting vertical swipes over horizontal ones
-    private static final float SWIPE_VERTICAL_WEIGHT = 1.5f;
-    private static enum DragDirection {
-        UNKNOWN,
-        HORIZONTAL,
-        VERTICAL
-    }
+    private TabSwipeGestureListener mSwipeListener;
+
+    // Time to animate non-flinged tabs of screen, in milliseconds
+    private static final int ANIMATION_DURATION = 250;
 
     private static final String ABOUT_HOME = "about:home";
 
@@ -68,28 +60,9 @@ public class TabsTray extends LinearLayout
         mTabsAdapter = new TabsAdapter(mContext);
         mList.setAdapter(mTabsAdapter);
 
-        mListener = new TabSwipeGestureListener(mList);
-        mGestureDetector = new GestureDetector(context, mListener);
-
-        mList.setOnTouchListener(new View.OnTouchListener() {
-            public  boolean onTouch(View v, MotionEvent event) {
-                boolean result = mGestureDetector.onTouchEvent(event);
-
-                // if this is an touch end event, we need to reset the state
-                // of the gesture listener
-                switch (event.getAction() & MotionEvent.ACTION_MASK) {
-                    case MotionEvent.ACTION_UP:
-                      mListener.onTouchEnd(event);
-                }
-
-                // the simple gesture detector doesn't actually call our methods for every touch event
-                // if we're horizontally scrolling we should always return true to prevent scrolling the list
-                if (mListener.getDirection() == DragDirection.HORIZONTAL)
-                    result = true;
-
-                return result;
-            }
-        });
+        mSwipeListener = new TabSwipeGestureListener(mList);
+        mList.setOnTouchListener(mSwipeListener);
+        mList.setOnScrollListener(mSwipeListener.makeScrollListener());
 
         mList.setRecyclerListener(new RecyclerListener() {
             @Override
@@ -159,7 +132,7 @@ public class TabsTray extends LinearLayout
             mOnCloseClickListener = new Button.OnClickListener() {
                 public void onClick(View v) {
                     TabRow tab = (TabRow) v.getTag();
-                    animateTo(tab.info, tab.info.getWidth(), MAX_ANIMATION_TIME);
+                    animateClose(tab.info, tab.info.getWidth());
                 }
             };
         }
@@ -264,10 +237,6 @@ public class TabsTray extends LinearLayout
             else
                 row.info.setBackgroundResource(R.drawable.tabs_tray_default_selector);
 
-            // this may be a recycled view that was animated off screen
-            // reset the scroll state here
-            row.info.scrollTo(0,0);
-
             row.title.setText(tab.getDisplayTitle());
 
             row.close.setTag(row);
@@ -295,155 +264,294 @@ public class TabsTray extends LinearLayout
         }
     }
 
-    private void animateTo(final View view, int x, int duration) {
-        PropertyAnimator pa = new PropertyAnimator(duration);
-        pa.attach(view, Property.SLIDE_LEFT, x);
-        if (x != 0 && !mWaitingForClose) {
-            mWaitingForClose = true;
-
-            TabRow tab = (TabRow)view.getTag();
-            final int tabId = tab.id;
-
-            pa.setPropertyAnimationListener(new PropertyAnimator.PropertyAnimationListener() {
-                public void onPropertyAnimationStart() { }
-                public void onPropertyAnimationEnd() {
-                    Tabs tabs = Tabs.getInstance();
-                    Tab tab = tabs.getTab(tabId);
-                    tabs.closeTab(tab);
-                }
-            });
-        } else if (x != 0 && mWaitingForClose) {
-          // if this asked us to close, but we were already doing it just bail out
-          return;
-        }
-        pa.start();
+    private boolean hasOnlyOneTab() {
+        return (mTabsAdapter != null && mTabsAdapter.getCount() == 1);
     }
 
-    private class TabSwipeGestureListener extends SimpleOnGestureListener {
-        private View mList = null;
-        private View mView = null;
-        private PointF start = null;
-        private DragDirection dir = DragDirection.UNKNOWN;
+    private void animateClose(final View view, int x) {
+        // Just bail out, if we're already closing
+        if (mWaitingForClose)
+            return;
 
-        public TabSwipeGestureListener(View v) {
-            mList = v;
+        PropertyAnimator animator = new PropertyAnimator(ANIMATION_DURATION);
+        animator.attach(view, Property.ALPHA, 0);
+        animator.attach(view, Property.TRANSLATION_X, x);
+
+        mWaitingForClose = true;
+
+        animator.setPropertyAnimationListener(new PropertyAnimator.PropertyAnimationListener() {
+            public void onPropertyAnimationStart() { }
+            public void onPropertyAnimationEnd() {
+                animateFinishClose(view);
+            }
+        });
+
+        animator.start();
+    }
+
+    private void animateFinishClose(final View view) {
+        PropertyAnimator animator = new PropertyAnimator(ANIMATION_DURATION);
+        animator.attach(view, Property.HEIGHT, 1);
+
+        TabRow tab = (TabRow)view.getTag();
+        final int tabId = tab.id;
+        final int originalHeight = view.getHeight();
+
+        animator.setPropertyAnimationListener(new PropertyAnimator.PropertyAnimationListener() {
+            public void onPropertyAnimationStart() { }
+            public void onPropertyAnimationEnd() {
+                // Reset view presentation as it will be recycled in the
+                // list view by the adapter.
+                AnimatorProxy proxy = AnimatorProxy.create(view);
+                proxy.setAlpha(1);
+                proxy.setTranslationX(0);
+                proxy.setHeight(originalHeight);
+
+                Tabs tabs = Tabs.getInstance();
+                Tab tab = tabs.getTab(tabId);
+                tabs.closeTab(tab);
+            }
+        });
+
+        animator.start();
+    }
+
+    private void animateCancel(final View view) {
+        PropertyAnimator animator = new PropertyAnimator(ANIMATION_DURATION);
+        animator.attach(view, Property.ALPHA, 1);
+        animator.attach(view, Property.TRANSLATION_X, 0);
+
+        animator.setPropertyAnimationListener(new PropertyAnimator.PropertyAnimationListener() {
+            public void onPropertyAnimationStart() { }
+            public void onPropertyAnimationEnd() {
+                if (!hasOnlyOneTab()) {
+                    TabRow tab = (TabRow) view.getTag();
+                    tab.close.setVisibility(View.VISIBLE);
+                }
+            }
+        });
+
+        animator.start();
+    }
+
+    private class TabSwipeGestureListener implements View.OnTouchListener {
+        private int mSwipeThreshold;
+        private int mMinFlingVelocity;
+        private int mMaxFlingVelocity;
+        private VelocityTracker mVelocityTracker;
+
+        private ListView mListView;
+        private int mListWidth = 1;
+
+        private View mSwipeView;
+        private AnimatorProxy mSwipeProxy;
+        private int mSwipeViewPosition;
+        private Runnable mPendingCheckForTap;
+
+        private float mSwipeStart;
+        private boolean mSwiping;
+        private boolean mEnabled;
+
+        public TabSwipeGestureListener(ListView listView) {
+            mListView = listView;
+
+            mSwipeView = null;
+            mSwipeProxy = null;
+            mSwipeViewPosition = ListView.INVALID_POSITION;
+            mSwiping = false;
+            mEnabled = true;
+
+            ViewConfiguration vc = ViewConfiguration.get(listView.getContext());
+            mSwipeThreshold = vc.getScaledTouchSlop();
+            mMinFlingVelocity = vc.getScaledMinimumFlingVelocity();
+            mMaxFlingVelocity = vc.getScaledMaximumFlingVelocity();
         }
 
-        public DragDirection getDirection() {
-            return dir;
+        public void setEnabled(boolean enabled) {
+            mEnabled = enabled;
+        }
+
+        public AbsListView.OnScrollListener makeScrollListener() {
+            return new AbsListView.OnScrollListener() {
+                @Override
+                public void onScrollStateChanged(AbsListView absListView, int scrollState) {
+                    setEnabled(scrollState != AbsListView.OnScrollListener.SCROLL_STATE_TOUCH_SCROLL);
+                }
+
+                @Override
+                public void onScroll(AbsListView absListView, int i, int i1, int i2) {
+                }
+            };
         }
 
         @Override
-        public boolean onDown(MotionEvent e) {
-            mView = findViewAt((int)e.getX(), (int)e.getY());
-            if (mView == null)
+        public boolean onTouch(View view, MotionEvent e) {
+            if (!mEnabled)
                 return false;
 
-            mView.setPressed(true);
-            start = new PointF(e.getX(), e.getY());
-            return false;
-        }
+            if (mListWidth < 2)
+                mListWidth = mListView.getWidth();
 
-        public boolean onTouchEnd(MotionEvent e) {
-            if (mView != null) {
+            switch (e.getActionMasked()) {
+                case MotionEvent.ACTION_DOWN: {
+                    // Check if we should set pressed state on the
+                    // touched view after a standard delay.
+                    triggerCheckForTap();
 
-                // if the user was dragging horizontally, check to see if we should close the tab
-                if (dir == DragDirection.HORIZONTAL) {
-                    int finalPos = 0;
-                    // if the swipe started on the left and ended in the right 25% of the tray
-                    // or vice versa, close the tab
-                    if ((start.x > mList.getWidth() / 2 && e.getX() < mList.getWidth() * 0.25 )) {
-                        finalPos = -1 * mView.getWidth();
-                    } else if (start.x < mList.getWidth() / 2 && e.getX() > mList.getWidth() * 0.75) {
-                        finalPos = mView.getWidth();
+                    // Find out which view is being touched
+                    mSwipeView = findViewAt(e.getRawX(), e.getRawY());
+
+                    if (mSwipeView != null) {
+                        mSwipeStart = e.getRawX();
+                        mSwipeViewPosition = mListView.getPositionForView(mSwipeView);
+
+                        mVelocityTracker = VelocityTracker.obtain();
+                        mVelocityTracker.addMovement(e);
                     }
-    
-                    animateTo(mView, finalPos, MAX_ANIMATION_TIME);
-                } else if (mView != null && dir == DragDirection.UNKNOWN) {
-                    // the user didn't attempt to scroll the view, so select the row
-                    TabRow tab = (TabRow)mView.getTag();
-                    int tabId = tab.id;
-                    Tabs.getInstance().selectTab(tabId);
-                    autoHidePanel();
+
+                    view.onTouchEvent(e);
+                    return true;
                 }
-            }
 
-            mView = null;
-            start = null;
-            dir = DragDirection.UNKNOWN;
-            return false;
-        }
+                case MotionEvent.ACTION_UP: {
+                    if (mSwipeView == null)
+                        break;
 
-        @Override
-        public boolean onScroll(MotionEvent event1, MotionEvent event2, float distanceX, float distanceY) {
-            if (mView == null)
-                return false;
+                    mSwipeView.setPressed(false);
 
-            // if there is only one tab left, we want to recognize the scroll and
-            // stop any click/selection events, but not scroll/close the view
-            if (Tabs.getInstance().getCount() == 1) {
-                mView.setPressed(false);
-                mView = null;
-                return false;
-            }
+                    if (!mSwiping) {
+                        TabRow tab = (TabRow) mSwipeView.getTag();
+                        Tabs.getInstance().selectTab(tab.id);
+                        autoHidePanel();
+                        break;
+                    }
 
-            if (dir == DragDirection.UNKNOWN) {
-                // check if this scroll is more horizontal than vertical. Weight vertical drags a little higher
-                // by using a multiplier
-                if (Math.abs(distanceX) > Math.abs(distanceY) * SWIPE_VERTICAL_WEIGHT) {
-                    dir = DragDirection.HORIZONTAL;
-                } else {
-                    dir = DragDirection.VERTICAL;
+                    float deltaX = mSwipeProxy.getTranslationX();
+
+                    mVelocityTracker.addMovement(e);
+                    mVelocityTracker.computeCurrentVelocity(1000, mMaxFlingVelocity);
+
+                    float velocityX = Math.abs(mVelocityTracker.getXVelocity());
+                    float velocityY = Math.abs(mVelocityTracker.getYVelocity());
+
+                    boolean dismiss = false;
+                    boolean dismissRight = false;
+
+                    if (Math.abs(deltaX) > mListWidth / 2) {
+                        dismiss = true;
+                        dismissRight = (deltaX > 0);
+                    } else if (mMinFlingVelocity <= velocityX && velocityX <= mMaxFlingVelocity
+                            && velocityY < velocityX) {
+                        dismiss = mSwiping && !hasOnlyOneTab() && (deltaX * mVelocityTracker.getXVelocity() > 0);
+                        dismissRight = (mVelocityTracker.getXVelocity() > 0);
+                    }
+
+                    if (dismiss)
+                        animateClose(mSwipeView, (dismissRight ? mListWidth : -mListWidth));
+                    else
+                        animateCancel(mSwipeView);
+
+                    mVelocityTracker = null;
+                    mSwipeView = null;
+                    mSwipeViewPosition = ListView.INVALID_POSITION;
+                    mSwipeProxy = null;
+
+                    mSwipeStart = 0;
+                    mSwiping = false;
+
+                    break;
                 }
-                mView.setPressed(false);
-            }
 
-            if (dir == DragDirection.HORIZONTAL) {
-                mView.scrollBy((int) distanceX, 0);
-                return true;
+                case MotionEvent.ACTION_MOVE: {
+                    if (mSwipeView == null)
+                        break;
+
+                    mVelocityTracker.addMovement(e);
+
+                    float deltaX = e.getRawX() - mSwipeStart;
+                    if (Math.abs(deltaX) > mSwipeThreshold) {
+                        // If we're actually swiping, make sure we don't
+                        // set pressed state on the swiped view.
+                        cancelCheckForTap();
+
+                        mSwiping = true;
+                        mListView.requestDisallowInterceptTouchEvent(true);
+
+                        TabRow tab = (TabRow) mSwipeView.getTag();
+                        tab.close.setVisibility(View.INVISIBLE);
+
+                        // Stops listview from highlighting the touched item
+                        // in the list when swiping.
+                        MotionEvent cancelEvent = MotionEvent.obtain(e);
+                        cancelEvent.setAction(MotionEvent.ACTION_CANCEL |
+                                (e.getActionIndex() << MotionEvent.ACTION_POINTER_INDEX_SHIFT));
+                        mListView.onTouchEvent(cancelEvent);
+
+                        mSwipeProxy = AnimatorProxy.create(mSwipeView);
+                    }
+
+                    if (mSwiping) {
+                        if (hasOnlyOneTab()) {
+                            mSwipeProxy.setTranslationX(deltaX / 4);
+                        } else {
+                            mSwipeProxy.setTranslationX(deltaX);
+                            mSwipeProxy.setAlpha(Math.max(0.1f, Math.min(1f,
+                                    1f - 2f * Math.abs(deltaX) / mListWidth)));
+                        }
+
+                        return true;
+                    }
+
+                    break;
+                }
             }
 
             return false;
         }
 
-        @Override
-        public boolean onFling(MotionEvent event1, MotionEvent event2, float velocityX, float velocityY) {
-            if (mView == null || Tabs.getInstance().getCount() == 1)
-                return false;
-
-            // velocityX is in pixels/sec. divide by pixels/inch to compare it with swipe velocity
-            // also make sure that the swipe is in a mostly horizontal direction
-            if (Math.abs(velocityX) > Math.abs(velocityY * SWIPE_VERTICAL_WEIGHT) &&
-                Math.abs(velocityX)/GeckoAppShell.getDpi() > SWIPE_CLOSE_VELOCITY) {
-                // is this is a swipe, we want to continue the row moving at the swipe velocity
-                float d = (velocityX > 0 ? 1 : -1) * mView.getWidth();
-                // convert the velocity (px/sec) to ms by taking the distance
-                // multiply by 1000 to convert seconds to milliseconds
-                animateTo(mView, (int)d, (int)((d + mView.getScrollX())*1000/velocityX));
-            }
-
-            return false; 
-        }
-
-        private View findViewAt(int x, int y) {
+        private View findViewAt(float rawX, float rawY) {
             if (mList == null)
                 return null;
 
-            ListView list = (ListView)mList;
-            x += list.getScrollX();
-            y += list.getScrollY();
+            Rect rect = new Rect();
 
-            final int count = list.getChildCount();
-            for (int i = count - 1; i >= 0; i--) {
-                View child = list.getChildAt(i);
-                if (child.getVisibility() == View.VISIBLE) {
-                    if ((x >= child.getLeft()) && (x < child.getRight())
-                            && (y >= child.getTop()) && (y < child.getBottom())) {
-                        return child;
-                    }
-                }
+            int[] listViewCoords = new int[2];
+            mListView.getLocationOnScreen(listViewCoords);
+
+            int x = (int) rawX - listViewCoords[0];
+            int y = (int) rawY - listViewCoords[1];
+
+            for (int i = 0; i < mListView.getChildCount(); i++) {
+                View child = mListView.getChildAt(i);
+                child.getHitRect(rect);
+
+                if (rect.contains(x, y))
+                    return child;
             }
+
             return null;
         }
+
+        private void triggerCheckForTap() {
+            if (mPendingCheckForTap == null)
+                mPendingCheckForTap = new CheckForTap();
+
+            mListView.postDelayed(mPendingCheckForTap, ViewConfiguration.getTapTimeout());
+        }
+
+        private void cancelCheckForTap() {
+            if (mPendingCheckForTap == null)
+                return;
+
+            mListView.removeCallbacks(mPendingCheckForTap);
+        }
+
+        private class CheckForTap implements Runnable {
+            @Override
+            public void run() {
+                if (!mSwiping && mSwipeView != null && mEnabled)
+                    mSwipeView.setPressed(true);
+            }
+        }
     }
 }
diff --git a/mobile/android/base/gfx/LayerView.java b/mobile/android/base/gfx/LayerView.java
index 2e43d81ec5b0..11d3453bada3 100644
--- a/mobile/android/base/gfx/LayerView.java
+++ b/mobile/android/base/gfx/LayerView.java
@@ -63,7 +63,13 @@ public class LayerView extends FrameLayout {
     public static final int PAINT_BEFORE_FIRST = 0;
     public static final int PAINT_AFTER_FIRST = 1;
 
-    boolean shouldUseTextureView() {
+    public boolean shouldUseTextureView() {
+        // Disable TextureView support for now as it causes panning/zooming
+        // performance regressions (see bug 792259). Uncomment the code below
+        // once this bug is fixed.
+        return false;
+
+        /*
         // we can only use TextureView on ICS or higher
         if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
             Log.i(LOGTAG, "Not using TextureView: not on ICS+");
@@ -77,19 +83,30 @@ public class LayerView extends FrameLayout {
         } catch (Exception e) {
             Log.i(LOGTAG, "Not using TextureView: caught exception checking for hw accel: " + e.toString());
             return false;
-        }
+        } */
     }
 
     public LayerView(Context context, AttributeSet attrs) {
         super(context, attrs);
 
+        mGLController = new GLController(this);
+        mPaintState = PAINT_BEFORE_FIRST;
+        mCheckerboardColor = Color.WHITE;
+        mCheckerboardShouldShowChecks = true;
+    }
+
+    public void initializeView(EventDispatcher eventDispatcher) {
+        // This check should not be done while the view tree is still being
+        // created as hardware acceleration will not be enabled at this point.
+        // initializeView() is called on the initialization phase of GeckoApp,
+        // which is late enough to detect hardware acceleration properly.
         if (shouldUseTextureView()) {
-            mTextureView = new TextureView(context);
+            mTextureView = new TextureView(getContext());
             mTextureView.setSurfaceTextureListener(new SurfaceTextureListener());
             mTextureView.setBackgroundColor(Color.WHITE);
             addView(mTextureView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
         } else {
-            mSurfaceView = new SurfaceView(context);
+            mSurfaceView = new SurfaceView(getContext());
             mSurfaceView.setBackgroundColor(Color.WHITE);
             addView(mSurfaceView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
 
@@ -98,13 +115,6 @@ public class LayerView extends FrameLayout {
             holder.setFormat(PixelFormat.RGB_565);
         }
 
-        mGLController = new GLController(this);
-        mPaintState = PAINT_BEFORE_FIRST;
-        mCheckerboardColor = Color.WHITE;
-        mCheckerboardShouldShowChecks = true;
-    }
-
-    public void createLayerClient(EventDispatcher eventDispatcher) {
         mLayerClient = new GeckoLayerClient(getContext(), this, eventDispatcher);
 
         mTouchEventHandler = new TouchEventHandler(getContext(), this, mLayerClient);
diff --git a/mobile/android/base/resources/layout-xlarge-v11/browser_toolbar_menu.xml.in b/mobile/android/base/resources/layout-xlarge-v11/browser_toolbar_menu.xml.in
index 32d007627fb4..8739c0cc2d14 100644
--- a/mobile/android/base/resources/layout-xlarge-v11/browser_toolbar_menu.xml.in
+++ b/mobile/android/base/resources/layout-xlarge-v11/browser_toolbar_menu.xml.in
@@ -10,8 +10,12 @@
               style="@style/BrowserToolbar">
 
     
+                    style="@style/AddressBar">
+
+        
 
         
 
-        
+        
 
         
 
-        
+        
 
-