following is main function of my program
Code:
#include<stdio.h>
#include"header.h"
main()
{
unsigned char crc;
unsigned char ar;
pdt pv;
adt av;
frame *f1;
frame fr;
int src1=0;
int dest1=1;
av.ack=9;
//opens a file and assigns a file descriptive to fp
fp=fopen("txtfile","r");
//generates stuffed information
stuff(&pv,fp);
//creates the control byte
control_byte(&pv);
//crc is generated for the information
crc=crc_gent(&pv);
//frame is created..
f1=(frame *)make_frame(&pv,crc,src1,dest1);
//push that frame into a buffer
push(f1);
//check for the acknowledgement from the receiver side
ar=ack_check(&av);
//sliding window is created...
fr = slide(512,ar); //incompatibe type in assignment
}
my header file is
Code:
#include<stdio.h>
//typedef int frame_type;
FILE * fp;
typedef struct payload {
int frm_typ;
unsigned char cb;
unsigned char stuf_info[5];
}pdt;
typedef struct frame {
char st_flag;
int src_addr;
int dest_addr;
pdt p;
unsigned char crc;
char end_flag;
}frame;
struct frame f4[512];
typedef struct ack_frme
{
char st_flg;
int src_addr;
int dest_addr;
unsigned char ack;
char end_flg;
}adt;
i have problem in
fr = slide(512, ar);
slide function is returning a frame..
but for that line its giving error as incompatible types in assignment.