Lines Matching refs:elapp
169 static int validate_msg_size(m, gref, elapp)
172 at_ifaddr_t **elapp;
181 *elapp = NULL;
234 int lap_online(elapp, cfgp)
235 at_ifaddr_t *elapp;
240 if (elapp->ifState != LAP_OFFLINE) {
244 elapp->flags = 0;
252 elapp->flags |= ELAP_CFG_HOME;
256 elapp->flags |= ELAP_CFG_ZONELESS;
258 elapp->flags |= ELAP_CFG_SEED;
263 (elapp->flags & ELAP_CFG_HOME)) || MULTIHOME_MODE) {
264 elapp->startup_zone = cfgp->zonename;
267 if (elapp->flags & ELAP_CFG_SEED) {
270 elapp->ifThisCableStart = cfgp->netStart;
271 elapp->ifThisCableEnd = cfgp->netEnd;
288 elapp->initial_addr = cfgp->node;
293 elapp->startup_error = 0;
294 elapp->startup_inprogress = FALSE;
295 if ((error = elap_online1(elapp)))
296 ddp_rem_if(elapp);
299 elapp->ifZoneName.len == 1 &&
300 elapp->ifZoneName.str[0] == '*' &&
302 nbp_add_multicast(&cfgp->zonename, elapp);
315 at_ifaddr_t *elapp;
337 if (validate_msg_size(m, gref, &elapp))
340 if (elapp)
352 || (elapp = find_ifID(gbuf_rptr(gbuf_cont(m)))) == NULL) {
363 *statsp = elapp->stats;
758 if (elapp)
759 elapp->stats.unknown_mblks++;
777 elap_dataput(m, elapp, addr_flag, addr)
779 register at_ifaddr_t *elapp;
831 if (elapp->ifState == LAP_OFFLINE) {
836 if (elapp->ifState == LAP_ONLINE_FOR_ZIP) {
847 elapp->stats.xmit_packets++;
849 elapp->stats.xmit_bytes += size;
860 error = aarp_send_data(m, elapp, &dest_at_addr, loop);
863 error = pat_output(elapp, m, (unsigned char *)&dest_addr, 0);
874 static int elap_online1(elapp)
875 at_ifaddr_t *elapp;
879 dPrintf(D_M_ELAP, D_L_STARTUP_INFO, ("elap_online:%s elapp:0x%x\n",
880 (elapp->ifName) ? &elapp->ifName[0] : "NULL interface", (u_int) elapp));
881 if (elapp->ifState != LAP_OFFLINE || elapp->startup_inprogress == TRUE)
886 if (elapp->flags & ELAP_CFG_HOME) /* tell ddp_add_if if this is home */
887 elapp->ifFlags |= AT_IFF_DEFAULT;
890 if ((errno = ddp_add_if(elapp)))
897 if (elapp->aa_ifp == 0)
901 (void)at_reg_mcast(elapp, (caddr_t)&elapp->cable_multicast_addr);
905 if (elapp->aa_ifp == 0)
908 elapp->startup_inprogress = TRUE;
909 if (! (elapp->startup_error = re_aarp(elapp))) {
911 (void)msleep(&elapp->startup_inprogress, atalk_mutex, PSOCK | PCATCH,
917 return(elapp->startup_error);
920 static int re_aarp(elapp)
921 at_ifaddr_t *elapp;
926 errno = aarp_init1(elapp);
932 ("elap_online aarp_init for %s\n", elapp->ifName));
933 (void)at_unreg_mcast(elapp, (caddr_t)&elapp->cable_multicast_addr);
934 ddp_rem_if(elapp);
935 elapp->ifState = LAP_OFFLINE;
941 static void elap_online2(elapp)
942 at_ifaddr_t *elapp;
948 if (elapp->flags & ELAP_CFG_SEED) {
952 elapp->ifThisCableStart, elapp->ifThisCableEnd, elapp->ifPort));
953 rt_insert(elapp->ifThisCableEnd,
954 elapp->ifThisCableStart,
956 elapp->ifPort,
960 elapp->ifFlags |= RTR_SEED_PORT;
969 if (elapp->flags & ELAP_CFG_ZONELESS) {
974 elapp->ifState = LAP_ONLINE_ZONELESS;
975 elapp->startup_inprogress = FALSE;
976 wakeup(&elapp->startup_inprogress);
982 if (*(int *)&elapp->ZoneMcastAddr == 0 || elapp->ifZoneName.len == 0) {
984 sethzonehash(elapp);
987 elapp->ifState = LAP_ONLINE_FOR_ZIP;
988 (void)zip_control(elapp, ZIP_ONLINE);
995 ZIPwakeup(elapp, 0);
1000 int elap_online3(elapp)
1001 at_ifaddr_t *elapp;
1003 elapp->startup_inprogress = TRUE;
1006 elapp->initial_addr.s_net = 0;
1007 elapp->initial_addr.s_node = 0;
1009 ("elap_online: goto re_aarp port=%d\n", elapp->ifPort));
1011 if ((elapp->startup_error = re_aarp(elapp)))
1012 return(elapp->startup_error);
1017 (void)msleep(&elapp->startup_inprogress, atalk_mutex, PSOCK | PCATCH,
1019 return(elapp->startup_error);
1027 void elap_offline(elapp)
1028 register at_ifaddr_t *elapp;
1031 dPrintf(D_M_ELAP, D_L_SHUTDN_INFO, ("elap_offline:%s\n", elapp->ifName));
1032 if (elapp->ifState != LAP_OFFLINE) {
1039 (void)at_unreg_mcast(elapp, (caddr_t)&elapp->ZoneMcastAddr);
1040 (void)at_unreg_mcast(elapp, (caddr_t)&elapp->cable_multicast_addr);
1041 elapp->ifState = LAP_OFFLINE;
1044 RT_DELETE(elapp->ifThisCableEnd,
1045 elapp->ifThisCableStart);
1048 elapp->ifGNIScheduled = 0;
1049 untimeout(zip_sched_getnetinfo, elapp);
1051 ddp_rem_if(elapp);
1301 void ZIPwakeup(elapp, ZipError)
1302 at_ifaddr_t *elapp;
1307 if ( (elapp != NULL) && elapp->startup_inprogress) {
1315 elapp->ifState = LAP_ONLINE;
1318 atalk_post_msg(elapp->aa_ifp, KEV_ATALK_ZONEUPDATED, 0, &(elapp->ifZoneName));
1325 if ((elapp->startup_error = re_aarp(elapp))) {
1326 elapp->startup_inprogress = FALSE;
1327 wakeup(&elapp->startup_inprogress);
1336 elapp->startup_error = error;
1337 elapp->startup_inprogress = FALSE;
1338 wakeup(&elapp->startup_inprogress);
1349 at_ifaddr_t *elapp;
1351 elapp = probe_cb->elapp;
1352 if ( (elapp != NULL) && elapp->startup_inprogress && elapp->aa_ifp != 0) {
1355 errno = aarp_init2(elapp);
1360 elapp->ifName));
1361 (void)at_unreg_mcast(elapp, (caddr_t)&elapp->ZoneMcastAddr);
1362 (void)at_unreg_mcast(elapp, (caddr_t)&elapp->cable_multicast_addr);
1363 elapp->ifState = LAP_OFFLINE;
1364 ddp_rem_if(elapp);
1365 elapp->startup_error = EADDRNOTAVAIL;
1366 elapp->startup_inprogress = FALSE;
1367 wakeup(&elapp->startup_inprogress);
1372 elap_online2(elapp);
1506 at_ifaddr_t *elapp;
1512 for (i=0, elapp=at_interfaces,ifc=snmp->cfg_ifCfg;
1513 i<IF_TOTAL_MAX; i++, elapp++, ifc++) {
1514 if (elapp->ifState != LAP_OFFLINE) {
1516 strlcpy(ifc->ifc_name,elapp->ifName, sizeof(ifc->ifc_name));
1519 switch (elapp->aa_ifp->if_type) {
1533 ifc->ifc_start = elapp->ifThisCableStart;
1534 ifc->ifc_end = elapp->ifThisCableEnd;
1535 ifc->ifc_ddpAddr= elapp->ifThisNode;
1536 ifc->ifc_status = elapp->ifState == LAP_ONLINE ? 1 : 2;
1538 if (elapp->ifZoneName.len != 0) {
1539 ifc->ifc_zoneName = elapp->ifZoneName;
1541 else if (elapp->ifDefZone) {
1542 ifc->ifc_zoneName = ZT_table[elapp->ifDefZone-1].Zone;
1547 if (elapp->ifFlags & RTR_SEED_PORT) {
1557 if (elapp->ifRouterState == ROUTER_AROUND) {