- Replace UM_* macros by replacing them with the appropriate function

call.  These changes are similar to the ones made to atmarpd and scsp.
This commit is contained in:
Andrew R. Reiter 2002-05-17 00:20:40 +00:00
parent 1effc132ba
commit 7455bd51da
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=96766
8 changed files with 50 additions and 50 deletions

View File

@ -565,7 +565,7 @@ pvc_add(argc, argv, cmdp)
fprintf(stderr, "%s: Illegal interface name\n", prog);
exit(1);
}
UM_ZERO(air.air_int_intf, sizeof(air.air_int_intf));
bzero(air.air_int_intf, sizeof(air.air_int_intf));
strcpy(air.air_int_intf, argv[0]);
buf_len = sizeof(struct air_int_rsp);
air.air_opcode = AIOCS_INF_INT;
@ -737,7 +737,7 @@ arp_add(argc, argv, cmdp)
/*
* Initialize add request structure
*/
UM_ZERO(&apr, sizeof(apr));
bzero(&apr, sizeof(apr));
/*
* Get network interface name if one is present
@ -751,7 +751,7 @@ arp_add(argc, argv, cmdp)
/*
* Get IP address of specified host name
*/
UM_ZERO(&host_ip, sizeof(host_ip));
bzero(&host_ip, sizeof(host_ip));
host_ip.sa.sa_family = AF_INET;
sin = get_ip_addr(argv[0]);
host_ip.sin.sin_addr.s_addr = sin->sin_addr.s_addr;
@ -1004,7 +1004,7 @@ arp_dlt(argc, argv, cmdp)
/*
* Set opcode
*/
UM_ZERO(&apr, sizeof(apr));
bzero(&apr, sizeof(apr));
apr.adr_opcode = AIOCS_DEL_ARP;
/*
@ -1019,7 +1019,7 @@ arp_dlt(argc, argv, cmdp)
/*
* Get IP address of specified host name
*/
UM_ZERO(&host_addr, sizeof(host_addr));
bzero(&host_addr, sizeof(host_addr));
host_addr.sa.sa_family = AF_INET;
sin = get_ip_addr(argv[0]);
host_addr.sin.sin_addr.s_addr = sin->sin_addr.s_addr;

View File

@ -156,7 +156,7 @@ show_eni_stats(intf, argc, argv)
/*
* Get vendor-specific statistics from the kernel
*/
UM_ZERO(&air, sizeof(air));
bzero(&air, sizeof(air));
air.air_opcode = AIOCS_INF_VST;
strcpy(air.air_vinfo_intf, intf);
buf_len = do_info_ioctl(&air, sizeof(struct air_vinfo_rsp) + 1024);
@ -184,7 +184,7 @@ show_eni_stats(intf, argc, argv)
*/
if (buf_len < sizeof(struct air_vinfo_rsp) +
sizeof(Eni_stats)) {
UM_FREE(stats);
free(stats);
return;
}
@ -206,7 +206,7 @@ show_eni_stats(intf, argc, argv)
break;
}
UM_FREE(stats);
free(stats);
}

View File

@ -174,7 +174,7 @@ show_fore200_stats(intf, argc, argv)
/*
* Get adapter configuration from the kernel
*/
UM_ZERO(&air, sizeof(air));
bzero(&air, sizeof(air));
air.air_opcode = AIOCS_INF_CFG;
strcpy(air.air_cfg_intf, intf);
buf_len = do_info_ioctl(&air, sizeof(struct air_cfg_rsp));
@ -200,7 +200,7 @@ show_fore200_stats(intf, argc, argv)
/*
* Get vendor-specific statistics from the kernel
*/
UM_ZERO(&air, sizeof(air));
bzero(&air, sizeof(air));
air.air_opcode = AIOCS_INF_VST;
strcpy(air.air_vinfo_intf, intf);
buf_len = do_info_ioctl(&air, sizeof(struct air_vinfo_rsp) + 1024);
@ -228,8 +228,8 @@ show_fore200_stats(intf, argc, argv)
*/
if (buf_len < sizeof(struct air_vinfo_rsp) +
sizeof(Fore_stats)) {
UM_FREE(stats);
UM_FREE(cfg);
free(stats);
free(cfg);
return;
}
@ -269,8 +269,8 @@ show_fore200_stats(intf, argc, argv)
break;
}
UM_FREE(stats);
UM_FREE(cfg);
free(stats);
free(cfg);
}

