Skip to content
Snippets Groups Projects
Select Git revision
  • b984cf8d3ce4063ae750a4423218cbd83f2105d1
  • iopsys default
  • uci-to-table
  • issue_fixed
  • greenkeeper/initial
  • master protected
  • karo/log
  • snyk-fix-8e3a3f5428e7d2f2a6a0b21052232807
  • snyk-fix-c6962d7d56b2e303922077c21f80e4c4
  • reqProp
  • semantic-release
  • type-arrays
  • console-logger
  • draft-07-support
  • contrib-tweak
  • 48-readme-status
  • 35-identifiable
  • 56-stable-sort
  • release/1.0.4
  • 36-attribute-links
  • 46-blockquote-escape
  • v3.3.1
  • v3.3.0
  • v3.2.0
  • v3.1.2
  • v3.1.1
  • v3.1.0
  • v3.0.1
  • v3.0.0
  • v2.1.2
  • v2.1.1
  • v2.1.0
  • v2.0.0
  • v1.0.0
  • 1.1.0
  • 1.0.6
  • 1.0.5
  • 1.0.2
  • 1.0.1
39 results

extensible.schema.md

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