Hello,
I am not an expert programmer, but it looks to me that you should define the struct before you do the typdef statement. It might be possible to combine them as shown-- I am not sure.
You should also have a head pointer, and a tail pointer, and be using nulls to end your code. I'd be curious to see the whole code piece, and see what your headptr and tailptrs are doing. I think your heads are getting misused.
It might be handy while you are coding to actually draw out the list on paper. Draw out the head pointer. Define it in your code. Draw your structure. Define it in your code. Code in the head pointer assignment to the structure -- on your paper, make the arrow. Make the first data structure prev socket == null. Add that to your paper. Flow out the whole process on your paper, to help you out. Don't draw the arrows, or initialize any of the boxes until you manufacture the code.
Christian