View File

@ -108,7 +108,7 @@ ip_pvcadd(argc, argv, cmdp, app, intp)
/*
* Validate and set network interface
*/
UM_ZERO(app->aar_pvc_intf, sizeof(app->aar_pvc_intf));
bzero(app->aar_pvc_intf, sizeof(app->aar_pvc_intf));
netif_pref_len = strlen(intp->anp_nif_pref);
cp = &argv[0][netif_pref_len];
netif_no = atoi(cp);
@ -139,7 +139,7 @@ ip_pvcadd(argc, argv, cmdp, app, intp)
/*
* Set PVC destination address
*/
UM_ZERO(&app->aar_pvc_dst, sizeof(struct sockaddr));
bzero(&app->aar_pvc_dst, sizeof(struct sockaddr));
if (strcasecmp(argv[0], "dynamic") == 0 ||
strcasecmp(argv[0], "dyn") == 0) {

View File

@ -290,7 +290,7 @@ print_arp_info(ai)
/*
* Decode the flags
*/
UM_ZERO(flags, sizeof(flags));
bzero(flags, sizeof(flags));
if (ai->aap_flags & ARPF_VALID) {
strcat(flags, "V");
}
@ -313,7 +313,7 @@ print_arp_info(ai)
/*
* Format the age
*/
UM_ZERO(age, sizeof(age));
bzero(age, sizeof(age));
if (!(ai->aap_flags & ARPF_VALID)) {
strcpy(age, "-");
} else {
@ -511,7 +511,7 @@ print_intf_info(ni)
/*
* Get the range of NIFs on the physical interface
*/
UM_ZERO(nif_names, sizeof(nif_names));
bzero(nif_names, sizeof(nif_names));
if (strlen(ni->anp_nif_pref) == 0) {
strcpy(nif_names, "-");
} else {
@ -583,7 +583,7 @@ print_ip_vcc_info(ai)
/*
* Decode VCC flags
*/
UM_ZERO(flags, sizeof(flags));
bzero(flags, sizeof(flags));
if (ai->aip_flags & IVF_PVC) {
strcat(flags, "P");
}
@ -797,7 +797,7 @@ print_vcc_info(vi)
/*
* Translate VCC direction
*/
UM_ZERO(dir_name, sizeof(dir_name));
bzero(dir_name, sizeof(dir_name));
if (vi->avp_type & VCC_IN)
strcat(dir_name, "In");
if (vi->avp_type & VCC_OUT)

View File

@ -105,7 +105,7 @@ set_arpserver(argc, argv, cmdp)
/*
* Get the ARP server's ATM address
*/
UM_ZERO(&server, sizeof(server));
bzero(&server, sizeof(server));
if (strcasecmp(argv[0], "local")) {
/*
* ARP server NSAP address is provided
@ -142,7 +142,7 @@ set_arpserver(argc, argv, cmdp)
* list of permitted LIS prefixes.
*/
len = sizeof(struct air_netif_rsp);
UM_ZERO(&air, sizeof(air));
bzero(&air, sizeof(air));
air.air_opcode = AIOCS_INF_NIF;
strcpy(air.air_int_intf, intf);
len = do_info_ioctl(&air, len);
@ -166,7 +166,7 @@ set_arpserver(argc, argv, cmdp)
int_info = (struct air_netif_rsp *) air.air_buf_addr;
lis = (struct sockaddr_in *)&int_info->anp_proto_addr;
prefix_buf[0].ip_addr = lis->sin_addr;
UM_FREE(int_info);
free(int_info);
rc = get_subnet_mask(intf, &if_mask);
if (rc) {
@ -200,7 +200,7 @@ set_arpserver(argc, argv, cmdp)
/*
* Build ioctl request
*/
UM_ZERO(&asr, sizeof(asr));
bzero(&asr, sizeof(asr));
asr.asr_opcode = AIOCS_SET_ASV;
strncpy(asr.asr_arp_intf, intf, sizeof(asr.asr_arp_intf));
asr.asr_arp_addr = server;
@ -310,7 +310,7 @@ set_macaddr(argc, argv, cmdp)
*/
asr.asr_opcode = AIOCS_SET_MAC;
strncpy(asr.asr_mac_intf, intf, sizeof(asr.asr_mac_intf));
UM_COPY(&mac, &asr.asr_mac_addr, sizeof(asr.asr_mac_addr));
bcopy(&mac, &asr.asr_mac_addr, sizeof(asr.asr_mac_addr));
/*
* Pass the new address to the kernel
@ -494,7 +494,7 @@ set_prefix(argc, argv, cmdp)
*/
asr.asr_opcode = AIOCS_SET_PRF;
strncpy(asr.asr_prf_intf, intf, sizeof(asr.asr_prf_intf));
UM_COPY(prefix, asr.asr_prf_pref, sizeof(asr.asr_prf_pref));
bcopy(prefix, asr.asr_prf_pref, sizeof(asr.asr_prf_pref));
/*
* Pass the new prefix to the kernel

View File

@ -101,7 +101,7 @@ show_arp(argc, argv, cmdp)
/*
* Get IP address of specified host name
*/
UM_ZERO(&host_addr, sizeof(host_addr));
bzero(&host_addr, sizeof(host_addr));
host_addr.sa.sa_family = AF_INET;
if (argc) {
sin = get_ip_addr(argv[0]);
@ -118,7 +118,7 @@ show_arp(argc, argv, cmdp)
/*
* Get ARP information from the kernel
*/
UM_ZERO(&air, sizeof(air));
bzero(&air, sizeof(air));
buf_len = sizeof(struct air_arp_rsp) * 10;
air.air_opcode = AIOCS_INF_ARP;
air.air_arp_addr = host_addr.sa;
@ -162,7 +162,7 @@ show_arp(argc, argv, cmdp)
/*
* Release the information from the kernel
*/
UM_FREE(arp_info_base);
free(arp_info_base);
}
@ -194,7 +194,7 @@ show_arpserv(argc, argv, cmdp)
/*
* Validate interface name
*/
UM_ZERO(air.air_int_intf, sizeof(air.air_int_intf));
bzero(air.air_int_intf, sizeof(air.air_int_intf));
if (argc) {
if (strlen(argv[0]) > IFNAMSIZ - 1) {
fprintf(stderr, "%s: Illegal interface name\n",
@ -242,7 +242,7 @@ show_arpserv(argc, argv, cmdp)
asrv_info->asp_nprefix *
sizeof(struct in_addr) * 2;
}
UM_FREE(asrv_info_base);
free(asrv_info_base);
}
@ -274,7 +274,7 @@ show_config(argc, argv, cmdp)
/*
* Validate interface name
*/
UM_ZERO(air.air_cfg_intf, sizeof(air.air_cfg_intf));
bzero(air.air_cfg_intf, sizeof(air.air_cfg_intf));
if (argc) {
if (strlen(argv[0]) > IFNAMSIZ - 1) {
fprintf(stderr, "%s: Illegal interface name\n",
@ -317,7 +317,7 @@ show_config(argc, argv, cmdp)
buf_len -= sizeof(struct air_cfg_rsp)) {
print_cfg_info(cfg_info);
}
UM_FREE(cfg_info_base);
free(cfg_info_base);
}
@ -349,7 +349,7 @@ show_intf(argc, argv, cmdp)
/*
* Validate interface name
*/
UM_ZERO(&air, sizeof(air));
bzero(&air, sizeof(air));
if (argc) {
if (strlen(argv[0]) > IFNAMSIZ - 1) {
fprintf(stderr, "%s: Illegal interface name\n",
@ -392,7 +392,7 @@ show_intf(argc, argv, cmdp)
buf_len -= sizeof(struct air_int_rsp)) {
print_intf_info(int_info);
}
UM_FREE(int_info_base);
free(int_info_base);
}
@ -431,7 +431,7 @@ show_ip_vcc(argc, argv, cmdp)
* First parameter can be a netif name, an IP host name, or
* an IP address. Figure out which it is.
*/
UM_ZERO(&host_addr, sizeof(host_addr));
bzero(&host_addr, sizeof(host_addr));
host_addr.sa.sa_family = AF_INET;
if (argc) {
rc = verify_nif_name(argv[0]);
@ -519,7 +519,7 @@ show_ip_vcc(argc, argv, cmdp)
/*
* Release the information from the kernel
*/
UM_FREE(ip_info_base);
free(ip_info_base);
}
@ -552,7 +552,7 @@ show_netif(argc, argv, cmdp)
/*
* Validate network interface name
*/
UM_ZERO(air.air_int_intf, sizeof(air.air_int_intf));
bzero(air.air_int_intf, sizeof(air.air_int_intf));
if (argc) {
if (strlen(argv[0]) > IFNAMSIZ - 1) {
fprintf(stderr, "%s: Illegal interface name\n", prog);
@ -594,7 +594,7 @@ show_netif(argc, argv, cmdp)
buf_len -= sizeof(struct air_netif_rsp)) {
print_netif_info(int_info);
}
UM_FREE(int_info_base);
free(int_info_base);
}
@ -628,7 +628,7 @@ show_intf_stats(argc, argv, cmdp)
/*
* Validate interface name
*/
UM_ZERO(intf, sizeof(intf));
bzero(intf, sizeof(intf));
if (argc) {
if (strlen(argv[0]) > IFNAMSIZ - 1) {
fprintf(stderr, "%s: Illegal interface name\n",
@ -686,7 +686,7 @@ show_intf_stats(argc, argv, cmdp)
break;
}
UM_FREE(cfg_info);
free(cfg_info);
} else {
/*
* Get generic interface statistics
@ -723,7 +723,7 @@ show_intf_stats(argc, argv, cmdp)
buf_len-=sizeof(struct air_phy_stat_rsp)) {
print_intf_stats(pstat_info);
}
UM_FREE((caddr_t)pstat_info_base);
free((caddr_t)pstat_info_base);
}
}
@ -836,7 +836,7 @@ show_vcc_stats(argc, argv, cmdp)
continue;
print_vcc_stats(vcc_info);
}
UM_FREE(vcc_info_base);
free(vcc_info_base);
}
@ -959,7 +959,7 @@ show_vcc(argc, argv, cmdp)
continue;
print_vcc_info(vcc_info);
}
UM_FREE(vcc_info_base);
free(vcc_info_base);
}
@ -1019,7 +1019,7 @@ show_version(argc, argv, cmdp)
buf_len -= sizeof(struct air_version_rsp)) {
print_version_info(ver_info);
}
UM_FREE(ver_info_base);
free(ver_info_base);
}

View File

@ -243,8 +243,8 @@ get_adapter_name(intf)
/*
* Initialize
*/
UM_ZERO(&air, sizeof(air));
UM_ZERO(name, sizeof(name));
bzero(&air, sizeof(air));
bzero(name, sizeof(name));
/*
* Get configuration information from the kernel
@ -263,7 +263,7 @@ get_adapter_name(intf)
strcat(name, " ");
strcat(name, get_adapter(cfg->acp_device));
UM_FREE(cfg);
free(cfg);
return(name);
}
@ -294,7 +294,7 @@ format_mac_addr(addr)
/*
* Clear the returned string
*/
UM_ZERO(str, sizeof(str));
bzero(str, sizeof(str));
/*
* Format the address