MCPcopy Create free account

hub / github.com/andrey-vk/wdbgp / functions

Functions1,274 in github.com/andrey-vk/wdbgp

↓ 10 callersFunctionlegacyAddUser
legacyAddUser inserts a user directly in the pre-30 schema. It bypasses the store on purpose: the store now speaks the post-33 schema.
internal/store/030_dedupe_overlapping_networks_test.go:33
↓ 10 callersFunctionlegacyNetworksFor
(t *testing.T, db *sql.DB, userID int64)
internal/store/030_dedupe_overlapping_networks_test.go:74
↓ 10 callersFunctionstubPrimeVueComponents
()
webgui/src/admin/views/__tests__/PagesSmoke.test.ts:80
↓ 9 callersMethodAnnounce
Announce pushes routes to a specific peer, identified by its address and ASN.
internal/bgp/speaker.go:204
↓ 9 callersFunctionApply
(input []netip.Prefix, lists Lists, maxPrefixes int)
internal/prefixfilter/filter.go:16
↓ 9 callersMethodAuthenticateUser
AuthenticateUser looks up a user by login credential (login + password). It joins user_credentials with users and compares the bcrypt hash. Returns th
internal/store/users.go:486
↓ 9 callersFunctionInfo
(msg string, args ...any)
internal/logging/logging.go:131
↓ 9 callersMethodRecordUserSnapshot
RecordUserSnapshot saves a user metric snapshot, only when metrics are enabled. peerStates is the BGP peer state map (peer IP:ASN → state string).
internal/store/snapshots.go:246
↓ 9 callersMethodState
()
internal/bgp/peer_fsm.go:58
↓ 9 callersMethodUsers
(ctx context.Context, enabledOnly bool)
internal/store/users.go:160
↓ 9 callersMethodValidate
Validate reports whether v would be accepted by Set — same parse and domain-validation steps, without persisting or mutating anything. Lets a caller v
internal/settings/setting.go:44
↓ 9 callersMethodallow
(ip string)
internal/web/middleware.go:165
↓ 9 callersMethodapiModesCreate
apiModesCreate handles POST /api/admin/modes.
internal/web/handlers_api_modes.go:100
↓ 9 callersFunctiondecodePrefixes
decodePrefixes decodes NLRI/withdrawn prefixes from wire format. afi is the Address Family Identifier (1=IPv4, 2=IPv6).
internal/bgp/wire_decode.go:386
↓ 9 callersFunctionencodePrefixes
encodePrefixes serializes a slice of prefixes into wire format (NLRI / withdrawn).
internal/bgp/wire_encode.go:48
↓ 9 callersMethodsendNotification
sendNotification sends a BGP NOTIFICATION message.
internal/bgp/peer_fsm.go:521
↓ 9 callersMethodsetState
(state string)
internal/bgp/peer_fsm.go:552
↓ 8 callersMethodCatalogModes
(ctx context.Context, enabledOnly bool)
internal/store/modes.go:17
↓ 8 callersFunctionEncodePrefixString
EncodePrefixString parses and encodes a textual CIDR in one step.
internal/store/ipcodec.go:59
↓ 8 callersFunctionError
(msg string, args ...any)
internal/logging/logging.go:139
↓ 8 callersFunctionmkBool
(v: boolean | null, dv: boolean, env: boolean)
webgui/src/admin/views/__tests__/SettingsPage.spec.ts:12
↓ 8 callersFunctionmountUsersPage
()
webgui/src/admin/views/__tests__/UsersPage.spec.ts:118
↓ 8 callersFunctionstartSpeakerAndClient
startSpeakerAndClient starts a Speaker as a BGP server and a Peer as a client. The speaker listens on a random free port; the client connects to it.
internal/bgp/session_test.go:34
↓ 7 callersMethodActiveNetworksOverlap
ActiveNetworksOverlap reports whether any candidate network overlaps with an active (web_auth network/both/any, and enabled) network belonging to a di
internal/store/users.go:266
↓ 7 callersFunctionAggregateNetworks
AggregateNetworks parses each CIDR, then returns the minimal set of prefixes covering the same address space — masked, deduplicated, and with overlapp
internal/store/users.go:233
↓ 7 callersMethodCountPrefixes
CountPrefixes returns the number of unique IPv4 and IPv6 prefixes that would be announced for a given explicit selection (categories + services lists)
internal/store/catalog.go:175
↓ 7 callersFunctionEnsureServiceID
EnsureServiceID returns the dictionary id for a (category, service) name pair, creating both rows if needed.
internal/store/dictionaries.go:49
↓ 7 callersMethodFeed
(ctx context.Context, id int64)
internal/store/feeds.go:65
↓ 7 callersMethodFeedAdapters
(ctx context.Context)
internal/store/store.go:533
↓ 7 callersMethodGetFeedSnapshots
GetFeedSnapshots returns feed prefix counts for the last N days.
internal/store/snapshots.go:171
↓ 7 callersMethodSaveUserSnapshot
SaveUserSnapshot records user metrics, rate-limited to one row per userSnapshotMinInterval. If the last row is within the interval and values changed,
internal/store/snapshots.go:32
↓ 7 callersMethodSerialize
Serialize encodes the UPDATE message to wire format including header.
internal/bgp/wire_encode.go:170
↓ 7 callersMethodUpdateCatalogMode
(ctx context.Context, mode CatalogMode)
internal/store/modes.go:51
↓ 7 callersMethodUserByIP
network, both, any
internal/store/users.go:322
↓ 7 callersMethodapiFeedsList
(w http.ResponseWriter, r *http.Request)
internal/web/handlers_api_feeds.go:45
↓ 7 callersMethodclientIP
clientIP returns the address the request should be attributed to. When TrustProxyHeaders is on, the reverse proxy is trusted to append the real clien
internal/web/middleware.go:24
↓ 7 callersFunctiondecodePathAttributes
decodePathAttributes decodes path attributes from wire format.
internal/bgp/wire_decode.go:198
↓ 7 callersFunctionencodePathAttribute
encodePathAttribute encodes a single path attribute in TLV format.
internal/bgp/wire_encode.go:10
↓ 7 callersFunctionformatInt
(n int64)
internal/web/handlers_api_user_test.go:587
↓ 7 callersFunctionfreeTCPPort
freeTCPPort returns a free TCP port for testing.
internal/bgp/session_test.go:17
↓ 7 callersFunctionfreeTCPPortV6
============================================================================= IPv6 session tests — same patterns as IPv4 but over [::1] with IPv6 pref
internal/bgp/session_test.go:804
↓ 7 callersMethodlen
()
internal/bgp/session_test.go:135
↓ 7 callersFunctionmockAdapterFor
(status: number)
webgui/src/api/__tests__/client.spec.ts:5
↓ 7 callersFunctionnormalize
(prefixes []netip.Prefix)
internal/prefixfilter/filter.go:112
↓ 7 callersMethodrun
( ctx context.Context, feed store.Feed, adapter store.FeedAdapter, )
internal/feeds/javascript.go:47
↓ 6 callersFunctionAggregate
Aggregate returns the minimal set of CIDR prefixes that covers exactly the same address space as the input — masking host bits, dropping exact and sub
internal/prefixfilter/aggregate.go:16
↓ 6 callersMethodBuiltInAdapterVersion
BuiltInAdapterVersion returns the current builtin version for a given adapter ID.
internal/store/feed_adapters.go:273
↓ 6 callersMethodCatalogForMode
(ctx context.Context, modeID int64, includeDisabled bool)
internal/store/catalog.go:21
↓ 6 callersFunctionDo
Do executes fn with exponential backoff retry.
internal/retry/retry.go:129
↓ 6 callersFunctionEnsureCategoryID
EnsureCategoryID returns the dictionary id for a category name, creating the row if needed. Dictionary rows are append-only: a name referenced by a se
internal/store/dictionaries.go:37
↓ 6 callersMethodGetUserCredentials
GetUserCredentials returns all login credentials for a user.
internal/store/users.go:504
↓ 6 callersMethodGetUserSnapshots
GetUserSnapshots returns user metrics for the last N days.
internal/store/snapshots.go:144
↓ 6 callersMethodIsEnvSet
()
internal/settings/setting.go:34
↓ 6 callersFunctionNewCircuitBreaker
NewCircuitBreaker creates a new circuit breaker with the given configuration.
internal/retry/circuitbreaker.go:88
↓ 6 callersMethodSetCommunity
SetCommunity upserts a community. service="" means group-level.
internal/store/communities.go:83
↓ 6 callersMethodSyncAll
(ctx context.Context)
internal/feeds/feeds.go:139
↓ 6 callersMethodadapterToJSON
(a store.FeedAdapter)
internal/web/handlers_api_adapters.go:32
↓ 6 callersMethodapiFeedsCreate
(w http.ResponseWriter, r *http.Request)
internal/web/handlers_api_feeds.go:77
↓ 6 callersFunctioncallBoolSetting
(ctx context.Context, st settings.Setting[bool, bool], raw json.RawMessage)
internal/web/handlers_api_settings.go:498
↓ 6 callersFunctioncallBoolValidate
(st settings.Setting[bool, bool], raw json.RawMessage)
internal/web/handlers_api_settings.go:538
↓ 6 callersFunctiondbTableHasColumn
dbTableHasColumn reports whether a column exists on a table. A missing table yields false, not an error (pragma_table_info returns no rows).
internal/store/migrations/columns.go:20
↓ 6 callersFunctionifZero
(val, def int)
internal/feeds/feeds.go:90
↓ 6 callersMethodmaxForkedAdapterSuffix
(ctx context.Context, forkedFromID int64)
internal/store/feed_adapters.go:445
↓ 6 callersFunctionmountBanner
()
webgui/src/admin/layout/__tests__/BGPStatusBanner.test.ts:44
↓ 6 callersFunctionnewTestManager
newTestManager builds a Manager with its restart-only-setting snapshot (localASN/localAddrV4/localAddrV6) populated to match cfg, mirroring what start
internal/bgp/manager_test.go:30
↓ 6 callersFunctionparseDefaultRule
parseDefaultRule loops items until srsItemFinal.
internal/feeds/srs_parse.go:11
↓ 6 callersMethodsnapshot
()
internal/bgp/session_test.go:129
↓ 6 callersFunctiontestLimits
()
internal/feeds/feeds_test.go:29
↓ 5 callersFunctionEncodePrefix
EncodePrefix converts a prefix to its stored (ip, bits) form, masking it so the encoding is canonical.
internal/store/ipcodec.go:30
↓ 5 callersFunctionNewLogger
NewLogger creates a new logger with the specified level and format
internal/logging/logging.go:43
↓ 5 callersMethodPeerStates
PeerStates returns the BGP state for each configured peer.
internal/bgp/speaker.go:184
↓ 5 callersMethodRecordFeedSnapshot
RecordFeedSnapshot saves a feed prefix count snapshot, only when metrics are enabled.
internal/store/snapshots.go:225
↓ 5 callersMethodSaveFeedSnapshot
SaveFeedSnapshot records feed prefix counts, rate-limited to one row per feedSnapshotMinInterval. If the last row is within the interval and values ch
internal/store/snapshots.go:68
↓ 5 callersMethodSerialize
Serialize encodes the OPEN message to wire format including header. Advertises IPv6 unicast (RFC 4760) and Four-octet ASN (RFC 6793) capabilities. Use
internal/bgp/wire_encode.go:105
↓ 5 callersMethodSerialize
Serialize encodes the AS_PATH path attribute value. Uses AS_SEQUENCE (type code 2) for both 2-byte and 4-byte ASNs.
internal/bgp/wire_encode.go:246
↓ 5 callersMethodSetUserRouteFilters
(ctx context.Context, userID int64, filters RouteFilters)
internal/store/routes.go:347
↓ 5 callersFunctionToggleSelectedCategory
ToggleSelectedCategory adds or removes a single category selection.
internal/store/users.go:652
↓ 5 callersMethodUpdateFeed
(ctx context.Context, feed Feed)
internal/store/feeds.go:191
↓ 5 callersFunctionValidateDBPath
ValidateDBPath checks that a database file's parent directory, if it already exists, is actually a directory and is writable. A parent directory that
internal/settings/settings.go:585
↓ 5 callersMethodapiAdminUserSaveSelections
apiAdminUserSaveSelections handles PUT /api/admin/users/{id}/selections. Saves category/service selections for any user (admin-only), bypassing select
internal/web/handlers_api_users.go:1000
↓ 5 callersMethodapiFeedsUpdate
(w http.ResponseWriter, r *http.Request)
internal/web/handlers_api_feeds.go:145
↓ 5 callersMethodapiModeFeedsSet
apiModeFeedsSet handles PUT /api/admin/modes/{id}/feeds.
internal/web/handlers_api_modes.go:244
↓ 5 callersFunctioncontains
(prefixes []netip.Prefix, address netip.Addr)
internal/prefixfilter/filter_test.go:105
↓ 5 callersFunctionexpectErrorFallback
(componentPath: string, failingUrl: string)
webgui/src/admin/views/__tests__/PagesSmoke.test.ts:278
↓ 5 callersFunctionlegacyM30DB
Migration 30 ran against the text-era schema (user_networks.cidr TEXT, users.web_auth TEXT) — migration 33 later converted both to binary/enum form, s
internal/store/030_dedupe_overlapping_networks_test.go:20
↓ 5 callersFunctionmustGet
(t *testing.T, url string)
internal/web/server_spa_test.go:37
↓ 5 callersFunctionnewRateLimiter
(window time.Duration, maxRequests int)
internal/web/middleware.go:127
↓ 5 callersFunctionnext
()
webgui/src/composables/useSequencedRequest.ts:9
↓ 5 callersFunctionnormalize
(value string)
internal/feeds/feeds.go:563
↓ 5 callersFunctionreplayMigrationsBefore
replayMigrationsBefore applies every registered migration with Version < stop to db, mirroring store.go's runner (NoTxSQL first, then the transactiona
internal/store/migration_replay_test.go:15
↓ 5 callersFunctionrequireUser
requireUser extracts the authenticated user from the request context. Writes a 401 JSON response and returns false if the user is not authenticated.
internal/web/handlers_api_user.go:74
↓ 5 callersFunctionrunMigration30
(t *testing.T, db *sql.DB)
internal/store/030_dedupe_overlapping_networks_test.go:59
↓ 5 callersMethodsetBuiltInAdapterVersion
setBuiltInAdapterVersion records the current builtin version for an adapter ID. Guarded by builtInMu since this map is per-Store but can still be read
internal/store/feed_adapters.go:179
↓ 5 callersFunctionsetCSRFCookie
setCSRFCookie issues a new CSRF cookie, mirroring the lifetime of the session cookie it accompanies.
internal/web/middleware.go:67
↓ 5 callersFunctionsyncTestData
============================================================================= Helpers ================================================================
internal/store/store_auth_settings_test.go:875
↓ 5 callersMethoduserPeerState
(ctx context.Context, u store.User)
internal/web/handlers_api_users.go:130
↓ 5 callersFunctionuserToJSON
(u store.User, peerState string)
internal/web/handlers_api_users.go:99
↓ 4 callersMethodBuiltinAdapterAllowedHosts
BuiltinAdapterAllowedHosts returns the additional allowed hosts declared by a built-in adapter, or empty string if the adapter is not built-in (or a f
internal/store/feed_adapters.go:320
↓ 4 callersFunctionDoWithResult
DoWithResult executes fn with exponential backoff retry and returns a result.
internal/retry/retry.go:176
↓ 4 callersMethodGlobalRouteFilters
(ctx context.Context)
internal/store/routes.go:261
← previousnext →101–200 of 1,274, ranked by callers