Lines Matching defs:li
152 struct logint *li);
156 struct sockaddr_in *sin, struct logint *li);
177 static void free_logint(struct logint *li);
181 static void added_logint(struct logint *li, int s,
183 static void deleted_logint(struct logint *li, struct logint *newli, int s,
188 struct ifreq *ifr, struct logint *li);
574 struct logint *li;
576 li = find_directly_connected_logint(sin->sin_addr, NULL);
577 if (li != NULL && (li->li_flags & IFF_NORTEXCH)) {
581 pr_type((int)icp->icmp_type), li->li_name);
609 struct logint *li, *li_tmp;
629 for (li = pi->pi_logical_first; li != NULL; li = li->li_next) {
630 if (li->li_state & ST_DELETED)
644 ap->addr = li->li_localaddr.s_addr;
645 ap->preference = htonl(li->li_preference);
769 struct logint *li;
789 li = find_directly_connected_logint(ip->ip_src, NULL);
790 if (li != NULL && (li->li_flags & IFF_NORTEXCH)) {
794 pr_type((int)icp->icmp_type), li->li_name);
982 if (li == NULL) {
1132 struct logint *li;
1138 for (li = pi->pi_logical_first; li != NULL; li = li->li_next) {
1139 if (li->li_state & ST_DELETED)
1142 if (li->li_flags & IFF_BROADCAST) {
1149 cc = sendbcastif(s, packet, packetlen, li);
1158 sendbcastif(int s, char *packet, int packetlen, struct logint *li)
1166 if ((li->li_flags & IFF_BROADCAST) == 0) {
1170 pr_type((int)icp->icmp_type), li->li_name);
1174 if (li->li_flags & IFF_NORTEXCH) {
1178 pr_type((int)icp->icmp_type), li->li_name);
1183 baddr.sin_addr = li->li_bcastaddr;
1201 struct logint *li;
1207 for (li = pi->pi_logical_first; li != NULL; li = li->li_next) {
1208 if (li->li_state & ST_DELETED)
1211 if (li->li_flags & IFF_MULTICAST) {
1218 cc = sendmcastif(s, packet, packetlen, sin, li);
1228 struct logint *li)
1236 if ((li->li_flags & IFF_MULTICAST) == 0) {
1240 pr_type((int)icp->icmp_type), li->li_name);
1244 if (li->li_flags & IFF_NORTEXCH) {
1248 pr_type((int)icp->icmp_type), li->li_name);
1253 ifaddr.sin_addr = li->li_address;
1285 struct logint *li;
1288 for (li = pi->pi_logical_first; li != NULL; li = li->li_next) {
1289 if (li->li_state & ST_DELETED)
1292 li->li_preference = preference;
1311 struct logint *li;
1323 for (li = pi->pi_logical_first; li != NULL; li = li->li_next) {
1324 li->li_state |= ST_MARKED;
1399 li = find_logint(pi, ifreq.ifr_name);
1400 if (li != NULL) {
1415 free_logint(li);
1419 if (newli.li_flags != li->li_flags ||
1421 li->li_localaddr.s_addr || newli.li_index !=
1422 li->li_index) {
1424 li->li_state |= ST_DELETED;
1425 deleted_logint(li, &newli, s, joinaddr);
1426 free_logint(li);
1427 li = NULL; /* li recreated below */
1433 li->li_netmask = newli.li_netmask;
1434 li->li_bcastaddr = newli.li_bcastaddr;
1437 if (li == NULL) {
1438 li = add_logint(pi, ifreq.ifr_name);
1439 if (li == NULL) {
1447 /* init li */
1449 &ifreq, li)) {
1450 free_logint(li);
1453 li->li_preference = preference;
1454 added_logint(li, s, joinaddr);
1456 li->li_state &= ~ST_MARKED;
1477 for (li = pi->pi_logical_first; li != NULL; li = li->li_next) {
1478 if (li->li_state & ST_MARKED) {
1480 li->li_state |= ST_DELETED;
1500 for (li = pi->pi_logical_first; li != NULL;
1501 li = li->li_next) {
1502 if (li->li_state & ST_DELETED) {
1503 deleted_logint(li, NULL, s,
1512 for (li = pi->pi_logical_first; li != NULL;
1513 li = nextli) {
1514 nextli = li->li_next;
1515 if (li->li_state & ST_DELETED)
1516 free_logint(li);
1541 struct ifreq *ifr, struct logint *li)
1549 li->li_flags = if_flags;
1551 li->li_localaddr = sin->sin_addr;
1558 li->li_index = 0;
1560 li->li_index = lifreq.lifr_index;
1564 li->li_netmask.s_addr = (unsigned long)0xffffffff;
1571 li->li_address = sin->sin_addr;
1572 li->li_remoteaddr = sin->sin_addr;
1574 li->li_bcastaddr = sin->sin_addr;
1575 li->li_flags |= IFF_BROADCAST;
1581 li->li_address = li->li_localaddr;
1582 li->li_remoteaddr = li->li_address;
1588 li->li_netmask = sin->sin_addr;
1596 li->li_bcastaddr = sin->sin_addr;
1634 struct logint *li;
1642 for (li = pi->pi_logical_first; li != NULL; li = li->li_next) {
1643 if (li->li_state & ST_DELETED)
1647 if ((in.s_addr & li->li_netmask.s_addr) ==
1648 (li->li_remoteaddr.s_addr &
1649 li->li_netmask.s_addr))
1650 return (li);
1667 struct logint *li;
1673 for (li = pi->pi_logical_first; li != NULL; li = li->li_next) {
1675 li->li_name, li->li_state, li->li_flags,
1676 pr_name(li->li_address));
1678 pr_name(li->li_localaddr), li->li_preference);
1680 pr_name(li->li_bcastaddr));
1682 pr_name(li->li_remoteaddr));
1684 pr_name(li->li_netmask));
1746 struct logint *li;
1748 for (li = pi->pi_logical_first; li != NULL; li = li->li_next) {
1749 if (strcmp(li->li_name, name) == 0)
1750 return (li);
1762 struct logint *li;
1764 li = malloc(sizeof (*li));
1765 if (li == NULL)
1767 bzero((char *)li, sizeof (*li));
1769 strncpy(li->li_name, name, sizeof (li->li_name));
1771 li->li_prev = pi->pi_logical_last;
1775 pi->pi_logical_first = li;
1777 pi->pi_logical_last->li_next = li;
1779 li->li_next = NULL;
1780 li->li_physical = pi;
1781 pi->pi_logical_last = li;
1782 return (li);
1787 free_logint(struct logint *li)
1791 pi = li->li_physical;
1792 if (li->li_prev == NULL) {
1794 assert(pi->pi_logical_first == li);
1795 pi->pi_logical_first = li->li_next;
1797 assert(li->li_prev->li_next == li);
1798 li->li_prev->li_next = li->li_next;
1800 if (li->li_next == NULL) {
1802 assert(pi->pi_logical_last == li);
1803 pi->pi_logical_last = li->li_prev;
1805 assert(li->li_next->li_prev == li);
1806 li->li_next->li_prev = li->li_prev;
1808 free(li);
1817 struct logint *li;
1822 for (li = pi->pi_logical_first; li != NULL; li = li->li_next) {
1823 li->li_state |= ST_DELETED;
1825 for (li = pi->pi_logical_first; li != NULL; li = li->li_next) {
1826 deleted_logint(li, NULL, s, joinaddr);
1835 added_logint(struct logint *li, int s,
1839 logdebug("Adding logical interface %s\n", li->li_name);
1841 if ((!(li->li_physical->pi_state & ST_JOINED)) &&
1846 mreq.imr_interface = li->li_address;
1849 logdebug("Joining MC on interface %s\n", li->li_name);
1855 li->li_physical->pi_state |= ST_JOINED;
1856 li->li_state |= ST_JOINED;
1877 deleted_logint(struct logint *li, struct logint *newli, int s,
1884 logdebug("Deleting logical interface %s\n", li->li_name);
1886 assert(li->li_state & ST_DELETED);
1888 if (li->li_state & ST_JOINED) {
1891 pi = li->li_physical;
1899 mreq.imr_interface = li->li_address;
1902 logdebug("Leaving MC on interface %s\n", li->li_name);
1922 li->li_physical->pi_state &= ~ST_JOINED;
1923 li->li_state &= ~ST_JOINED;