'\" te .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved .TH sip_copy_start_line 3SIP "25 Jan 2007" "SunOS 5.11" "Session Initiation Protocol Library Functions" .SH NAME sip_copy_start_line, sip_copy_header, sip_copy_header_by_name, sip_copy_all_headers \- copy headers from a SIP message .SH SYNOPSIS .LP .nf \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lsip\fR [ \fIlibrary\fR ... ] #include \fBint\fR \fIsip_copy_start_line\fR(\fBsip_msg_t\fR \fIfrom_msg\fR, \fBsip_msg_t\fR \fIto_msg\fR); .fi .LP .nf \fBint\fR \fIsip_copy_header\fR(\fBsip_msg_t\fR \fIsip_msg\fR, \fBsip_header_t\fR \fIsip_header\fR, \fBchar *\fR\fIparam\fR); .fi .LP .nf \fBint\fR \fIsip_copy_header_by_name\fR(\fBsip_msg_t\fR \fIfrom_msg\fR, \fBsip_msg_t\fR \fIto_msg\fR, \fBchar *\fR\fIheader_name\fR, \fBchar *\fR\fIparam\fR); .fi .LP .nf \fBint\fR \fIsip_copy_all_headers\fR(\fBsip_msg_t\fR \fIfrom_msg\fR, \fBsip_msg_t\fR \fIto_msg\fR); .fi .SH DESCRIPTION .sp .LP The \fBsip_copy_start_line()\fR function copies the start line, a request or a response line, from \fIfrom_msg\fR to \fIto_msg\fR. .sp .LP The \fBsip_copy_header()\fR function copies the \fBSIP\fR header specified by \fIsip_header\fR to the \fBSIP\fR message \fIsip_msg\fR. A new \fBSIP\fR header is created from \fIsip_header\fR and \fIparam\fR, and is appended to \fIsip_msg\fR. The \fIparam\fR can be non-null. .sp .LP The \fBsip_copy_header_by_name()\fR function copies the header specified by \fIheader_name\fR (long or short form) from \fIfrom_msg\fR to \fIto_msg\fR. The new header is created using the header value from \fIfrom_msg\fR and \fIparam\fR, if non-null, and appended to \fIto_msg\fR. .sp .LP The \fBsip_copy_all_headers()\fR copies all the headers from \fIfrom_msg\fR to \fIto_msg\fR. .SH RETURN VALUES .sp .LP These functions return \fB0\fR on success and the appropriate error on failure. .sp .LP The value of \fBerrno\fR is not changed by these calls in the event of an error. .SH ERRORS .sp .LP These functions can return one of the following errors in case of failure: .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 10n .rt If the required input parameters are \fBNULL\fR or if the header being copied does not exist or is deleted in source \fBSIP\fR message. .RE .sp .ne 2 .mk .na \fB\fBENOMEM\fR\fR .ad .RS 10n .rt Error while allocating memory for creating the new header. .RE .sp .ne 2 .mk .na \fB\fBEPERM\fR\fR .ad .RS 10n .rt If the input SIP message cannot be modified. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelMT-Safe .TE .SH SEE ALSO .sp .LP \fBlibsip\fR(3LIB)