Chinaunix首页 | 论坛 | 博客
  • 博客访问: 565834
  • 博文数量: 94
  • 博客积分: 1631
  • 博客等级: 上尉
  • 技术积分: 586
  • 用 户 组: 普通用户
  • 注册时间: 2009-10-28 12:16
文章分类

全部博文(94)

文章存档

2014年(1)

2013年(11)

2012年(69)

2011年(7)

2010年(6)

我的朋友

分类: C/C++

2010-10-01 00:26:07

#include "stdio.h"
void main()
{
 /* 10万个MAC 001D0812171B-001D08139DBA */
 FILE *fp;
 unsigned int mac_pre=0x001D081;/* MAC 的前7位 */
 unsigned int mac_post_start=0x2171B;/* MAC 的后5位,起始MAC 001D0812171B */
 unsigned int mac_cnt=;/* 要产生的MAC的个数 */
 unsigned int mac_post_index=mac_post_start + 205;/* 本次要产生的起始MAC的后5位,205为已经产生过205个MAC */
 unsigned int mac_post_end=mac_post_index+mac_cnt;
 fp = fopen("mac_list.txt","w+");
 fprintf(fp,"%s","manufacturer=XXXX\n");
 fprintf(fp,"%s","customer=XXX\n");
 fprintf(fp,"%s","stbtype=XX\n");
 fprintf(fp,"%s","stbtypeid=X\n");
 for(;mac_post_index {
  fprintf(fp,"%07X",mac_pre); /* 输出MAC的前7位 */
  fprintf(fp,"%05X\n",mac_post_index); /* 输出MAC的后5位 */
 }
 
 fclose(fp);
 return;
}
阅读(892) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~