OpenBSD CVS

CVS log for src/usr.sbin/ospf6d/rde_lsdb.c


[BACK] Up to [local] / src / usr.sbin / ospf6d

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.48 / (download) - annotate - [select for diffs], Wed Mar 8 04:43:14 2023 UTC (14 months, 3 weeks ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, HEAD
Changes since 1.47: +1 -2 lines
Diff to previous 1.47 (colored)

Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@

Revision 1.47 / (download) - annotate - [select for diffs], Sun Oct 4 07:24:46 2020 UTC (3 years, 7 months ago) by denis
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.46: +2 -2 lines
Diff to previous 1.46 (colored)

Fix indent

Revision 1.46 / (download) - annotate - [select for diffs], Sat Oct 3 13:39:56 2020 UTC (3 years, 7 months ago) by jan
Branch: MAIN
Changes since 1.45: +7 -9 lines
Diff to previous 1.45 (colored)

The new intra area db entry has to be saved into the tree before
orig_intra_area_prefix_lsas() is called.  If not, the ospf6d will not
announce the new intra area db for a newly learned link from another
ospf router of the broadcast domain.

OK denis@

Revision 1.45 / (download) - annotate - [select for diffs], Fri Aug 21 10:17:35 2020 UTC (3 years, 9 months ago) by jan
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.44: +2 -1 lines
Diff to previous 1.44 (colored)

Fix wrong fall through.  The IMSG_CTL_SHOW_DB_INTRA case should only
send back LSA with type LSA_TYPE_INTRA_A_PREFIX. LSA_TYPE_INTER_A_PREFIX
should not be included there.

OK claudio@

Revision 1.44 / (download) - annotate - [select for diffs], Fri Aug 21 08:32:23 2020 UTC (3 years, 9 months ago) by jan
Branch: MAIN
Changes since 1.43: +2 -4 lines
Diff to previous 1.43 (colored)

Remove redundent code.

OK claudio@, looks fine from tb@

Revision 1.43 / (download) - annotate - [select for diffs], Mon Feb 17 08:12:22 2020 UTC (4 years, 3 months ago) by denis
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.42: +50 -42 lines
Diff to previous 1.42 (colored)

Bring ospf6d closer to ospfd

- update debug messages to be more precise
- simplify call to lsa_self()
- drop lsa_find_lsid() redondant parameters

OK remi@

Revision 1.42 / (download) - annotate - [select for diffs], Tue Jan 21 15:17:13 2020 UTC (4 years, 4 months ago) by denis
Branch: MAIN
Changes since 1.41: +9 -8 lines
Diff to previous 1.41 (colored)

No need to pass peerid to lsa_snap()

OK remi@

Revision 1.41 / (download) - annotate - [select for diffs], Thu Jan 2 10:16:46 2020 UTC (4 years, 5 months ago) by denis
Branch: MAIN
Changes since 1.40: +3 -5 lines
Diff to previous 1.40 (colored)

Rename orig_rtr_lsa_area() to orig_rtr_lsa()

Now that area is part of iface, original orig_rtr_lsa() is useless. Also
verifying that area != NULL is not needed in some cases (these are
leftovers of the previous diff).

OK remi@

Revision 1.40 / (download) - annotate - [select for diffs], Mon Dec 23 07:33:49 2019 UTC (4 years, 5 months ago) by denis
Branch: MAIN
Changes since 1.39: +3 -5 lines
Diff to previous 1.39 (colored)

Area is now part of struct iface

OK remi@

Revision 1.39 / (download) - annotate - [select for diffs], Sun Dec 22 11:19:06 2019 UTC (4 years, 5 months ago) by denis
Branch: MAIN
Changes since 1.38: +31 -1 lines
Diff to previous 1.38 (colored)

Rename and move calc_nexthop_clear()/calc_nexthop_add()

OK claudio@

Revision 1.38 / (download) - annotate - [select for diffs], Fri Oct 18 11:16:52 2013 UTC (10 years, 7 months ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.37: +2 -2 lines
Diff to previous 1.37 (colored)

typo in function name in log message

Revision 1.37 / (download) - annotate - [select for diffs], Thu May 9 12:57:01 2013 UTC (11 years ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.36: +3 -5 lines
Diff to previous 1.36 (colored)

Simplify code, no binary change.

Revision 1.36 / (download) - annotate - [select for diffs], Mon Mar 25 14:29:35 2013 UTC (11 years, 2 months ago) by markus
Branch: MAIN
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

sync w/ospfd: improve snapshot handling; ok claudio, sthen

Revision 1.35 / (download) - annotate - [select for diffs], Sun Aug 22 20:55:10 2010 UTC (13 years, 9 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.34: +7 -3 lines
Diff to previous 1.34 (colored)

When removing an announced prefix, inherit the metric and ext_tag
from the LSA that is currently in the tree.  Based on claudio@'s
diff and his fix for ospfd.  Additionally originate an LSA with
external route tag correctly by writing the AS-external-LSA's bit
T into the correct field.
ok claudio@

Revision 1.34 / (download) - annotate - [select for diffs], Thu Jul 1 19:47:04 2010 UTC (13 years, 11 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.33: +4 -5 lines
Diff to previous 1.33 (colored)

Fix all white space bugs in ospf6d at once.  No binary change.
ok claudio@

Revision 1.33 / (download) - annotate - [select for diffs], Thu Jul 1 18:57:21 2010 UTC (13 years, 11 months ago) by bluhm
Branch: MAIN
Changes since 1.32: +14 -8 lines
Diff to previous 1.32 (colored)

The prefixes of interface addresses of an ospf link have to be
advertised as link-lsa and intra-area-prefix-lsa when they change
dynamically.  Handle RTM_NEWADDR and RTM_DELADDR in kroute by sending
an imsg to ospfe.  Upon this event, originate a new link-lsa in
ospfe.  In rde a new intra-area-prefix-lsa is generated when a
link-lsa appears or goes away.
ok claudio@; ok and test stsp@

Revision 1.32 / (download) - annotate - [select for diffs], Sat Jun 12 10:12:41 2010 UTC (13 years, 11 months ago) by bluhm
Branch: MAIN
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

Add a missing ntohs() around hdr.type.  This fixes a segfault as
the area of an ASE LSA is NULL.
ok claudio@

Revision 1.31 / (download) - annotate - [select for diffs], Wed Jun 9 17:36:36 2010 UTC (13 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.30: +5 -4 lines
Diff to previous 1.30 (colored)

Correctly decode prefixes. Fixes an infinite loop hit when the prefixlen is
not devidable by 32.  Problem found and identified by Martin Pelikán.

Revision 1.30 / (download) - annotate - [select for diffs], Mon Mar 1 08:55:45 2010 UTC (14 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.29: +40 -1 lines
Diff to previous 1.29 (colored)

Implement lsa_find_lsid(), a function that searches the LSDB for a LSA
specified by type, adv_rtr and an LSA to compare against. This is needed
to find either a free LS ID or the previously assigned LS ID of an AS-ext
LSA.  "looks like you know what you're doing" stsp@

Revision 1.29 / (download) - annotate - [select for diffs], Fri Feb 26 09:59:44 2010 UTC (14 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.28: +5 -5 lines
Diff to previous 1.28 (colored)

Swap order of RB tree sorting from type, ls_id, adv_rtr to type, adv_rtr,
ls_id. This is needed since sometimes the ls_id is not known and we need
to walk part of the tree.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Feb 23 11:17:23 2010 UTC (14 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.27: +60 -11 lines
Diff to previous 1.27 (colored)

Implement lsa_asext_check() to verify that type 5 LSA are correctly encoded.
Diff originally from stsp@, some minor modifications by me.
First step to support type 5 LSA.

Revision 1.27 / (download) - annotate - [select for diffs], Mon Feb 22 08:03:06 2010 UTC (14 years, 3 months ago) by stsp
Branch: MAIN
Changes since 1.26: +46 -27 lines
Diff to previous 1.26 (colored)

Treat multiple Router-LSAs originated by the same router as an
aggregate, as mandated by RFC5340.

OK claudio@

Revision 1.26 / (download) - annotate - [select for diffs], Sun Mar 29 19:18:20 2009 UTC (15 years, 2 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.25: +1 -22 lines
Diff to previous 1.25 (colored)

Remove lsa_find_net(), it isn't needed for OSPFv3.

pointed out by and ok claudio@

Revision 1.25 / (download) - annotate - [select for diffs], Sun Mar 29 19:14:23 2009 UTC (15 years, 2 months ago) by stsp
Branch: MAIN
Changes since 1.24: +34 -1 lines
Diff to previous 1.24 (colored)

Add lsa_find_rtr() function, which finds among multiple router
LSAs originated by the same router the one with the lowest link
state ID.

ok claudio@

Revision 1.24 / (download) - annotate - [select for diffs], Sun Mar 29 19:11:11 2009 UTC (15 years, 2 months ago) by stsp
Branch: MAIN
Changes since 1.23: +5 -5 lines
Diff to previous 1.23 (colored)

In lsa_num_links(), be more obvious about what parts of the LSA
are subtracted from the total length.

ok claudio@

Revision 1.23 / (download) - annotate - [select for diffs], Thu Mar 12 01:21:49 2009 UTC (15 years, 2 months ago) by stsp
Branch: MAIN
Changes since 1.22: +25 -31 lines
Diff to previous 1.22 (colored)

lsa_self() did too many things at once, and had too much logic
buried inside of it that its caller relied on.

So split it up as follows:
lsa_self()    Check whether an LSA is self-originated.
lsa_flush()   Flush an LSA from the LSDB.
lsa_reflood() Prepare an LSA for reflooding (actual reflooding currently
              requires sending an imsg which must be done by the caller).

ok claudio@

Revision 1.22 / (download) - annotate - [select for diffs], Tue Mar 10 17:36:39 2009 UTC (15 years, 2 months ago) by stsp
Branch: MAIN
Changes since 1.21: +30 -26 lines
Diff to previous 1.21 (colored)

Revert previous, I committed the wrong file, should have been rde_spf.c.

Revision 1.21 / (download) - annotate - [select for diffs], Tue Mar 10 17:32:14 2009 UTC (15 years, 2 months ago) by stsp
Branch: MAIN
Changes since 1.20: +27 -31 lines
Diff to previous 1.20 (colored)

The linked() function had an identity crisis and referred to itself
as "spf_calc" in fatal error messages.

Revision 1.20 / (download) - annotate - [select for diffs], Sun Mar 8 14:40:11 2009 UTC (15 years, 2 months ago) by stsp
Branch: MAIN
Changes since 1.19: +3 -16 lines
Diff to previous 1.19 (colored)

Remove #ifdef'd code which had a TODO comment essentially asking
"Do we need anything fancy to determine whether *-prefix-LSAs
are self-originated?"
The answer is "No, we don't, see section 4.6 of RFC5340."
ok claudio@

Revision 1.19 / (download) - annotate - [select for diffs], Sat Mar 7 00:33:13 2009 UTC (15 years, 2 months ago) by stsp
Branch: MAIN
Changes since 1.18: +19 -10 lines
Diff to previous 1.18 (colored)

Add lsa_find_tree() to allow searching for LSAs in a specific LSA tree.
We had code marked XXX searching an LSA tree manually using RB_FIND(),
switch it over to lsa_find_tree().
Make lsa_find() use the new function, too, to avoid code duplication.
ok claudio@

Revision 1.18 / (download) - annotate - [select for diffs], Thu Feb 12 16:54:31 2009 UTC (15 years, 3 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.17: +6 -9 lines
Diff to previous 1.17 (colored)

Make vertex_free() correctly free LSAs in per-interface LSA trees.

Save a pointer to the right LSA tree in new member v->lsa_tree.
This saves us the hassle of finding the right tree in vertex_free(),
we already know it at creation time so why not tuck it in there?

This might cause problems if the ospfe side ever decides to call
area_del() with a non-empty area->lsa_tree, without correctly
initialising v->lsa_tree. But grep shows that the area's lsa_tree
is currently just initialized on the ospfe side, but never modified.

ospf6d daemons which crashed after about 1 min with malloc options
FGJ are now happy.

ok claudio@

Revision 1.17 / (download) - annotate - [select for diffs], Thu Jan 29 18:52:17 2009 UTC (15 years, 4 months ago) by stsp
Branch: MAIN
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

In Link LSAs, #prefixes is a 32bit value.
But in Intra-Area-Prefix LSAs, #prefixes is a 16bit value.
lsa_intra_a_pref_check() was failing on little-endian machines because
it was trying to byte-swap a 32bit value.
ok claudio@

Revision 1.16 / (download) - annotate - [select for diffs], Thu Jan 29 16:39:24 2009 UTC (15 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.15: +6 -5 lines
Diff to previous 1.15 (colored)

lsa_get_prefix() should return the number of bytes consumed and not the
number of bytes left in the buffer. OK stsp@

Revision 1.15 / (download) - annotate - [select for diffs], Wed Jan 28 22:47:36 2009 UTC (15 years, 4 months ago) by stsp
Branch: MAIN
Changes since 1.14: +4 -1 lines
Diff to previous 1.14 (colored)

Teach ospf6d to originate Intra-Area-Prefix LSAs, which associate a list
of IPv6 prefixes with a Network LSA (there's another type of this LSA which
associates prefixes with a Router LSA -- this remains to be done).
Add what is necessary to allow ospf6ctl to read the new LSA type via IMSG.
ok claudio@

Revision 1.14 / (download) - annotate - [select for diffs], Sat Jan 3 00:23:50 2009 UTC (15 years, 5 months ago) by stsp
Branch: MAIN
Changes since 1.13: +10 -5 lines
Diff to previous 1.13 (colored)

Since link LSAs live in iface->lsa_tree and not in area->lsa_tree,
we had better include LSAs from iface->lsa_tree when sending
DB summaries. Fixes initial flood of link LSAs.
ok claudio@

Revision 1.13 / (download) - annotate - [select for diffs], Tue Dec 30 22:24:34 2008 UTC (15 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.12: +14 -13 lines
Diff to previous 1.12 (colored)

lsa_get_prefix() needs to use something else then struct lsa_prefix to
store the prefix to because the onwire format has the prefix compressed and
so struct lsa_prefix will no longer carry the prefix in it. Use rt_prefix
instead which is the expanded and host-byte-order version of the former.

Revision 1.12 / (download) - annotate - [select for diffs], Tue Dec 30 21:31:54 2008 UTC (15 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.11: +5 -1 lines
Diff to previous 1.11 (colored)

First try at originating Link (type-8) LSA. Code is wrong and the initial
LSA is lost in lsa_flood. Put this in because it goes in the right direction
and ospf6d is work in progress. Add necessary framework so that we can print
Link LSA in ospf6ctl.
Diff mostly from stsp@ ospf6ctl part by myself

Revision 1.11 / (download) - annotate - [select for diffs], Sun Dec 28 21:20:34 2008 UTC (15 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.10: +8 -6 lines
Diff to previous 1.10 (colored)

Part of lsa_self() works at least everything with us as adv_rtr should be
killed. From Stefan Sperling

Revision 1.10 / (download) - annotate - [select for diffs], Mon Feb 11 13:48:39 2008 UTC (16 years, 3 months ago) by norby
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

Correct the output of several error and debug messages.

Revision 1.9 / (download) - annotate - [select for diffs], Thu Dec 13 08:54:05 2007 UTC (16 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.8: +10 -4 lines
Diff to previous 1.8 (colored)

Monster commit of stuff I did mostly last month. What it does:
 * removes kif and uses iface for everything interface related.
   This removes unneeded data redundancy which makes the code more complex.
 * adds the link local prefix to struct iface and attaches a list with
   the other prefixes to the struct iface. This is needed to generate the
   link LSA.
 * disconnects struct iface from struct area (the backpointer is gone)
   this will make the reload code a bit easier.
norby@ agrees with the direction we're heading with this

Revision 1.8 / (download) - annotate - [select for diffs], Tue Nov 27 12:23:06 2007 UTC (16 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.7: +13 -9 lines
Diff to previous 1.7 (colored)

Make lsa_find() find link local LSA by passing the interface instead of the
area as lookup point. Additionally make lsa_dump or actually the code around
it pass all LSA to ospf6ctl. The rde_spf.c are not final.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Nov 27 11:29:34 2007 UTC (16 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.6: +127 -29 lines
Diff to previous 1.6 (colored)

Monster diff to bring us a bit on track again.
a) implement all (or at least most) lsa_check() cases.
b) classify the LSA scope correctly and add a per interface lsa_tree for
   the link local stuff.
c) implement a function to parse a prefix.

There is still a lot missing currently link local LSA are added to the
interface tree but nothing can access them (lsa_find() and a few friends
need some changes).
OK norby@

Revision 1.6 / (download) - annotate - [select for diffs], Sat Nov 24 16:42:58 2007 UTC (16 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.5: +4 -3 lines
Diff to previous 1.5 (colored)

lsa_self() is completely busted at the moment, so just ignore it.
Currently ospf6d is unable to announce a thing so there is no need to cleanup.

Revision 1.5 / (download) - annotate - [select for diffs], Tue Oct 16 21:58:17 2007 UTC (16 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.4: +3 -2 lines
Diff to previous 1.4 (colored)

Make struct lsa_rtr a better match of the reality. Still not happy because
some people had the great idea to make the OSPF options 24bits. Still undecided
if a u_int32_t should be used or 4 u_int8_t both is gross.

Revision 1.4 / (download) - annotate - [select for diffs], Tue Oct 16 21:02:26 2007 UTC (16 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.3: +12 -12 lines
Diff to previous 1.3 (colored)

Big round of lsa type cleanup. Moving from u_int8_t to u_int16_t made a lot
of ntohs() necessary. Nota bene the lsa type is cached in the vertex node in
host byte order. Additionally the defines are in host byte order so sprinkle
some ntohs() over rde_lsdb.c.

Revision 1.3 / (download) - annotate - [select for diffs], Tue Oct 16 13:01:07 2007 UTC (16 years, 7 months ago) by norby
Branch: MAIN
Changes since 1.2: +4 -7 lines
Diff to previous 1.2 (colored)

Make ospf6d(8) not throw up on Router LSAs.

Initial step towards actually storing real LSAs.

ok claudio@

Revision 1.2 / (download) - annotate - [select for diffs], Tue Oct 16 12:05:52 2007 UTC (16 years, 7 months ago) by norby
Branch: MAIN
Changes since 1.1: +15 -9 lines
Diff to previous 1.1 (colored)

In OSPFv3 the LSA type is a 16 bit value, furthermore it uses different
values than the v2 counterpart.

Change to u_int16_t and define new LSA types.

ok claudio@

Revision 1.1 / (download) - annotate - [select for diffs], Mon Oct 8 10:44:51 2007 UTC (16 years, 7 months ago) by norby
Branch: MAIN

Welcome ospf6d

The new ospf6d daemon will support OSPFv3, basically OSPF for IPv6 networks.

It is heavily based on ospfd(8), it is more or less a copy and paste of it.
Currently some unneeded stuff has been removed and the trasition from
IPv4 to IPv6 has begun.

ospf6d is not very usefull at the moment, it is being imported to allow more
people to work on it concurrently.

Not yet connected to the builds.

ok claudio@ dlg@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.