Fsstdconnect()

Fsstdconnect()

概要

引数

実装

  891: /*
  892:  *  called by protocol connect routine to set addresses
  893:  */
  894: char*
  895: Fsstdconnect(Conv *c, char *argv[], int argc)
  896: {
  897:         char *p;
  898: 
  899:         switch(argc) {
  900:         default:
  901:                 return "bad args to connect";
  902:         case 2:
  903:                 p = setraddrport(c, argv[1]);
  904:                 if(p != nil)
  905:                         return p;
  906:                 setladdr(c);
  907:                 setlport(c);
  • 詳細はsetladdr()?を参照
  • 詳細はsetlport()?を参照
  908:                 break;
  909:         case 3:
  910:                 p = setraddrport(c, argv[1]);
  911:                 if(p != nil)
  912:                         return p;
  913:                 p = setladdrport(c, argv[2], 0);
  914:                 if(p != nil)
  915:                         return p;
  916:         }
  917: 
  918:         if( (memcmp(c->raddr, v4prefix, IPv4off) == 0 &&
  919:                 memcmp(c->laddr, v4prefix, IPv4off) == 0)
  920:                 || ipcmp(c->raddr, IPnoaddr) == 0)
  921:                 c->ipversion = V4;
  922:         else
  923:                 c->ipversion = V6;
  • IPのバージョンを判定する.
  • 詳細はipcmp()を参照
  924: 
  925:         return nil;
  926: }