- 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
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); fprintf(stderr, "%s: Illegal interface name\n", prog);
exit(1); 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]); strcpy(air.air_int_intf, argv[0]);
buf_len = sizeof(struct air_int_rsp); buf_len = sizeof(struct air_int_rsp);
air.air_opcode = AIOCS_INF_INT; air.air_opcode = AIOCS_INF_INT;
@ -737,7 +737,7 @@ arp_add(argc, argv, cmdp)
/* /*
* Initialize add request structure * Initialize add request structure
*/ */
UM_ZERO(&apr, sizeof(apr)); bzero(&apr, sizeof(apr));
/* /*
* Get network interface name if one is present * Get network interface name if one is present
@ -751,7 +751,7 @@ arp_add(argc, argv, cmdp)
/* /*
* Get IP address of specified host name * 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; host_ip.sa.sa_family = AF_INET;
sin = get_ip_addr(argv[0]); sin = get_ip_addr(argv[0]);
host_ip.sin.sin_addr.s_addr = sin->sin_addr.s_addr; host_ip.sin.sin_addr.s_addr = sin->sin_addr.s_addr;
@ -1004,7 +1004,7 @@ arp_dlt(argc, argv, cmdp)
/* /*
* Set opcode * Set opcode
*/ */
UM_ZERO(&apr, sizeof(apr)); bzero(&apr, sizeof(apr));
apr.adr_opcode = AIOCS_DEL_ARP; apr.adr_opcode = AIOCS_DEL_ARP;
/* /*
@ -1019,7 +1019,7 @@ arp_dlt(argc, argv, cmdp)
/* /*
* Get IP address of specified host name * 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; host_addr.sa.sa_family = AF_INET;
sin = get_ip_addr(argv[0]); sin = get_ip_addr(argv[0]);
host_addr.sin.sin_addr.s_addr = sin->sin_addr.s_addr; 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 * Get vendor-specific statistics from the kernel
*/ */
UM_ZERO(&air, sizeof(air)); bzero(&air, sizeof(air));
air.air_opcode = AIOCS_INF_VST; air.air_opcode = AIOCS_INF_VST;
strcpy(air.air_vinfo_intf, intf); strcpy(air.air_vinfo_intf, intf);
buf_len = do_info_ioctl(&air, sizeof(struct air_vinfo_rsp) + 1024); 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) + if (buf_len < sizeof(struct air_vinfo_rsp) +
sizeof(Eni_stats)) { sizeof(Eni_stats)) {
UM_FREE(stats); free(stats);
return; return;
} }
@ -206,7 +206,7 @@ show_eni_stats(intf, argc, argv)
break; break;
} }
UM_FREE(stats); free(stats);
} }

View File

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

View File

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

View File

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

View File

