Commit 6ffa8f53 authored by Jan Moskyto Matejka's avatar Jan Moskyto Matejka
Browse files

Hidden AF_INET* inside sysdep/

parent 5b218c3d
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ typedef struct birdsock {
  uint lifindex;			/* local interface that received the datagram */
  /* laddr and lifindex are valid only if SKF_LADDR_RX flag is set to request it */

  int af;				/* Address family (AF_INET, AF_INET6 or 0 for non-IP) of fd */
  int fam;				/* Address family (SK_FAM_* or 0 for non-IP) of fd */
  int fd;				/* System-dependent data */
  int index;				/* Index in poll buffer */
  int rcv_ttl;				/* TTL of last received datagram */
@@ -115,6 +115,12 @@ extern int sk_priority_control; /* Suggested priority for control traffic, shou
#define SK_UNIX_PASSIVE	8
#define SK_UNIX		9

/* Socket families */

#define SK_FAM_NONE	0
#define SK_FAM_IPV4	4
#define SK_FAM_IPV6	6

/*
 *  For SK_UDP or SK_IP sockets setting DA/DP allows to use sk_send(),
 *  otherwise sk_send_to() must be used.
+4 −4
Original line number Diff line number Diff line
@@ -204,11 +204,11 @@ bfd_open_rx_sk(struct bfd_proto *p, int multihop, int inet_version)

  switch (inet_version) {
    case 4:
      sk->af = AF_INET;
      sk->fam = SK_FAM_IPV4;
      sk->flags |= SKF_V4ONLY;
      break;
    case 6:
      sk->af = AF_INET6;
      sk->fam = SK_FAM_IPV6;
      sk->flags |= SKF_V6ONLY;
      break;
    default:
@@ -247,10 +247,10 @@ bfd_open_tx_sk(struct bfd_proto *p, ip_addr local, struct iface *ifa)
  sk->flags = SKF_THREAD | SKF_BIND | SKF_HIGH_PORT;

  if (ipa_is_ip4(local)) {
    sk->af = AF_INET;
    sk->fam = SK_FAM_IPV4;
    sk->flags |= SKF_V4ONLY;
  } else {
    sk->af = AF_INET6;
    sk->fam = SK_FAM_IPV6;
    sk->flags |= SKF_V6ONLY;
  }

+2 −2
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ ospf_sk_open(struct ospf_iface *ifa)
  sk->dport = OSPF_PROTO;
  sk->saddr = ifa->addr->ip;
  sk->iface = ifa->iface;
  sk->af = ospf_is_v2(p) ? AF_INET : AF_INET6;
  sk->fam = ospf_is_v2(p) ? SK_FAM_IPV4 : SK_FAM_IPV6;

  sk->tos = ifa->cf->tx_tos;
  sk->priority = ifa->cf->tx_priority;
@@ -194,7 +194,7 @@ ospf_open_vlink_sk(struct ospf_proto *p)
  sock *sk = sk_new(p->p.pool);
  sk->type = SK_IP;
  sk->dport = OSPF_PROTO;
  sk->af = ospf_is_v2(p) ? AF_INET : AF_INET6;
  sk->fam = ospf_is_v2(p) ? SK_FAM_IPV4 : SK_FAM_IPV6;

  /* FIXME: configurable tos/priority ? */
  sk->tos = IP_PREC_INTERNET_CONTROL;
+1 −1
Original line number Diff line number Diff line
@@ -412,7 +412,7 @@ radv_sk_open(struct radv_iface *ifa)
  sk->type = SK_IP;
  sk->dport = ICMPV6_PROTO;
  sk->saddr = ifa->addr->ip;
  sk->af = AF_INET6;
  sk->fam = SK_FAM_IPV6;

  sk->ttl = 255; /* Mandatory for Neighbor Discovery packets */
  sk->rx_hook = radv_rx_hook;
+1 −1
Original line number Diff line number Diff line
@@ -713,7 +713,7 @@ rip_open_socket(struct rip_iface *ifa)

  sock *sk = sk_new(p->p.pool);
  sk->type = SK_UDP;
  sk->af = rip_is_v2(p) ? AF_INET : AF_INET6;
  sk->fam = rip_is_v2(p) ? SK_FAM_IPV4 : SK_FAM_IPV6;
  sk->sport = ifa->cf->port;
  sk->dport = ifa->cf->port;
  sk->iface = ifa->iface;
Loading