Problem in using PF_PACKET sockets over PPP

we are doing a project based on the communication protocols for which PPP is being used to make a link between the serial interfaces. To use the kernel PPP services, PPPD is used to establish the link between two ports. The following prodcedure is used for PPP connection establishment.

On Server Side:

linux-7tmr:~ # pppd nodetach crtscts 192.168.0.1: /dev/ttyS0 9600 &
[1] 4834
linux-7tmr:~ # Using interface ppp1
Connect: ppp1 <–> /dev/ttyS0
Deflate (15) compression enabled
local IP address 192.168.0.1
remote IP address 192.168.2.1

On Client Side:

linux-7tmr:~ # pppd nodetach crtscts 192.168.2.1: /dev/ttyS1 9600 &
[1] 4813
linux-7tmr:~ # Using interface ppp0
Connect: ppp0 <–> /dev/ttyS1
Deflate (15) compression enabled
local IP address 192.168.2.1
remote IP address 192.168.0.1

After establish the ppp connection between two ports i am able send/receive test data from client to server using my UDP client /server programs ( Firtst two files in attachment).

But actually my requirement is to send data using PF_PACKET packet sockets to write/read data to/from directly from data link layer by by-passing higher layers. while using this packet socket type i am getting proper status from sento call from client
program, but i am not to receive at serverside. the following files are my client server programs using PF_PACKET socket family.

pfpacket.c

int sockid, nread, index;
char *name = “ppp0”;
struct ifreq req;
struct sockaddr_ll sll;
char msg[50];

memset ( &req, 0, sizeof ( req ));
strcpy ( req.ifr_name, name );

printf("Server: creating socket
");
if ( (sockid = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_ALL))) < 0)
{
printf(“Server: Problem creating the socket”);
exit(0);
}

printf("Server: binding my local socket
");
if ( ioctl ( sockid, SIOCGIFINDEX, &req ) < 0 )
{
printf ("Error getting interface %s index
", name);
}
index = req.ifr_ifindex;
printf ("Index %d
", index);
bzero ( &sll, sizeof ( sll ));
sll.sll_family = AF_PACKET;
sll.sll_hatype = ARPHRD_PPP;
sll.sll_ifindex = index;

if ( bind ( sockid, (struct sockaddr *)&sll, sizeof ( sll )) < 0 )
{
printf ("Problem binding to interface %s
", name);
}

printf("Server: starting blocking message read
");

while(1)
{
nread = recvfrom(sockid, msg, 15, 0, NULL,0);

if (nread > -1)
printf("Server: message is: %.11s
",msg);
}
close(sockid);
}

pfclient.c

int sockid, retcode, index;
char *name = “ppp0”;
struct ifreq req;
struct sockaddr_ll sll, sll1;
char msg[12];

memset ( &req, 0, sizeof ( req ));
strcpy ( req.ifr_name, name );

if ( ioctl ( sockid, SIOCGIFFLAGS, &req ) < 0 )
{
printf ("Error getting interface %s flags.
%s
", name);
}

if ( ! ( req.ifr_flags & IFF_UP ))

printf ("Bringing interface %s up
", name );
req.ifr_flags |= IFF_UP;
if ( ioctl ( sockid, SIOCSIFFLAGS, &req ) < 0 )
{
printf ("Failed to bring interface %s up.
%s
", name);
}

printf("Client: creating socket
");
if ( (sockid = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_ALL))) < 0)
{
printf(“Client: socket failed”);
exit(0);
}
printf("Client: binding my local socket
");
if ( ioctl ( sockid, SIOCGIFINDEX, &req ) < 0 )
{
printf ("Error getting interface %s index
", name);
}
index = req.ifr_ifindex;
printf ("Index %d
", index);
bzero ( &sll, sizeof ( sll ));
sll.sll_family = AF_PACKET;
sll.sll_hatype = ARPHRD_PPP;
sll.sll_ifindex = index;

if ( bind ( sockid, (struct sockaddr *)&sll, sizeof ( sll )) < 0 )
{
printf ("Problem binding to interface %s
", name);
exit(0);
}

printf("Client: initializing message and sending
");
sprintf(msg, “Hello world”);

while (1)
{

retcode = sendto(sockid, msg, 12,0, NULL, 0);

printf ("Client: sent %d bytes
", retcode);

}
if (retcode < 0)
{
printf(“client: sendto failed”);
exit(0);
}

close(sockid);

}

kindly help me this regard.