diff options
| author | Christian Franke <chris@opensourcerouting.org> | 2017-04-27 12:56:11 +0200 | 
|---|---|---|
| committer | Christian Franke <chris@opensourcerouting.org> | 2017-04-28 12:03:23 +0200 | 
| commit | 316a98ecd151dfba86a4a87e11c98cb2a0e94518 (patch) | |
| tree | dbbf666c211c4458f4313fbfd5043befff46be69 /isisd/isis_bpf.c | |
| parent | 1b49e4f0ba4073821701cb339bde94055d3b5786 (diff) | |
isisd: implement draft-ietf-isis-ext-eth and support p2p over LAN on BSD
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Diffstat (limited to 'isisd/isis_bpf.c')
| -rw-r--r-- | isisd/isis_bpf.c | 33 | 
1 files changed, 3 insertions, 30 deletions
diff --git a/isisd/isis_bpf.c b/isisd/isis_bpf.c index 3a5eaf5585..0a1610b6f2 100644 --- a/isisd/isis_bpf.c +++ b/isisd/isis_bpf.c @@ -212,16 +212,11 @@ isis_sock_init (struct isis_circuit *circuit)        goto end;      } -  if (circuit->circ_type == CIRCUIT_T_BROADCAST) +  if (if_is_broadcast(circuit->interface))      {        circuit->tx = isis_send_pdu_bcast;        circuit->rx = isis_recv_pdu_bcast;      } -  else if (circuit->circ_type == CIRCUIT_T_P2P) -    { -      circuit->tx = isis_send_pdu_p2p; -      circuit->rx = isis_recv_pdu_p2p; -    }    else      {        zlog_warn ("isis_sock_init(): unknown circuit type"); @@ -284,23 +279,6 @@ isis_recv_pdu_bcast (struct isis_circuit *circuit, u_char * ssnpa)  }  int -isis_recv_pdu_p2p (struct isis_circuit *circuit, u_char * ssnpa) -{ -  int bytesread; - -  bytesread = stream_read (circuit->rcv_stream, circuit->fd,  -                           circuit->interface->mtu); - -  if (bytesread < 0) -    { -      zlog_warn ("isis_recv_pdu_p2p(): read () failed: %s", safe_strerror (errno)); -      return ISIS_WARNING; -    } - -  return ISIS_OK; -} - -int  isis_send_pdu_bcast (struct isis_circuit *circuit, int level)  {    struct ether_header *eth; @@ -327,7 +305,8 @@ isis_send_pdu_bcast (struct isis_circuit *circuit, int level)    else      memcpy (eth->ether_dhost, ALL_L2_ISS, ETHER_ADDR_LEN);    memcpy (eth->ether_shost, circuit->u.bc.snpa, ETHER_ADDR_LEN); -  eth->ether_type = htons (stream_get_endp (circuit->snd_stream) + LLC_LEN); +  size_t frame_size = stream_get_endp(circuit->snd_stream) + LLC_LEN; +  eth->ether_type = htons(isis_ethertype(frame_size));    /*     * Then the LLC @@ -354,10 +333,4 @@ isis_send_pdu_bcast (struct isis_circuit *circuit, int level)    return ISIS_OK;  } -int -isis_send_pdu_p2p (struct isis_circuit *circuit, int level) -{ -  return ISIS_OK; -} -  #endif /* ISIS_METHOD == ISIS_METHOD_BPF */  | 
