Problems Understanding the code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



John,
? look at sip_msg.h and list.h for the SIP headers structures. Macros are used to define standard members of structures. Yes the linked list type is singular linked circular lists.
I use grep or Visual Studio for finding symbols not defined in the current file.
Pjsip does some quirky things like defining structures in .c files instead of .h files. I sometimes move them into .h file when I need access to those structs in another .c file.


--- On Sun, 2/6/11, john smith <pyroflares at gmail.com> wrote:

From: john smith <pyroflares@xxxxxxxxx>
Subject: Problems Understanding the code
To: "pjsip list" <pjsip at lists.pjsip.org>
Date: Sunday, February 6, 2011, 8:37 AM

Hi,

I was going through the pjsip code and found that a lot of linked list is used? throughout the code to add new headers,remove and manupulate them.
but ,what i am unsure at the moment is the type of linked list used for it (i guess we are using circular linked liist but i am not sure)


how i guessed it...
?in this function of pjsip? pjsip_auth_clt_reinit_req 

the line? hdr = rdata->msg_info.msg->hdr.next;
?? while (hdr != &rdata->msg_info.msg->hdr) {


tells me that hdr is pointing to the next instance and with the help of hdr ponter we are traversing the entire linked list until we reach the same position from where we started.

i would be really great? if someone could point out the type of linked list employed.

Also,in the same functon i find this line..
?cached_auth->is_proxy = (hchal->type == PJSIP_H_PROXY_AUTHENTICATE);


i tried to find? (const pjsip_www_authenticate_hdr *hchal;) hcal->type i.e to be precise type is the member i tried to find but to no avail,also besides type? i see many extensions such as slen and next which are not part of the structure and are throughly used throughout the code.


I am a beginner so please,overlook my silly questions and help me in understanding the flow.


Thanks in Advance.
John.


-----Inline Attachment Follows-----

_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip at lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20110211/654f7a88/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux