Changeset 705
- Timestamp:
- Oct 19, 2014, 6:47:57 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Global.php
r702 r705 458 458 } 459 459 } 460 461 function pack_array($v, $a) 462 { 463 return call_user_func_array('pack', array_merge(array($v), (array)$a)); 464 } 465 -
trunk/Common/NetworkAddress.php
r701 r705 91 91 return($Result); 92 92 } 93 93 94 94 function EncodeMAC($MAC) 95 95 { 96 96 $MAC = explode(':', $MAC); 97 $Data = array_reverse(unpack('C*', $this->Address)); 98 print_r($Data); 99 $Data[7] = $MAC[0]; 100 $Data[6] = $MAC[1] ^ 0x02; 101 $Data[5] = $MAC[2]; 102 $Data[4] = 0xff; 103 $Data[3] = 0xfe; 104 $Data[2] = $MAC[3]; 105 $Data[1] = $MAC[4]; 106 $Data[0] = $MAC[5]; 107 print_r($Data); 108 $this->Address = pack('C*', $Data); 97 $Data = unpack('C*', $this->Address); 98 $Data[9] = hexdec($MAC[0]) ^ 0x02; 99 $Data[10] = hexdec($MAC[1]); 100 $Data[11] = hexdec($MAC[2]); 101 $Data[12] = 0xff; 102 $Data[13] = 0xfe; 103 $Data[14] = hexdec($MAC[3]); 104 $Data[15] = hexdec($MAC[4]); 105 $Data[16] = hexdec($MAC[5]); 106 $this->Address = pack_array('C*', $Data); 109 107 } 110 108
Note:
See TracChangeset
for help on using the changeset viewer.