PAM Programming Manual

Link-Level Programming Examples
PAM Programming Manual142482
B-14
Procedures
Rsp_Flag,
Loop_Cnt,
SDU_Cnt,
Begin_User_Data_Size_B,
Current_User_Data_Size_B,
End_User_Data_Size_B,
NoWait_Depth;
char Foreign_Addr[zlam_val_mac_addr_size_b] = {0,0,0,0,0,0};
/* -------------------------- Other ---------------------------- */
int Max_User_Data_Size_B = ( Max_Req_Size -
sizeof ( struct zl2s_ddl_aggr_sdu_hdr_def ) -
sizeof ( struct zl2s_ddl_enet_sdu_hdr_def ) );
int pending_request_cnt = 0;
int Aggr_SDUs_left;
long buffer_lst_ndx;
int file_error;
char test_char;
Procedures
The application program must define the following procedures:
#pragma section Procedures
#pragma page “L2 Service Access Point Exercise Program: Procedures”
/* ----------------------------------------------------------------
PROC: Initialize
---------------------------------------------------------------- */
void Initialize( argc, argv )
int argc;
char *argv[];
{
char Addr_Text[50];
int hex_digit_ndx;
int hex_value;
/* ----------------- look for <L2S device name> ---------------- */
if (argc >= 2)
FNAMEEXPAND( (char *)argv[1],
(int *)L2SAP_file_name,
(int *)” “ );
else {
fprintf(stdout, “No L2SAP device name.\n”);
exit(Abend_exit);
};
/* ------- Look for Port type ( ZLAM_Val_Port_Type_... ) ------ */
if (argc >= 3)
Port_Type = atoi (argv[2]);
else {
fprintf(stdout, “Port type is bad\n”);
exit(Abend_exit);
};
/* ------ Look for Command Code ( ZLAM_Val_SDUType_... ) ------- */
if (argc >= 4)
Command_Code = atoi (argv[3])