void OffLineKDFWindow::ReadKAMALOffLineFile()
{
char str[256] , *ptr;
char *cptr;
"/home",
"Images (*.gsf)",
this,
"open file dialog",
"Choose a .gsf file to open" );
if(s != NULL)
{
strcpy(str,s);
int row = 0;
int col = 0;
GULAB_FILE_t *gfp = NULL;
int retval_size=1;
GULAB_PACKET_t gsf_row;
int i, PCount,err;
unsigned char formatted_mac_address[18];
table->setColumnWidth (0, 100 );
table->setColumnWidth (1, 100 );
table->setColumnWidth (2, 140 );
table->setColumnWidth (3, 160 );
table->setColumnWidth (4, 150 );
table->setColumnWidth (5, 150 );
table->setColumnWidth (6, 120 );
table->setColumnWidth (7, 200 );
table->setColumnWidth (8, 200 );
table->setColumnWidth (9, 120 );
table->setColumnWidth (10, 150 );
table->setColumnWidth (11,6000 );
int noRows , noColumns;
noRows = table->numRows();
noColumns = table->numCols();
char arr[] = "GULAB off line File reader:";
strcat(arr, s);
setCaption(tr(arr));
if((gfp = gsf_open((unsigned char*)str, READ, NULL, INIT_YES))== NULL)
{
printf("3 Compiler is here..%d\n",gfp->header.total_session_count);
return;
}
for(i=0;i<gfp->header.total_session_count;i++)
{
char tempData[12000] = { 0 };
if((err=gsf_read_next_packet(gfp,(GULAB_PACKET_t *)tempData)) == 0)
{
{
struct in_addr temp;
memcpy((char *)&gsf_row,tempData,sizeof(GULAB_PACKET_t));
temp.s_addr= gsf_row.gph.session_details.source_ip_address;
printf("Setting Text\n");
table->setText( row, 1, (char *)inet_ntoa(temp));
printf("Set text\n");
}
}
printf("Out of if\n");
}
}
printf("Out of 2nd if\n");}
}
void OffLineKDFWindow::ReadKAMALOffLineFile()
{
char str[256] , *ptr;
char *cptr;
QString s = QFileDialog::getOpenFileName(
"/home",
"Images (*.gsf)",
this,
"open file dialog",
"Choose a .gsf file to open" );
if(s != NULL)
{
strcpy(str,s);
int row = 0;
int col = 0;
GULAB_FILE_t *gfp = NULL;
QString KDFline;
int retval_size=1;
GULAB_PACKET_t gsf_row;
int i, PCount,err;
unsigned char formatted_mac_address[18];
table->setColumnWidth (0, 100 );
table->setColumnWidth (1, 100 );
table->setColumnWidth (2, 140 );
table->setColumnWidth (3, 160 );
table->setColumnWidth (4, 150 );
table->setColumnWidth (5, 150 );
table->setColumnWidth (6, 120 );
table->setColumnWidth (7, 200 );
table->setColumnWidth (8, 200 );
table->setColumnWidth (9, 120 );
table->setColumnWidth (10, 150 );
table->setColumnWidth (11,6000 );
int noRows , noColumns;
noRows = table->numRows();
noColumns = table->numCols();
char arr[] = "GULAB off line File reader:";
strcat(arr, s);
setCaption(tr(arr));
if((gfp = gsf_open((unsigned char*)str, READ, NULL, INIT_YES))== NULL)
{
printf("3 Compiler is here..%d\n",gfp->header.total_session_count);
return;
}
for(i=0;i<gfp->header.total_session_count;i++)
{
char tempData[12000] = { 0 };
if((err=gsf_read_next_packet(gfp,(GULAB_PACKET_t *)tempData)) == 0)
{
{
struct in_addr temp;
memcpy((char *)&gsf_row,tempData,sizeof(GULAB_PACKET_t));
temp.s_addr= gsf_row.gph.session_details.source_ip_address;
printf("Setting Text\n");
table->setText( row, 1, (char *)inet_ntoa(temp));
printf("Set text\n");
}
}
printf("Out of if\n");
}
}
printf("Out of 2nd if\n");}
}
To copy to clipboard, switch view to plain text mode
Bookmarks