Skip to content

Commit

Permalink
Remove some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewLester committed Jul 15, 2023
1 parent aa42448 commit eef9209
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 524 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NTPal (Network Time Pal) — A Network Time Protocol System

NTPal is an in-development, incomplete, and rough around the edges implementation of an NTP client/server process. It also supports NTP symmetric mode, like any good friend would.
NTPal is an in-development, incomplete, and rough around the edges implementation of an NTP client/server process.

## Code Credits

Expand All @@ -22,7 +22,7 @@ The server is hosted on [fly.io](https://fly.io/) with a configuration outlined

NTPal uses a configuration format similar to the [standard `ntpd` config](https://docs.ntpsec.org/latest/ntp_conf.html), but with far fewer options. The available commands, with arguments defined in the `ntpd` config docs, are as follows:

- `server <address> [key _key_] [burst] [iburst] [version _version_] [prefer] [minpoll _minpoll_] [maxpoll _maxpoll_]`
- `server <address> [burst] [iburst] [version _version_] [prefer] [minpoll _minpoll_] [maxpoll _maxpoll_]`
- `driftfile <path>`

Some environment variables are also available to configure the application's runtime and logging:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (

require (
github.com/charmbracelet/harmonica v0.2.0 // indirect
github.com/charmbracelet/lipgloss v0.7.1 // indirect
github.com/charmbracelet/lipgloss v0.7.1
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect
)

Expand Down
2 changes: 0 additions & 2 deletions internal/ntp/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ type TransmitPacket struct {
Leap byte /* leap indicator */
Version byte /* version number */
Mode Mode /* mode */
Keyid int32 /* key ID */
Dgst Digest /* message digest */
NtpFieldsEncoded
}

Expand Down
5 changes: 3 additions & 2 deletions internal/ntp/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import (
)

const (
EraLength int64 = 4_294_967_296 // 2^32
UnixEraOffset int64 = 2_208_988_800 // 1970 - 1900 in seconds
EraLength int64 = 4_294_967_296 // 2^32
UnixEraOffset int64 = 2_208_988_800 // 1970 - 1900 in seconds
ShortLength float64 = 65536 // 2^16
)

func UnixToTime(t unix.Timeval) time.Time {
Expand Down
3 changes: 0 additions & 3 deletions pkg/ntpal/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ type serverAssociationConfig struct {
burst bool
iburst bool
prefer bool
key int
version int
minpoll int
maxpoll int
Expand Down Expand Up @@ -64,7 +63,6 @@ func parseConfig(path string) ntpConfig {
burst := optionalArgument("burst", &arguments)
iburst := optionalArgument("iburst", &arguments)
prefer := optionalArgument("prefer", &arguments)
key := integerArgument("key", -1, &arguments)
version := integerArgument("version", 4, &arguments)
minpoll := integerArgument("minpoll", defaultMinpoll, &arguments)
maxpoll := integerArgument("maxpoll", defaultMaxpoll, &arguments)
Expand Down Expand Up @@ -95,7 +93,6 @@ func parseConfig(path string) ntpConfig {
burst: burst,
iburst: iburst,
prefer: prefer,
key: key,
version: version,
minpoll: minpoll,
maxpoll: maxpoll,
Expand Down
Loading

0 comments on commit eef9209

Please sign in to comment.