Dhcp

baileys57 Messages postés 3 Date d'inscription jeudi 15 février 2007 Statut Membre Dernière intervention 4 mai 2007 - 4 mai 2007 à 22:33
emmatopiak Messages postés 149 Date d'inscription mercredi 28 mars 2007 Statut Membre Dernière intervention 17 mai 2007 - 4 mai 2007 à 23:10
bonjour,
j'ai un serveur en c++ qui a un reseau en port com et qui relie des pc client par un intercom
les clients doivent booter sur le lan comment changer mon type de reseau pour le faire passer par du rj45 afin de virer l'intercom et le remplacer par un hub?
ps je suis debutant alors ne soyez indulgent avec moi
merci d'avance
voici le code de l'intercom que je veux remplacer :

/*   Serveur des requˆtes intercom.        */
/*            */
/*            */
/* ----------------------------------------------------------------------- */
#include <stdio.h>
#include "etatsean.h"
#include "c_monit.h"
#include "c_monit.ext"
#include "stdbxevt.def"
#include "intercom.h"
#include "ecran.h" /* debug */
 struct _qc
  {
  unsigned char msbh, lsbh, msbl, lsbl ;
  } ;
 struct _dw
  {
  unsigned char msw, lsw ;
  } ;
 union _t
  {
  unsigned long l_value ;
  struct _qc qc ;
  struct _dw dw ;
  } t;


#define TOTRACEUR _asm int 0f3h


static unsigned pgm_word ;


extern _btc _far btc ;




unsigned char debug[80] ;


extern void UsrErr( char *s );
extern void AttendStaIniIcMx(void);


/*****************************************
void debugpw( unsigned pw )
{
   unsigned char intersec;
   unsigned dg ;


   int i ;


   if (!( pw & 0x00FF ))
      sprintf( debug, "Mot d'‚tat : 0x%X ", pw );
   else
      sprintf( debug, "Volume     : 0x%X ", pw );
   for (i=15 ; i>=0 ; i-- )
      {
      if ( i== 7)
  strcat( debug," " );
      if ( pw & ( 1<<i ) )
  strcat( debug, "1" ) ;
      else
  strcat( debug, "0" ) ;
      }


   UsrErr( debug );
   if ( debug[0] == 'M' )
      {
      scroll( 0, 55, 8, 79, BLEU , 80-55, 1 ) ;
      for ( i=0 ; i<5 ; i++ )
  {
  set_txtcur_pos( 2*i, 56+3 ) ;
  wr_car( BLANC SUR BLEU, '¯' ) ;
  }
      for ( i=0 ; i<9 ; i+=4 )
  {
  set_txtcur_pos( i, 56+17 ) ;
  wr_car( BLANC SUR BLEU, '¯' ) ;
  }


      wr_string( 0, 56, BLANC SUR BLEU, "MM" );
      wr_string( 0, 56+19, BLANC SUR BLEU, "HP D" );
      wr_string( 2, 56, BLANC SUR BLEU, "GL" );
      wr_string( 4, 56, BLANC SUR BLEU, "MA" );
      wr_string( 4, 56+19, BLANC SUR BLEU, "Mx" );
      wr_string( 6, 56, BLANC SUR BLEU, "GB" );
      wr_string( 8, 56, BLANC SUR BLEU, "Mx" );
      wr_string( 8, 56+19, BLANC SUR BLEU, "HP G" );
      set_txtcur_pos( 0, 56+4 );
      _wr_car_rep( BLANC SUR BLEU, 'Ä', 13 );
      set_txtcur_pos( 2, 56+4 );
      _wr_car_rep( BLANC SUR BLEU, 'Ä', 6 );
      set_txtcur_pos( 4, 56+4 );
      _wr_car_rep( BLANC SUR BLEU, 'Ä', 13 );
      set_txtcur_pos( 6, 56+4 );
      _wr_car_rep( BLANC SUR BLEU, 'Ä', 6 );
      set_txtcur_pos( 8, 56+4 );
      _wr_car_rep( BLANC SUR BLEU, 'Ä', 13 );
      wr_string( 0, 56+10, BLANC SUR BLEU, "ÂÄÄÂ" );
      wr_string( 1, 56+10, BLANC SUR BLEU, "³  ³" );
      wr_string( 2, 56+10, BLANC SUR BLEU, "´"    );
      wr_string( 3, 56+10, BLANC SUR BLEU, "³  ³" );
      wr_string( 4, 56+10, BLANC SUR BLEU, "´  Ã" );
      wr_string( 5, 56+10, BLANC SUR BLEU, "   ³" );
      wr_string( 6, 56+10, BLANC SUR BLEU, "´" );
      wr_string( 7, 56+10, BLANC SUR BLEU, "³  ³" );
      wr_string( 8, 56+10, BLANC SUR BLEU, "ÁÄÄÁ" );
      intersec = ' ' ;
      if ( pw & MM )
  intersec = 'Ä' ;
      set_txtcur_pos( 0, 56+6 ) ;
      _wr_car_rep( BLANC CLAIR SUR BLEU, intersec, 2 ) ;
      intersec = ' ' ;
      if ( pw & GL )
  intersec = 'Ä' ;
      set_txtcur_pos( 2, 56+6 ) ;
      _wr_car_rep( BLANC CLAIR SUR BLEU, intersec, 2 ) ;
      intersec = ' ' ;
      if ( pw & MA )
  intersec = 'Ä' ;
      set_txtcur_pos( 4, 56+6  ) ;
      _wr_car_rep( BLANC CLAIR SUR BLEU, intersec, 2 ) ;
      intersec = ' ' ;
      if ( pw & GB )
  intersec = 'Ä' ;
      set_txtcur_pos( 6, 56+6  ) ;
      _wr_car_rep( BLANC CLAIR SUR BLEU, intersec, 2 ) ;
      intersec = ' ' ;
      if ( pw & INMX )
  intersec = 'Ä' ;
      set_txtcur_pos( 8, 56+6  ) ;
      _wr_car_rep( BLANC CLAIR SUR BLEU, intersec, 2 ) ;


      intersec = ' ' ;
      if ( pw & OUTD )
  intersec = '³' ;
      set_txtcur_pos( 2, 56+13 ) ;
      wr_car( BLANC CLAIR SUR BLEU, intersec );


      intersec = ' ' ;
      if ( pw & OUTG )
  intersec = '³' ;
      set_txtcur_pos( 6, 56+13 ) ;
      wr_car( BLANC CLAIR SUR BLEU, intersec );


      intersec = ' ' ;
      if ( pw & STEREO )
  intersec = '³' ;
      set_txtcur_pos( 5, 56+10 ) ;
      wr_car( BLANC CLAIR SUR BLEU, intersec );


      }
}
*********************************/