@ -105,7 +105,7 @@ set_arpserver(argc, argv, cmdp)
/* /*
* Get the ARP server's ATM address * Get the ARP server's ATM address
*/ */
UM_ZERO(&server, sizeof(server)); bzero(&server, sizeof(server));
if (strcasecmp(argv[0], "local")) { if (strcasecmp(argv[0], "local")) {
/* /*
* ARP server NSAP address is provided * ARP server NSAP address is provided
@ -142,7 +142,7 @@ set_arpserver(argc, argv, cmdp)
* list of permitted LIS prefixes. * list of permitted LIS prefixes.
*/ */
len = sizeof(struct air_netif_rsp); len = sizeof(struct air_netif_rsp);
UM_ZERO(&air, sizeof(air)); bzero(&air, sizeof(air));
air.air_opcode = AIOCS_INF_NIF; air.air_opcode = AIOCS_INF_NIF;
strcpy(air.air_int_intf, intf); strcpy(air.air_int_intf, intf);
len = do_info_ioctl(&air, len); 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; int_info = (struct air_netif_rsp *) air.air_buf_addr;
lis = (struct sockaddr_in *)&int_info->anp_proto_addr; lis = (struct sockaddr_in *)&int_info->anp_proto_addr;
prefix_buf[0].ip_addr = lis->sin_addr; prefix_buf[0].ip_addr = lis->sin_addr;
UM_FREE(int_info); free(int_info);
rc = get_subnet_mask(intf, &if_mask); rc = get_subnet_mask(intf, &if_mask);
if (rc) { if (rc) {
@ -200,7 +200,7 @@ set_arpserver(argc, argv, cmdp)
/* /*
* Build ioctl request * Build ioctl request
*/ */
UM_ZERO(&asr, sizeof(asr)); bzero(&asr, sizeof(asr));
asr.asr_opcode = AIOCS_SET_ASV; asr.asr_opcode = AIOCS_SET_ASV;
strncpy(asr.asr_arp_intf, intf, sizeof(asr.asr_arp_intf)); strncpy(asr.asr_arp_intf, intf, sizeof(asr.asr_arp_intf));
asr.asr_arp_addr = server; asr.asr_arp_addr = server;
@ -310,7 +310,7 @@ set_macaddr(argc, argv, cmdp)
*/ */
asr.asr_opcode = AIOCS_SET_MAC; asr.asr_opcode = AIOCS_SET_MAC;
strncpy(asr.asr_mac_intf, intf, sizeof(asr.asr_mac_intf)); 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 * Pass the new address to the kernel
@ -494,7 +494,7 @@ set_prefix(argc, argv, cmdp)
*/ */
asr.asr_opcode = AIOCS_SET_PRF; asr.asr_opcode = AIOCS_SET_PRF;
strncpy(asr.asr_prf_intf, intf, sizeof(asr.asr_prf_intf)); 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 * 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 * 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; host_addr.sa.sa_family = AF_INET;
if (argc) { if (argc) {
sin = get_ip_addr(argv[0]); sin = get_ip_addr(argv[0]);
@ -118,7 +118,7 @@ show_arp(argc, argv, cmdp)
/* /*
* Get ARP information from the kernel * Get ARP information from the kernel
*/ */
UM_ZERO(&air, sizeof(air)); bzero(&air, sizeof(air));
buf_len = sizeof(struct air_arp_rsp) * 10; buf_len = sizeof(struct air_arp_rsp) * 10;
air.air_opcode = AIOCS_INF_ARP; air.air_opcode = AIOCS_INF_ARP;
air.air_arp_addr = host_addr.sa; air.air_arp_addr = host_addr.sa;
@ -162,7 +162,7 @@ show_arp(argc, argv, cmdp)
/* /*
* Release the information from the kernel * 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 * 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 (argc) {
if (strlen(argv[0]) > IFNAMSIZ - 1) { if (strlen(argv[0]) > IFNAMSIZ - 1) {
fprintf(stderr, "%s: Illegal interface name\n", fprintf(stderr, "%s: Illegal interface name\n",
@ -242,7 +242,7 @@ show_arpserv(argc, argv, cmdp)
asrv_info->asp_nprefix * asrv_info->asp_nprefix *
sizeof(struct in_addr) * 2; 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 * 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 (argc) {
if (strlen(argv[0]) > IFNAMSIZ - 1) { if (strlen(argv[0]) > IFNAMSIZ - 1) {
fprintf(stderr, "%s: Illegal interface name\n", fprintf(stderr, "%s: Illegal interface name\n",
@ -317,7 +317,7 @@ show_config(argc, argv, cmdp)
buf_len -= sizeof(struct air_cfg_rsp)) { buf_len -= sizeof(struct air_cfg_rsp)) {
print_cfg_info(cfg_info); 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 * Validate interface name
*/ */
UM_ZERO(&air, sizeof(air)); bzero(&air, sizeof(air));
if (argc) { if (argc) {
if (strlen(argv[0]) > IFNAMSIZ - 1) { if (strlen(argv[0]) > IFNAMSIZ - 1) {
fprintf(stderr, "%s: Illegal interface name\n", fprintf(stderr, "%s: Illegal interface name\n",
@ -392,7 +392,7 @@ show_intf(argc, argv, cmdp)
buf_len -= sizeof(struct air_int_rsp)) { buf_len -= sizeof(struct air_int_rsp)) {
print_intf_info(int_info); 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 * First parameter can be a netif name, an IP host name, or
* an IP address. Figure out which it is. * 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; host_addr.sa.sa_family = AF_INET;
if (argc) { if (argc) {
rc = verify_nif_name(argv[0]); rc = verify_nif_name(argv[0]);
@ -519,7 +519,7 @@ show_ip_vcc(argc, argv, cmdp)
/* /*
* Release the information from the kernel * 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 * 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 (argc) {
if (strlen(argv[0]) > IFNAMSIZ - 1) { if (strlen(argv[0]) > IFNAMSIZ - 1) {
fprintf(stderr, "%s: Illegal interface name\n", prog); fprintf(stderr, "%s: Illegal interface name\n", prog);
@ -594,7 +594,7 @@ show_netif(argc, argv, cmdp)
buf_len -= sizeof(struct air_netif_rsp)) { buf_len -= sizeof(struct air_netif_rsp)) {
print_netif_info(int_info); 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 * Validate interface name
*/ */
UM_ZERO(intf, sizeof(intf)); bzero(intf, sizeof(intf));
if (argc) { if (argc) {
if (strlen(argv[0]) > IFNAMSIZ - 1) { if (strlen(argv[0]) > IFNAMSIZ - 1) {
fprintf(stderr, "%s: Illegal interface name\n", fprintf(stderr, "%s: Illegal interface name\n",
@ -686,7 +686,7 @@ show_intf_stats(argc, argv, cmdp)
break; break;
} }
UM_FREE(cfg_info); free(cfg_info);
} else { } else {
/* /*
* Get generic interface statistics * Get generic interface statistics
@ -723,7 +723,7 @@ show_intf_stats(argc, argv, cmdp)
buf_len-=sizeof(struct air_phy_stat_rsp)) { buf_len-=sizeof(struct air_phy_stat_rsp)) {
print_intf_stats(pstat_info); 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; continue;
print_vcc_stats(vcc_info); print_vcc_stats(vcc_info);
} }
UM_FREE(vcc_info_base); free(vcc_info_base);
} }
@ -959,7 +959,7 @@ show_vcc(argc, argv, cmdp)
continue; continue;
print_vcc_info(vcc_info); 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)) { buf_len -= sizeof(struct air_version_rsp)) {
print_version_info(ver_info); 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 * Initialize
*/ */
UM_ZERO(&air, sizeof(air)); bzero(&air, sizeof(air));
UM_ZERO(name, sizeof(name)); bzero(name, sizeof(name));
/* /*
* Get configuration information from the kernel * Get configuration information from the kernel
@ -263,7 +263,7 @@ get_adapter_name(intf)
strcat(name, " "); strcat(name, " ");
strcat(name, get_adapter(cfg->acp_device)); strcat(name, get_adapter(cfg->acp_device));
UM_FREE(cfg); free(cfg);
return(name); return(name);
} }
@ -294,7 +294,7 @@ format_mac_addr(addr)
/* /*
* Clear the returned string * Clear the returned string
*/ */
UM_ZERO(str, sizeof(str)); bzero(str, sizeof(str));
/* /*
* Format the address * Format the address