I need to write a packet sniffer in Linux that detects HTTPS packet that are sent and save the url from the request. I found code for this in security-freak and ran it. This
Why can't you use any library? Homework?
It's hard to answer without having examples from your code, for example how you set sll_pkttype.
sll_pkttype
The urlsnarf tool in the dnsiff suite could be worth a look.