void ProgIc( unsigned pw )
{
/*debugpw( pw ) ;*/
   EvMulPosW( IMMEDIAT, BASE_MAN_IC + ICMUL1_WEVT, pw ) ;
}


void ProgMx( unsigned char set_reset )
{
   EvMulPosB( IMMEDIAT, BASE_MAN_IC + MXMUL2_BEVT, set_reset ) ;
}


void InitIc()
{
   unsigned niveau ;


   ProgIc( pgm_word = STEREO ) ;
   (void) AttendStaIniIcMx();
   niveau = 0x8F00 ;
   ProgIc( niveau | PDG ) ;
   (void) AttendStaIniIcMx();
}




void LowEntry( unsigned char cmde )
{
   char ordre_terminal ;


   switch ( cmde )
      {
      case RSTART_MA : ordre_terminal = SET_MA ; break ;
      case RABORT_MA : ordre_terminal = RST_MA ; break ;
      }
   EvMulPosB( IMMEDIAT, BASE_MAN_IC + MANMUL0_BEVT, ordre_terminal ) ;
}


void TraiterRequeteIcMx()
{
   unsigned char messerr[25] ;
   unsigned level_word ;


   while ( BxRdL( R_BOXL, &t.l_value ) )
      {
      switch ( t.qc.msbh )
  {
  case RSTART_MM:
     pgm_word |= MM ;
     ProgIc( pgm_word ) ;
     (void) AttendStaIniIcMx();
     break ;


  case RABORT_MM:
     pgm_word &= ~MM ;
     ProgIc( pgm_word ) ;
     (void) AttendStaIniIcMx();
     break ;


  case RSTART_WN:
     pgm_word |= GB ;
     ProgIc( pgm_word ) ;
     (void) AttendStaIniIcMx();
     break ;


  case RABORT_WN:
     pgm_word &= ~GB ;
     ProgIc( pgm_word ) ;
     (void) AttendStaIniIcMx();
     break ;


  case RSTART_MA:
     pgm_word |= MA ;
     ProgIc( pgm_word ) ;
     (void) AttendStaIniIcMx();
     LowEntry( RSTART_MA ) ;
     (void) AttendStaIniIcMx();
     break ;


  case RABORT_MA:
     pgm_word &= ~MA ;
     ProgIc( pgm_word ) ;
     (void) AttendStaIniIcMx();
     LowEntry( RABORT_MA ) ;
     (void) AttendStaIniIcMx();
     break ;


  case RON_FROMMX:
     pgm_word |= INMX ;
     ProgIc( pgm_word ) ;
     (void) AttendStaIniIcMx();
     break ;


  case ROFF_FROMMX:
     pgm_word &= ~INMX ;
     ProgIc( pgm_word ) ;
     (void) AttendStaIniIcMx();
     break ;


  case RON_TOMX:
     pgm_word |= OUTD ;
     pgm_word |= OUTG ;
     ProgIc( pgm_word ) ;
     (void) AttendStaIniIcMx();
     break ;


  case ROFF_TOMX:
     pgm_word &= ~OUTD ;
     pgm_word &= ~OUTG ;
     ProgIc( pgm_word ) ;
     (void) AttendStaIniIcMx();
     break ;


  case RLEVELS:
     level_word = ( t.qc.lsbl << 8 ) | ( t.qc.msbl ) ;
     ProgIc( level_word ) ;
     (void) AttendStaIniIcMx();
     break ;


  case RSET_MX:
     ProgMx( WR_MX ) ;
     (void) AttendStaIniIcMx();
     break ;


  case RRST_MX:
     ProgMx( RST_MX ) ;
     (void) AttendStaIniIcMx();
     break ;


  default :
     sprintf( messerr, "ReqIcMx %d inconnue", t.qc.msbh ) ;
     UsrErr( messerr );
  }
      }
}
�1A;

1 réponse

emmatopiak Messages postés 149 Date d'inscription mercredi 28 mars 2007 Statut Membre Dernière intervention 17 mai 2007 2
4 mai 2007 à 23:10
Salut,

Si j'ai bien compris, ton programme marche pour un reseau donné (intercom) et tu voudrais passer a du RJ45 et ça marche plus.

Well well well

c'est long lol ton code.
Bref
En fait par RJ45 tu entends le protocole Ethernet, je connais pas intercom mais ça doit etre très différent d'Ethernet donc je pense que y'aura pas de moyen facile d'adapter ton code et qu'il faudrait soit tout refaire soit trouver un logiciel qui fait déjà l'adaptation entre les deux couches réseaux.

C'est tout ce que je peux te dire pour l'instant, aiguille moi ?
@++
0
Rejoignez-nous