Startpunkten

This commit is contained in:
2026-03-05 13:37:25 +01:00
commit 00233de938
22 changed files with 4613 additions and 0 deletions

52
link.h Normal file
View File

@@ -0,0 +1,52 @@
#ifndef _link_h_
#define _link_h_
#define SABM 401
#define UA 403
#define I 405
#define RR 406
#define DISC 407
#define SIG_LEN 2
#define BO 2
#define SU 1
#define SP 3
#define DEFAULT 10
#define FRAME_ERROR 13
#define FRAME_IS_FULL 34
#define FRAME_NOT_READY 123
#define HEADER_LENGTH 22
#define TWO_BYTES 56
#define UPATH "./link_socket"
#define PPATH "./.phys_socket"
struct Frame;
int SystemError(void);
int GetFrameLength(Frame *frame);
int Default(void);
int DataRequest(void);
int ConnectRequest(void);
int ConnectIndication(void);
int ConnectConfirm(void);
int ConnectResponse(void);
int DisconnectRequest(void);
int DisconnectIndication(void);
int DisconnectResponse(void);
int DisconnectConfirm(void);
int AbortRequest(void);
int AbortIndication(void);
int Status(void);
int Abort(short who);
int Checksum(int data_length);
int PutDataInFrame(char *data, short data_length, Frame *frame, short control);
int ClearFrame(Frame *frame);
int FillInFrame(char *frame, char data, char *charframe);
int CheckFrame(Frame *frame);
int CheckStartHeader(char *frame);
int CheckEndHeader(char *frame);
int CheckCC(Frame *frame);
int FixFrameData(Frame *frame);
int SendFrame(Frame *frame, int socket_id);
int DataIndication(void);
void MainLoop(void);
#endif