File tree Expand file tree Collapse file tree 2 files changed +374
-204
lines changed
Expand file tree Collapse file tree 2 files changed +374
-204
lines changed Original file line number Diff line number Diff line change @@ -647,6 +647,15 @@ namespace pcpp
647647 friend class SipResponseLayer ;
648648
649649 public:
650+ // / @brief A structure containing parsed components from a SIP response first line.
651+ struct FirstLineData
652+ {
653+ // / @brief The SIP protocol version (e.g., SIP/2.0)
654+ std::string version;
655+ // / @brief The response status code number (e.g., 200, 100)
656+ SipResponseLayer::SipResponseStatusCode statusCode;
657+ };
658+
650659 // / @return The status code as SipResponseLayer#SipResponseStatusCode enum
651660 SipResponseLayer::SipResponseStatusCode getStatusCode () const
652661 {
@@ -689,6 +698,12 @@ namespace pcpp
689698 // / @return The parsed SIP version string or an empty string if version cannot be extracted
690699 static std::string parseVersion (const char * data, size_t dataLen);
691700
701+ // / @brief A static method for parsing the complete SIP response first line from raw data
702+ // / @param data The raw data containing the SIP response line
703+ // / @param dataLen The raw data length
704+ // / @return A pair where first indicates success/failure, and second contains the parsed data.
705+ static std::pair<bool , FirstLineData> parseFirstLine (const char * data, size_t dataLen);
706+
692707 // / @return The size in bytes of the SIP response first line
693708 int getSize () const
694709 {
You can’t perform that action at this time.
0 commit comments