Skip to content
Snippets Groups Projects
Select Git revision
  • 2a53a89aa611f51ad0a7f6de7d22ced1feea30f2
  • devel default protected
  • fix_crash_at_transport
  • wenpeng-1007
  • asterisk_rdkb
  • lk_debug_dialogs
  • lk_forking_revert
  • wenpeng-jul8
  • gyang-devel
  • gyang-devel1
  • wenpeng-jul9
  • asterisk_rdkb_ipv6
  • 16916_rdkb_merge
  • lk_disable_registrar
  • wenpeng-100rel-ippbx
  • fix_multiple_dns_lookup
  • dev_fxs_no_wb
  • fix_fallback
  • 14666_fxs_no_wideband_codec
  • fix_srv_records
  • fix_deadlock_in_bridge_peer_functions
  • 22.0.0-pre1
  • 21.4.2
  • 20.9.2
  • 18.24.2
  • certified-20.7-cert2
  • certified-18.9-cert11
  • 21.4.1
  • 20.9.1
  • 18.24.1
  • 21.4.0
  • 20.9.0
  • 18.24.0
  • certified-20.7-cert1
  • certified-18.9-cert10
  • 21.4.0-rc1
  • 20.9.0-rc1
  • 18.24.0-rc1
  • 21.3.1
  • 20.8.1
  • 18.23.1
41 results

sched.c

Blame
  • wol.h 1.40 KiB
    /* SPDX-License-Identifier: GPL-2.0+ */
    /*
     * wol - Wake-on-LAN
     *
     * Supports both Wake-on-LAN packet types:
     * - EtherType 0x0842 packets
     * - UDP packets on ports 0, 7 and 9.
     *
     * Copyright 2018 Lothar Felten, lothar.felten@gmail.com
     */
    
    #if defined(CONFIG_CMD_WOL)
    
    #ifndef __WOL_H__
    #define __WOL_H__
    
    #include <net.h>
    
    /**********************************************************************/
    
    #define WOL_SYNC_BYTE			0xFF
    #define WOL_SYNC_COUNT			6
    #define WOL_MAC_REPETITIONS		16
    #define WOL_DEFAULT_TIMEOUT		5000
    #define WOL_PASSWORD_4B			4
    #define WOL_PASSWORD_6B			6
    
    /*
     * Wake-on-LAN header
     */
    struct wol_hdr {
    	u8	wol_sync[WOL_SYNC_COUNT];			/* sync bytes */
    	u8	wol_dest[WOL_MAC_REPETITIONS * ARP_HLEN];	/* 16x MAC */
    	u8	wol_passwd[0];					/* optional */
    };
    
    /*
     * Initialize wol (beginning of netloop)
     */
    void wol_start(void);
    
    /*
     * Check incoming Wake-on-LAN packet for:
     * - sync bytes
     * - sixteen copies of the target MAC address
     *
     * Optionally store the four or six byte password in the environment
     * variable "wolpassword"
     *
     * @param ip IP header in the packet
     * @param len Packet length
     */
    void wol_receive(struct ip_udp_hdr *ip, unsigned int len);
    
    /*
     * Set the timeout for the reception of a Wake-on-LAN packet
     *
     * @param timeout in milliseconds
     */
    void wol_set_timeout(ulong timeout);
    
    /**********************************************************************/
    
    #endif /* __WOL_H__ */
    #endif