telnet.c File Reference

Test Program for the telnet protocol. More...

#include <BoardSupport/inc/stdtypes.h>
#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
#include <inttypes.h>
#include <time.h>
#include <string.h>
#include <ctype.h>
#include <Libs/NETlib/net.h>
#include <Libs/NETlib/ftplib.h>
#include <BoardSupport/inc/BoardSpecific.h>
#include <Common/Common.h>
#include <Common/uartio.h>
#include <Common/timer.h>
#include <Common/CPrintf.h>
#include <BoardSupport/config/netconfig.c>
#include "telnetio.h"
#include "efs.def"

Macros

#define TMENU1   0
 
#define TMENU2   1
 
#define EMPTY_LINE   ""
 

Functions

void PrintResult (telnet_return_type *telnet_ret)
 
int transmit_file (SOCKET *server, direntry_type *dir, unsigned int rw, unsigned int flags)
 
int16_t user_menu (T_ComDevice *CmdDevice, char c)
 
int main (void)
 

Variables

char * program_name = "telnet"
 
timeval telnet_stamp1
 
const char * aLogMessages []
 

Detailed Description

                          _         _             _
                       __| |    ___(_) ____ _ __ | |_
                      / _` |   / __| |/ _` | '_ \| __|
                     | (_| | _ \__ \ | (_| | | | | |_
                      \__,_|(_) ___/_|\__, |_| |_|\__|
                     Signalprocessing |___/ Technology
Author
D.SignT GmbH & Co. KG, Claus Hermbusche
Date
2019-06-03

This program installs a Telnet-server on TCP port 23 to perform ASCII up- and downloads to and from configuration file and application file in Intel hex format.

Macro Definition Documentation

#define TMENU1   0
Examples:
Telnet.c.
#define TMENU2   1
Examples:
Telnet.c.
#define EMPTY_LINE   ""
Examples:
Telnet.c.

Function Documentation

void PrintResult ( telnet_return_type telnet_ret)
Examples:
Telnet.c.
212 {
213  /***************************************************************************
214  locals
215  ***************************************************************************/
216  char buffer[25]; /* small buffer for conversion */
217  direntry_type *fp; /* EFS file pointer */
218  struct tm *local_time; /* structure to hold time and date */
219  uint32_t further_details = 0; /* if set true, further details are printed*/
220  timeval stamp2, delta; /* used to determine session time */
221 
222  /***************************************************************************
223  print time stamp
224  ***************************************************************************/
225  local_time = localtime ((const time_t *)&RecentEpoch);
226  sprintf ( buffer, "%s", asctime (local_time));
227  buffer[24] = 0; /* eliminate new line */
228  CPrintf ( "\r\n ---------- UTC time: "VT100_BLUE"%s"VT100_DEFAULT" ----------\r\n", buffer);
229 
230  /***************************************************************************
231  print result string
232  ***************************************************************************/
233  CPrintf ( aLogMessages[telnet_ret-> reason]);
234 
235  /***************************************************************************
236  parse result to switch input/output control
237  ***************************************************************************/
238  switch ( telnet_ret-> reason )
239  {
240  case TELNET_NEW_CON : /* a new telnet connection was established */
241  CPrintf ( " %s\r\n", inet_ntoa(telnet_ret-> offset, buffer));
242  CPuts ( " input control switched to telnet session\r\n");
243  telnet_stamp1 = GetTimeStamp(); /* remember time stamp */
244  CPrintf_select_output (CPRINTF_TELNET_OUTPUT); /* telnet outputs */
245 
246  /*******************************************************************
247  print available commands to telnet terminal
248  *******************************************************************/
249  CPrintf (commands);
250  break;
251 
252  case TELNET_CLOSE_CON : /* telnet connection was closed */
253  CPrintf_select_output (CPRINTF_DEFAULT_OUTPUT); /* default outputs */
254  sprintf ( buffer, "%s", asctime (local_time));
255  buffer[24] = 0; /* eliminate new line */
256  CPrintf ( "\r\n ---------- UTC time: "VT100_BLUE"%s"VT100_DEFAULT" ----------\r\n", buffer);
257 
258  /*******************************************************************
259  calculate session time
260  *******************************************************************/
261  stamp2 = GetTimeStamp();
262  tv_interval (&delta, &telnet_stamp1, &stamp2);
263  local_time = localtime ((const time_t *)&delta);
264  CPuts (" session duration [hh:mm:ss]: ");
266  " %02d:%02d:%02d\r\n"
268  local_time->tm_hour, local_time->tm_min, local_time->tm_sec );
269 
270  CPuts ( " input control switched back to serial terminal\r\n");
271  break;
272 
273  case TELNET_DOWNLOAD :
274  default:
275  further_details = 1; /* print further details on last operation */
276  break;
277  }
278 
279  if (!further_details) return; /* no further details needed */
280 
281  /***************************************************************************
282  print further details on event
283  ***************************************************************************/
284  switch ( telnet_ret-> error_code )
285  {
286  case FTP_NO_ERROR:
287  /*******************************************************************
288  success
289  *******************************************************************/
290  fp = telnet_ret-> fp;
292  if (telnet_ret-> offset==0)
293  {
294  if (!strncmp(fp->dir,"0:",2))
295  {
296  CPuts (" RAM-disc:\r\n");
297  }
298  if (!strncmp(fp->dir,"1:",2))
299  {
300  CPuts (" NAND-disc:\r\n");
301  }
302 #ifdef USE_SPIDRIVE
303  if (!strncmp(fp->dir,"2:",2))
304  {
305  CPuts (" SD-card:\r\n");
306  }
307 #endif
308  }
309  else
310  {
311  CPrintf (" EFS offset: 0x%08"PRIx32"\r\n", telnet_ret-> offset);
312  }
313  CPrintf (" file name: %s\r\n", fp-> name);
314  CPrintf (" file size: %"PRId32"\r\n", telnet_ret-> fp-> size);
315  break;
316  default:
317  /*******************************************************************
318  print error
319  *******************************************************************/
320  net_print_error (telnet_ret-> error_code, CPrintf);
321  break;
322  }
323 
324  /***************************************************************************
325  print available commands
326  ***************************************************************************/
327  CPrintf (commands);
328 }
char * inet_ntoa(uint32_t i_addr, char *s)
Convert IP-address from 0xbbaaddcc to "aaa.bbb.ccc.ddd".
#define TELNET_DOWNLOAD
Definition: telnetio.h:91
uint16_t CPrintf_select_output(uint16_t device)
Definition: cprintf.c:206
char dir[MAX_NAME_LEN]
Definition: net.h:798
Embedded File System directory.
Definition: net.h:796
#define TELNET_NEW_CON
Definition: telnetio.h:88
int CPrintf(const char *_format,...)
Custom printf function.
Definition: cprintf.c:708
#define VT100_DEFAULT
Definition: cprintf.h:150
timeval telnet_stamp1
Definition: telnet.c:149
#define VT100_BLUE
Definition: cprintf.h:146
timeval RecentEpoch
Definition: timer.c:81
#define CPRINTF_DEFAULT_OUTPUT
Definition: BoardSpecific.h:129
#define VT100_RED
Definition: cprintf.h:143
unsigned int uint32_t
Definition: stdint.h:47
static char buffer[100]
Definition: blocksend.c:158
Definition: timer.h:75
#define GetTimeStamp()
Definition: timer.h:81
#define TELNET_CLOSE_CON
Definition: telnetio.h:90
void tv_interval(timeval *e, timeval *t1, timeval *t2)
compute elapsed time
Definition: timer.c:336
const char * aLogMessages[]
Definition: telnet.c:156
int CPuts(const char *_ptr)
Definition: cprintf.c:399
#define FTP_NO_ERROR
Definition: ftplib.h:73
#define CPrintfProgressSuccess()
Definition: cprintf.h:263
int transmit_file ( SOCKET *  server,
direntry_type dir,
unsigned int  rw,
unsigned int  flags 
)
Examples:
Telnet.c.
355 {
356  /***************************************************************************
357  locals
358  ***************************************************************************/
359  char *transmit_buffer;
360 
361  /***************************************************************************
362  fsys_send_all() must be called with a valid read or write flag
363  ***************************************************************************/
364  if (rw & (FTP_WRITE | FTP_READ) == 0)
365  {
366  net_send_string (server, "Error: read/write flag not specified\r\n");
367  return (0);
368  }
369 
370  /***************************************************************************
371  malloc some space for transmission
372  note: the used data buffer for file transmission must be dynamic; it is
373  freed automatically after file transmission
374  ***************************************************************************/
375  transmit_buffer = (char *) malloc (TCP_MAX_PACKET_SIZE * sizeof (char));
376  if ( transmit_buffer == NULL ) /* out of memory */
377  {
378  net_send_string (server, out_of_memory_msg);
379  return (0);
380  }
381 
382  /***************************************************************************
383  initialize transmission
384  ***************************************************************************/
385  dir-> data_con = server; /* actual server connection */
386  dir-> buffer = transmit_buffer; /* data buffer */
387  dir-> pos = 0L; /* offset */
388  dir-> rw = rw; /* transmit direction */
389  dir-> size = fsys_get_file_size (dir); /* get actual file-size */
390 
391  /***************************************************************************
392  in case of write prepare FLASH sectors table
393  ***************************************************************************/
394  if ( rw == FTP_WRITE )
395  {
396  /***********************************************************************
397  initialize FLASH sectors; used for automatic sector erase
398  ***********************************************************************/
399  fsys_init_flash ();
400  }
401 
402  /***************************************************************************
403  transmit data
404  flags:
405  FSYS_SEND_ALL - process blocking call
406  FSYS_ERASE_SECTOR - erase FLASH-sector before data transmission
407  FSYS_WRITE_BOOT_SECTOR - write boot sector
408  ***************************************************************************/
409  fsys_send_all (dir, 0L, flags | FSYS_SEND_ALL);
410 
411  /***************************************************************************
412  previously allocated transmit_buffer is freed automatically in
413  fsys_send_all(), if all data was successfully transmitted. Since we passed
414  FSYS_SEND_ALL, fsys_send_all() is a blocking call until all data is trans-
415  mitted. Thus we don't need to check the return value.
416  ***************************************************************************/
417 
418  /***************************************************************************
419  check success
420  ***************************************************************************/
421  if ( dir-> error < SO_NO_ERROR )
422  {
423  switch (dir-> error)
424  {
426  net_send_string (server, "BIOS protect error\r\n");
427  break;
428  case FSYS_CHECKSUM_ERROR :
429  net_send_string (server, "intel hex checksum error\r\n");
430  break;
431  case FSYS_INTEL_HEX_ERROR :
432  net_send_string (server, "intel hex error\r\n");
433  break;
435  net_send_string (server, "sector erase error\r\n");
436  break;
438  net_send_string (server, "FLASH program error\r\n");
439  break;
441  net_send_string (server, "buffer underrun error\r\n");
442  break;
444  net_send_string (server, "out of memory error\r\n");
445  break;
447  net_send_string (server, "out of range error\r\n");
448  break;
449  default:
450  net_send_string (server, "Unknown error!\r\n");
451  }
452  }
453  else
454  {
455  net_send_string (server, success_msg);
456  }
457 
458  return (0);
459 }
direntry_type * fsys_send_all(direntry_type *fp, int32_t size, int32_t send_all)
File transmission function.
#define FSYS_SEND_ALL
Definition: net.h:878
#define FSYS_OUT_OF_RANGE_ERROR
Definition: net.h:896
#define FSYS_CHECKSUM_ERROR
Definition: net.h:890
#define FSYS_FLASH_PROGRAM_ERROR
Definition: net.h:893
#define NULL
Definition: net.h:126
#define TCP_MAX_PACKET_SIZE
Definition: net.h:681
void fsys_init_flash(void)
Initialize FLASH-sectors.
#define FTP_WRITE
Definition: net.h:866
static char buffer[100]
Definition: blocksend.c:158
#define FSYS_BUFFER_UNDERRUN_ERROR
Definition: net.h:894
int32_t net_send_string(SOCKET *so, char *data)
Send a zero terminated string via the specified socket.
#define FSYS_OUT_OF_MEMORY_ERROR
Definition: net.h:895
#define FSYS_BIOS_PROTECT_ERROR
Definition: net.h:889
#define FSYS_INTEL_HEX_ERROR
Definition: net.h:891
int32_t fsys_get_file_size(direntry_type *fp)
Determine file size of specified file.
#define FSYS_SECTOR_ERASE_ERROR
Definition: net.h:892
#define FTP_READ
Definition: net.h:864
#define SO_NO_ERROR
Definition: net.h:461
int16_t user_menu ( T_ComDevice CmdDevice,
char  c 
)
Examples:
Telnet.c.
475 {
476  /***************************************************************************
477  locals
478  ***************************************************************************/
479  static unsigned int rw = 0; /* read/write flag */
480  static unsigned int menu_level = TMENU1; /* menu level */
481  direntry_type *transfer = NULL;
482  /* some locals for a quicker access to command device members */
483  SOCKET *tcp_server = ((telnet_server_type*)(CmdDevice->gp))->server;
484  telnet_return_type *telnet_ret = &((telnet_server_type*)(CmdDevice->gp))->telnet_ret;
485 
486  /***************************************************************************
487  process a simple two-level single-character menu
488  ***************************************************************************/
489  switch ( menu_level )
490  {
491  case TMENU1: /* first menu level */
492  /*******************************************************************
493  parse command
494  *******************************************************************/
495  switch ( tolower(c) )
496  {
497  /***************************************************************
498  upload command
499  ***************************************************************/
500  case 'u':
501  /***********************************************************
502  set direction
503  ***********************************************************/
504  rw = FTP_WRITE;
505  telnet_ret->reason = TELNET_UPLOAD;
506 
507  /***********************************************************
508  switch to next menu
509  ***********************************************************/
510  menu_level = TMENU2;
511 
512  /***********************************************************
513  print message
514  ***********************************************************/
515  net_send_string (tcp_server, upload_msg);
516  break;
517 
518  /***************************************************************
519  download command
520  ***************************************************************/
521  case 'd':
522  /***********************************************************
523  set direction
524  ***********************************************************/
525  rw = FTP_READ;
526  telnet_ret->reason = TELNET_DOWNLOAD;
527 
528  /***********************************************************
529  print message
530  ***********************************************************/
531  net_send_string (tcp_server, download_msg);
532 
533  /***********************************************************
534  switch to next menu
535  ***********************************************************/
536  menu_level = TMENU2;
537  break;
538 
539  /***************************************************************
540  unknown command; print command list
541  ***************************************************************/
542  default :
543  rw = 0;
544  net_send_string (tcp_server, commands);
545  break;
546  } // switch
547  break;
548 
549  case TMENU2: /* second menu level */
550  /*******************************************************************
551  parse command
552  *******************************************************************/
553  switch ( tolower(c) )
554  {
555  /***************************************************************
556  intel-hex file
557  ***************************************************************/
558  case 'i' :
559  if ( rw & FTP_WRITE )
560  {
561  net_send_string (tcp_server, receive_hex_msg);
562  }
563  else
564  {
565  net_send_string (tcp_server, send_hex_msg);
566  }
567  /***********************************************************
568  start transmission
569  ***********************************************************/
570  transfer = &application;
571 
572  /***********************************************************
573  back to root menu
574  ***********************************************************/
575  menu_level = TMENU1;
576  break;
577 #ifdef HAS_SETUP_FILE
578  /***************************************************************
579  setup file
580  ***************************************************************/
581  case 's' :
582  if ( rw & FTP_WRITE )
583  {
584  net_send_string (tcp_server, receive_hex_msg);
585  }
586  else
587  {
588  net_send_string (tcp_server, send_hex_msg);
589  }
590  /***********************************************************
591  start transmission
592  ***********************************************************/
593  transfer = &setup;
594 
595  /***********************************************************
596  back to root menu
597  ***********************************************************/
598  menu_level = TMENU1;
599  break;
600 #endif
601  /***************************************************************
602  config file
603  ***************************************************************/
604  case 'c' :
605  if ( rw & FTP_WRITE )
606  {
607  net_send_string (tcp_server, receive_config_msg);
608  }
609  else
610  {
611  net_send_string (tcp_server, send_config_msg);
612  }
613  /***********************************************************
614  start transmission
615  ***********************************************************/
616  transfer = &config;
617 
618  /***********************************************************
619  back to root menu
620  ***********************************************************/
621  menu_level = TMENU1;
622  break;
623 
624  /***************************************************************
625  Escape
626  ***************************************************************/
627  case 0x1b :
628 
629  /***********************************************************
630  print available commands
631  ***********************************************************/
632  net_send_string (tcp_server, commands);
633 
634  /***********************************************************
635  back to root menu
636  ***********************************************************/
637  menu_level = TMENU1;
638  rw = 0;
639  break;
640 
641  /***************************************************************
642  wrong command print message
643  ***************************************************************/
644  default :
645  net_send_string (tcp_server, file_msg);
646  break;
647  }
648  break;
649 
650  default :
651  break;
652  } // switch
653 
654  if ( transfer )
655  {
656  /***********************************************************************
657  transmit file
658  ***********************************************************************/
659  transmit_file ( tcp_server, transfer, rw, 0 );
660 
661  /***********************************************************************
662  pick up transmission result for later processing
663  ***********************************************************************/
664  telnet_ret->error_code = transfer->error;
665  telnet_ret->fp = transfer;
666  telnet_ret->offset = transfer->offset;
667 
668  /***********************************************************************
669  return true to calling command processor to signal a valid result
670  ***********************************************************************/
671  return (1);
672  } // if
673 
674  /***************************************************************************
675  This function is called as callback from the cmd module.
676  ***************************************************************************/
677  return (0);
678 }
#define TMENU1
Definition: telnet.c:136
int transmit_file(SOCKET *server, direntry_type *dir, unsigned int rw, unsigned int flags)
Definition: telnet.c:351
#define TELNET_DOWNLOAD
Definition: telnetio.h:91
SOCKET * tcp_server
Definition: NetTest.c:273
T_Handle gp
Definition: Common.h:338
#define NULL
Definition: net.h:126
Embedded File System directory.
Definition: net.h:796
int32_t error_code
Definition: telnetio.h:92
uint32_t reason
Definition: telnetio.h:87
uint32_t offset
Definition: telnetio.h:93
int32_t error
Definition: net.h:810
#define TMENU2
Definition: telnet.c:137
#define TELNET_UPLOAD
Definition: telnetio.h:89
#define FTP_WRITE
Definition: net.h:866
int32_t net_send_string(SOCKET *so, char *data)
Send a zero terminated string via the specified socket.
telnet server return structure
Definition: telnetio.h:85
uint32_t offset
Definition: net.h:803
direntry_type * fp
Definition: telnetio.h:94
#define FTP_READ
Definition: net.h:864
Definition: telnetio.h:132
int main ( void  )
689 {
690  /***************************************************************************
691  locals
692  ***************************************************************************/
693  int main_loop = 1; /* main loop switch, set to 0 to exit */
694  timeval stamp1, stamp2, delta; /* used to determine startup time */
695  telnet_return_type *telnet_ret; /* telnet server result */
696 
697  /***************************************************************************
698  initialize application (e.g. timer clocks, PLL settings, EMIF etc.)
699  (ref. \Common\Common.c)
700  ***************************************************************************/
701  AppInit (GET_CLOCK);
702 
703  /***************************************************************************
704  select output device for CPrintf (ref. \Common\cprintf.c)
705  possible settings:
706  CPRINTF_UART_OUTPUT -> output to UART
707  CPRINTF_CCS_OUTPUT -> output to CCS
708  CPRINTF_UART_OUTPUT | CPRINTF_CCS_OUTPUT -> output to UART and CCS
709  ***************************************************************************/
710  CPrintf_select_output (CPRINTF_DEFAULT_OUTPUT); /* default outputs */
711 
712  /***************************************************************************
713  print a start up message
714  ***************************************************************************/
715  START_UP_MESSAGE (BLANK_REV NETLIB_REV);
716 
717  /**************************************************************************/
718  // CPrintfProgress (" Heap check ");
719  // at least 0x2000 bytes required for this app
720  /**************************************************************************/
721  ASSERT_HEAP (initial_heap_size, 0x2000);
722  // CPrintfProgressSuccess();
723 
724  /**************************************************************************/
725  CPrintfProgress (" Setup system time ");
726  /**************************************************************************/
729  CPrintf (" *** timer %d mapped to CPU int %d ***\r\n",
731 
732  /**************************************************************************/
733  CPrintfProgress (" Enable interrupts ");
734  /**************************************************************************/
737 
738  /**************************************************************************/
739  CPrintfProgress (" Start system timer ");
740  /**************************************************************************/
741  StartSystemTimer ();
743  CPrintf (" *** timer %d running at %"PRId32" Hz ***\r\n", SystemTimerDev, RES_SECONDS/GetSystemTimerRes());
744 
745  /***************************************************************************
746  measure network initialization time
747  ***************************************************************************/
748  stamp1 = GetTimeStamp();
749 
750  /**************************************************************************/
751  CPrintfProgress (" Initialize network ");
752  /**************************************************************************/
753  InitializeNetwork ( 64); // 64 bytes for ping
755 
756  stamp2 = GetTimeStamp();
757 
758  tv_interval (&delta, &stamp1, &stamp2);
759  CPuts (" network startup time [sec]: ");
761  "%"PRId32".%03"PRId32"\r\n"
763  delta.tv_sec,
764  delta.tv_usec/1000);
765 
766  /***************************************************************************
767  initialize telnet server
768  the automatic command processing of the cmd module is deactivated here
769  (parameter NULL for command table) since we use a simple two-level one
770  character command menu here
771  ***************************************************************************/
772  if ( Telnet_initialize_server ( NULL, /* no user list */
773  create_hello_msg(), /* welcome message */
774  user_menu, /* input parser */
775  NULL /* no command table */
776  ) == FALSE )
777  {
778  prg_exit ("Telnet_initialize_server() failed");
779  }
780 
781  CPrintf (" *** Telnet port 23 open ***\r\n");
782 
783  /**************************************************************************/
784  CPrintfProgress (" Initialize files ");
785  /**************************************************************************/
786 #ifdef HAS_SETUP_FILE
787  setup.buffer =
788 #endif
789  config.buffer = application.buffer = NULL;
790 #ifdef HAS_SETUP_FILE
791  fsys_init_file ( &setup, 0, 0);
792 #endif
793  fsys_init_file ( &config, 0, 0);
794  fsys_init_file ( &application, 0, 0);
795 
796  /***************************************************************************
797  main program loop: set main_loop to 0 to exit loop
798  ***************************************************************************/
799  CPuts ("\r\n Entering main loop, waiting for telnet connection ...\r\n");
800  while ( main_loop )
801  {
802  /***********************************************************************
803  process net_isq()
804  ***********************************************************************/
805  net_isq (); // process ISQ
806 
807  /***********************************************************************
808  monitor link status
809  ***********************************************************************/
811 
812  /***********************************************************************
813  try to detect IP assignment
814  if DHCP is used, the assigned IP address may change
815  ***********************************************************************/
817 
818  /***********************************************************************
819  process Telnet_server()
820  ***********************************************************************/
821  telnet_ret = Telnet_server ();
822  if ((uint32_t)telnet_ret > FTP_NO_ERROR)
823  {
824  /*******************************************************************
825  something happened on the Telnet server. Print details
826  *******************************************************************/
827  PrintResult (telnet_ret);
828  }
829 
830  /***********************************************************************
831  show that the program is running, perform symbol animation
832  ***********************************************************************/
834  }
835 
836  /***************************************************************************
837  exit program, shut down peripherals
838  ***************************************************************************/
839  return (0);
840 }
int16_t user_menu(T_ComDevice *CmdDevice, char c)
Definition: telnet.c:474
#define prg_exit(s)
Definition: Common.h:267
void BoardEnableInterrupts(void)
global enable interrupts
Definition: BoardSpecific.c:365
#define ANIMATE_SYMBOLS_COUNT
Definition: BoardSpecific.h:268
void StartSystemTimer(void)
start system timer
Definition: timer.c:447
#define RES_MSECONDS
Definition: timer.h:67
uint16_t CPrintf_select_output(uint16_t device)
Definition: cprintf.c:206
#define ASSERT_HEAP(i, h)
Definition: Common.h:262
#define NULL
Definition: net.h:126
time_t GetSystemTimerRes(void)
Definition: timer.c:160
#define GET_CLOCK
Definition: BoardSpecific.h:258
int CPrintf(const char *_format,...)
Custom printf function.
Definition: cprintf.c:708
#define VT100_DEFAULT
Definition: cprintf.h:150
void SetupSystemTime(int32_t cpuint, int port, time_t resolution)
Setup System Time.
Definition: timer.c:392
void AppInit(uint32_t dsp_clock)
Initialize application.
Definition: Common.c:230
uint32_t Telnet_initialize_server(user_type *user, char *hello_msg, int16_t(*InputParser)(T_ComDevice *, char), T_Handle CmdTab)
initialize Telnet Server
Definition: telnetio.c:483
uint32_t initial_heap_size
Definition: Common.c:140
int32_t fsys_init_file(direntry_type *fp, uint32_t offset, int32_t size)
This function initializes all necessary internal parameters for a specific user file.
#define CPRINTF_DEFAULT_OUTPUT
Definition: BoardSpecific.h:129
#define VT100_RED
Definition: cprintf.h:143
uint16_t CPrintAnimatedSymbol(char *c, time_t period, size_t size)
Definition: cprintf.c:816
int InitializeNetwork(uint16_t icmp_size)
Initialize MAC, sockets and protocols.
Definition: BoardSpecific.c:597
unsigned int uint32_t
Definition: stdint.h:47
char sym_animate[]
Definition: BoardSpecific.c:129
Definition: timer.h:75
#define GetTimeStamp()
Definition: timer.h:81
void tv_interval(timeval *e, timeval *t1, timeval *t2)
compute elapsed time
Definition: timer.c:336
telnet server return structure
Definition: telnetio.h:85
#define SYSTEM_TIMER_INT
Definition: BoardSpecific.h:174
#define SYSTEM_TIMER
Definition: BoardSpecific.h:167
void net_isq(void)
The main polling function for processing sockets, must be periodically called in the main application...
#define BLANK_REV
Definition: BoardSpecific.h:191
Uint16 SystemTimerDev
uint16_t monitor_ip_address(tpOutputFunc pLog)
monitor IP assignment
Definition: BoardSpecific.c:545
telnet_return_type * Telnet_server(void)
handle Telnet Server
Definition: telnetio.c:553
#define START_UP_MESSAGE(rev)
Definition: BoardSpecific.h:192
#define RES_SECONDS
Definition: timer.h:70
uint16_t monitor_link_status(tpOutputFunc pLog)
monitor link status change
Definition: BoardSpecific.c:497
int CPuts(const char *_ptr)
Definition: cprintf.c:399
time_t tv_sec
Definition: timer.h:77
#define FTP_NO_ERROR
Definition: ftplib.h:73
#define CPrintfProgress(s)
Definition: cprintf.h:230
time_t tv_usec
Definition: timer.h:78
void PrintResult(telnet_return_type *telnet_ret)
Definition: telnet.c:211
#define CPrintfProgressSuccess()
Definition: cprintf.h:263

Variable Documentation

char* program_name = "telnet"
timeval telnet_stamp1
Examples:
Telnet.c.
const char* aLogMessages[]
Examples:
Telnet.c.